Remove docker-minecraft, docker-tes3mp, and keepalived roles

This commit is contained in:
Salt 2024-04-23 18:03:14 -05:00
parent bc6f76a07d
commit 9ac28a281b
10 changed files with 0 additions and 214 deletions

View File

@ -1,35 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
# Overall app settings
minecraft_name: generic
#minecraft_pack_zip: "https://example.com/path/to/pack.zip"
# Container settings
minecraft_uid: 1520
minecraft_gid: 1520
minecraft_state: started
# See the tags for this image for more versions
minecraft_image: rehashedsalt/minecraft-forge:1.16.5-master
minecraft_restart_policy: unless-stopped
minecraft_timezone: "America/Chicago"
# Container network settings
minecraft_external_port: "25565"
minecraft_data_prefix: "/data/minecraft/{{ minecraft_name }}"
# Java settings
minecraft_jvm_args: "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1"
minecraft_jvm_extra_args: ""
minecraft_xmx: "8G"
minecraft_xms: "4G"
# server.properties
minecraft_server_properties:
allow-flight: true
difficulty: hard
gamemode: survival
level-name: world
level-type: default
max-players: 20
motd: A Minecraft Server
server-port: 25565
spawn-protection: 0
view-distance: 10

View File

@ -1,7 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: restart minecraft {{ minecraft_name }}
docker_container:
name: "minecraft-{{ minecraft_name }}"
state: started
restart: yes

View File

@ -1,58 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: assure minecraft {{ minecraft_name }} directory structure
file:
state: directory
owner: "{{ minecraft_uid }}"
group: "{{ minecraft_gid }}"
mode: "0750"
path: "{{ item }}"
# We recurse here since these directories *and all of their contents*
# should be read-write by the container without exception.
recurse: yes
with_items:
- "{{ minecraft_data_prefix }}/backups"
- "{{ minecraft_data_prefix }}/logs"
- "{{ minecraft_data_prefix }}/world"
- name: assure minecraft {{ minecraft_name }} files
file:
state: touch
owner: "{{ minecraft_uid }}"
group: "{{ minecraft_gid }}"
mode: "0640"
path: "{{ item }}"
with_items:
- "{{ minecraft_data_prefix }}/ops.json"
- "{{ minecraft_data_prefix }}/server.properties"
- name: assure {{ minecraft_name }} server properties
lineinfile:
state: present
regexp: "^{{ item.key }}"
line: "{{ item.key }}={{ item.value }}"
path: "{{ minecraft_data_prefix }}/server.properties"
with_dict: "{{ minecraft_server_properties }}"
notify: "restart minecraft {{ minecraft_name }}"
- name: assure minecraft {{ minecraft_name }} container
docker_container:
name: "minecraft-{{ minecraft_name }}"
state: "{{ minecraft_state }}"
image: "{{ minecraft_image }}"
restart_policy: "{{ minecraft_restart_policy }}"
pull: yes
user: "{{ minecraft_uid }}:{{ minecraft_gid }}"
env:
TZ: "{{ minecraft_timezone }}"
ARGS: "{{ minecraft_jvm_args }} {{ minecraft_jvm_extra_args }}"
JRE_XMX: "{{ minecraft_xmx }}"
JRE_XMS: "{{ minecraft_xms }}"
FORGE_PACK_ZIP: "{{ minecraft_pack_zip }}"
ports:
- "{{ minecraft_external_port }}:25565/tcp"
- "{{ minecraft_external_port }}:25565/udp"
volumes:
- "{{ minecraft_data_prefix }}/backups:/minecraft/backups"
- "{{ minecraft_data_prefix }}/logs:/minecraft/logs"
- "{{ minecraft_data_prefix }}/ops.json:/minecraft/ops.json"
- "{{ minecraft_data_prefix }}/server.properties:/minecraft/server.properties"
- "{{ minecraft_data_prefix }}/world:/minecraft/world"

View File

@ -1,4 +0,0 @@
{{ ansible_managed }}
{% for property in minecraft_server_properties %}
{{ property.key }}={{ property.value }}
{% endfor %}

View File

