remove minecraft multi-instance support
This commit is contained in:
parent
302b6525f6
commit
cfe9012e32
@ -15,8 +15,7 @@ minecraft_jar_url: https://launcher.mojang.com/v1/objects/bb2b6b1aefcd70dfd18921
|
|||||||
minecraft_jar_checksum: sha256:80cf86dc2004ec6a2dc0183d1c75a9af3ba0669f7c332e4247afb1d76fb67e8a
|
minecraft_jar_checksum: sha256:80cf86dc2004ec6a2dc0183d1c75a9af3ba0669f7c332e4247afb1d76fb67e8a
|
||||||
|
|
||||||
minecraft_opt_path: /opt/minecraft
|
minecraft_opt_path: /opt/minecraft
|
||||||
minecraft_var_path: "{{ minecraft_opt_path }}/var"
|
minecraft_var_path: /var/opt/minecraft
|
||||||
minecraft_backup_path: "{{ minecraft_opt_path }}/backup"
|
|
||||||
|
|
||||||
minecraft_syslog_facility: local5
|
minecraft_syslog_facility: local5
|
||||||
|
|
||||||
|
@ -14,9 +14,3 @@
|
|||||||
service:
|
service:
|
||||||
name: rsyslog
|
name: rsyslog
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: restart minecraft instances
|
|
||||||
service:
|
|
||||||
name: "minecraft@{{ item.name }}.service"
|
|
||||||
state: restarted
|
|
||||||
loop: "{{ minecraft_worlds | default([]) }}"
|
|
||||||
|
@ -37,12 +37,11 @@
|
|||||||
|
|
||||||
- name: create minecraft var directory
|
- name: create minecraft var directory
|
||||||
file:
|
file:
|
||||||
path: "{{ minecraft_var_path }}/{{ item.name }}"
|
path: "{{ minecraft_var_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ minecraft_user }}"
|
owner: "{{ minecraft_user }}"
|
||||||
group: "{{ minecraft_group }}"
|
group: "{{ minecraft_group }}"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
loop: "{{ minecraft_worlds }}"
|
|
||||||
|
|
||||||
- name: download minecraft server
|
- name: download minecraft server
|
||||||
get_url:
|
get_url:
|
||||||
@ -52,31 +51,29 @@
|
|||||||
group: "{{ minecraft_group }}"
|
group: "{{ minecraft_group }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
checksum: "{{ minecraft_jar_checksum }}"
|
checksum: "{{ minecraft_jar_checksum }}"
|
||||||
notify: restart minecraft instances
|
notify: restart minecraft
|
||||||
|
|
||||||
- name: agree to the eula
|
- name: agree to the eula
|
||||||
copy:
|
copy:
|
||||||
content: "eula=true"
|
content: "eula=true"
|
||||||
dest: "{{ minecraft_var_path }}/{{ item.name }}/eula.txt"
|
dest: "{{ minecraft_var_path }}/eula.txt"
|
||||||
owner: "{{ minecraft_user }}"
|
owner: "{{ minecraft_user }}"
|
||||||
group: "{{ minecraft_group }}"
|
group: "{{ minecraft_group }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
loop: "{{ minecraft_worlds }}"
|
|
||||||
|
|
||||||
- name: configure minecraft
|
- name: configure minecraft
|
||||||
template:
|
template:
|
||||||
src: server.properties.j2
|
src: server.properties.j2
|
||||||
dest: "{{ minecraft_var_path }}/{{ item.name }}/server.properties"
|
dest: "{{ minecraft_var_path }}/server.properties"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart minecraft instances
|
notify: restart minecraft
|
||||||
loop: "{{ minecraft_worlds }}"
|
|
||||||
|
|
||||||
- name: configure systemd unit
|
- name: configure systemd unit
|
||||||
template:
|
template:
|
||||||
src: minecraft.service.j2
|
src: minecraft.service.j2
|
||||||
dest: /etc/systemd/system/minecraft@.service
|
dest: /etc/systemd/system/minecraft.service
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
@ -85,30 +82,9 @@
|
|||||||
|
|
||||||
- name: manage minecraft service
|
- name: manage minecraft service
|
||||||
service:
|
service:
|
||||||
name: "minecraft@{{ item.name }}"
|
name: minecraft.service
|
||||||
state: "{{ item.state | default(minecraft_service_state) }}"
|
state: "{{ minecraft_service_state }}"
|
||||||
enabled: "{{ item.enabled | default(minecraft_service_enabled) }}"
|
enabled: "{{ minecraft_service_enabled }}"
|
||||||
loop: "{{ minecraft_worlds }}"
|
|
||||||
|
|
||||||
#- name: configure ops
|
|
||||||
# copy:
|
|
||||||
# content: "{{ (minecraft_ops | default([])) | to_nice_json }}"
|
|
||||||
# dest: "{{ minecraft_var_path }}/ops.json"
|
|
||||||
# owner: "{{ minecraft_user }}"
|
|
||||||
# group: "{{ minecraft_group }}"
|
|
||||||
# mode: "0644"
|
|
||||||
# force: no
|
|
||||||
# notify: restart minecraft instances
|
|
||||||
#
|
|
||||||
#- name: configure whitelist
|
|
||||||
# copy:
|
|
||||||
# content: "{{ (minecraft_whitelist | default([])) | to_nice_json }}"
|
|
||||||
# dest: "{{ minecraft_var_path }}/whitelist.json"
|
|
||||||
# owner: "{{ minecraft_user }}"
|
|
||||||
# group: "{{ minecraft_group }}"
|
|
||||||
# mode: "0644"
|
|
||||||
# force: no
|
|
||||||
# notify: restart minecraft instances
|
|
||||||
|
|
||||||
- name: install discord notifier
|
- name: install discord notifier
|
||||||
copy:
|
copy:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# {{ ansible_managed }}
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Minecraft server %i
|
Description=Minecraft server
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@ -10,7 +10,7 @@ SuccessExitStatus=143
|
|||||||
Type=simple
|
Type=simple
|
||||||
User={{ minecraft_user }}
|
User={{ minecraft_user }}
|
||||||
Group={{ minecraft_group }}
|
Group={{ minecraft_group }}
|
||||||
WorkingDirectory={{ minecraft_var_path }}/%i
|
WorkingDirectory={{ minecraft_var_path }}
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
SyslogIdentifier=minecraft
|
SyslogIdentifier=minecraft
|
||||||
SyslogFacility={{ minecraft_syslog_facility }}
|
SyslogFacility={{ minecraft_syslog_facility }}
|
||||||
|
Loading…
Reference in New Issue
Block a user