Skip to content

Commit

Permalink
Use FQCN for Ansible 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Obihoernchen committed May 2, 2021
1 parent b999ee1 commit 87724b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions tasks/crontabs.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
- name: Create cron log directory
file:
ansible.builtin.file:
path: "{{ lgsm_installdir }}/log/cron"
state: directory
mode: "0755"
owner: "{{ lgsm_user }}"
group: "{{ lgsm_group }}"

- name: Cron to monitor server health
cron:
ansible.builtin.cron:
name: lgsm monitoring crontab
minute: "*/30"
user: "{{ lgsm_user }}"
job: "{{ lgsm_installdir }}/{{ lgsm_server }} monitor >> {{ lgsm_installdir }}/log/cron/{{ lgsm_server }}-monitor.log 2>&1"
cron_file: lgsm-crontabs

- name: Cron to update lgsm
cron:
ansible.builtin.cron:
name: lgsm update cron
weekday: "0"
minute: "0"
Expand All @@ -26,7 +26,7 @@
cron_file: lgsm-crontabs

- name: Cron to update gameserver
cron:
ansible.builtin.cron:
name: gameserver update cron
minute: "0"
hour: "4"
Expand Down
10 changes: 5 additions & 5 deletions tasks/install_gameserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
- name: Get gameserver control scripts
become: true
become_user: '{{ lgsm_user }}'
command: "{{ lgsm_installdir }}/{{ lgsm_installer_name }} {{ lgsm_server }}"
ansible.builtin.command: "{{ lgsm_installdir }}/{{ lgsm_installer_name }} {{ lgsm_server }}"
args:
chdir: "{{ lgsm_installdir }}"
creates: "{{ lgsm_installdir }}/{{ lgsm_server }}"

- name: Install gameserver
become: true
become_user: '{{ lgsm_user }}'
command: "{{ lgsm_installdir }}/{{ lgsm_server }} auto-install"
ansible.builtin.command: "{{ lgsm_installdir }}/{{ lgsm_server }} auto-install"
args:
chdir: "{{ lgsm_installdir }}"
creates: "{{ lgsm_installdir }}/serverfiles"
when: lgsm_install_server

- name: Create instance config file
template:
ansible.builtin.template:
src: instance.cfg.j2
dest: "{{ lgsm_server_config }}"
mode: '0644'
owner: "{{ lgsm_user }}"
group: "{{ lgsm_group }}"

- name: Install gameserver systemd unit file
template:
ansible.builtin.template:
src: systemd-unit.j2
dest: "/etc/systemd/system/{{ lgsm_server }}.service"
mode: '0644'
owner: root
group: root

- name: Enable and start gameserver systemd unit
systemd:
ansible.builtin.systemd:
state: started
enabled: true
name: "{{ lgsm_server }}"
Expand Down
8 changes: 4 additions & 4 deletions tasks/install_lgsm.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
- name: Install prerequisites
package:
ansible.builtin.package:
name: "{{ lgsm_required_packages }}"
state: present

- name: Setup admin group
group:
ansible.builtin.group:
name: "{{ lgsm_group }}"
state: present

- name: Setup admin user
user:
ansible.builtin.user:
name: "{{ lgsm_user }}"
group: "{{ lgsm_group }}"
groups: "{{ lgsm_additional_groups }}"
Expand All @@ -20,7 +20,7 @@
state: present

- name: Download lgsm installer
get_url:
ansible.builtin.get_url:
url: "{{ lgsm_installer_url }}"
dest: "{{ lgsm_installdir }}/{{ lgsm_installer_name }}"
owner: "{{ lgsm_user }}"
Expand Down

0 comments on commit 87724b5

Please sign in to comment.