@ -1,19 +0,0 @@
# vim:ft=ansible:
# Overall app settings
tes3mp_name: generic
# Container settings
tes3mp_uid: 0
tes3mp_gid: 0
tes3mp_state: started
tes3mp_image: tes3mp/server:0.8.1
tes3mp_restart_policy: unless-stopped
tes3mp_timezone: "America/Chicago"
# Container network settings
tes3mp_external_port: 25565
tes3mp_data_prefix: "/data/tes3mp/{{ tes3mp_name }}"
# TES3MP settings
tes3mp_server_maximum_players: "8"
tes3mp_server_hostname: "Some Ansible-deployed server"
tes3mp_server_password: "dicks"

View File

@ -1,36 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: assure tes3mp {{ tes3mp_name }} directory structure
ansible.builtin.file:
state: directory
owner: "{{ tes3mp_uid }}"
group: "{{ tes3mp_gid }}"
mode: "0750"
path: "{{ item }}"
recurse: yes
with_items:
- "{{ tes3mp_data_prefix }}/data"
- "{{ tes3mp_data_prefix }}/backups"
- name: assure tes3mp {{ tes3mp_name }} backup cronjob
ansible.builtin.cron:
user: root
name: "tes3mp-{{ tes3mp_name }}"
minute: "*/10"
job: "tar czvf \"{{ tes3mp_data_prefix }}/backups/tes3mp-$(date +%Y-%M-%d-%H%M).tgz\" \"{{ tes3mp_data_prefix }}/data\""
- name: assure tes3mp {{ tes3mp_name }} container
docker_container:
name: "tes3mp-{{ tes3mp_name }}"
state: started
image: "{{ tes3mp_image }}"
restart_policy: "{{ tes3mp_restart_policy }}"
pull: yes
user: "{{ tes3mp_uid }}:{{ tes3mp_gid }}"
env:
TZ: "{{ tes3mp_timezone }}"
TES3MP_SERVER_MAXIMUM_PLAYERS: "{{ tes3mp_server_maximum_players }}"
TES3MP_SERVER_HOSTNAME: "{{ tes3mp_server_hostname }}"
TES3MP_SERVER_PASSWORD: "{{ tes3mp_server_password }}"
ports:
- "25565:25565/udp"
volumes:
- "{{ tes3mp_data_prefix }}/data:/server/data"

View File

@ -1,22 +0,0 @@
# vim:ft=ansible:
# A list of stanzas to put in the keepalived.conf file
keepalived_stanzas: []
#keepalived_stanzas:
# # Name of the vrrp instance
# - name: VI_1
# # Node state. Should be "MASTER" on the master and "BACKUP" on backup machines
# state: BACKUP
# # The interface to assign the VIP to
# interface: eth0
# # The virtual router ID
# virtual_router_id: 51
# # Node priority. Should be assigned differently for each host
# priority: 100
# # Advertisement interval in seconds
# advert_int: 1
# # Keepalived authentication password
# auth_pass: mySuperSecretPassword
# # The VIP to pass around. Include the subnet mask like so:
# # 192.168.0.5/24
# vip: 1.2.3.4

View File

@ -1,6 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: restart keepalived
throttle: 1
systemd: name=keepalived state=restarted

View File

@ -1,11 +0,0 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: install keepalived
apt: name=keepalived state=present
when: ansible_os_family == 'Debian'
- name: template out config
template: src=keepalived.conf dest=/etc/keepalived/keepalived.conf mode="0640"
notify: restart keepalived
- name: ensure keepalived is running
systemd: name=keepalived state=started enabled=yes

View File

@ -1,16 +0,0 @@
{% for stanza in keepalived_stanzas %}
vrrp_instance {{ stanza.name }} {
state {{ stanza.state | default('BACKUP') }}
interface {{ stanza.interface }}
virtual_router_id {{ stanza.virtual_router_id }}
priority {{ stanza.priority }}
advert_int {{ stanza.advert_int | default('1') }}
authentication {
auth_type PASS
auth_pass {{ stanza.auth_pass }}
}
virtual_ipaddress {
{{ stanza.vip }}
}
}
{% endfor %}