ansible/roles/sourcegame/tasks/main.yml

50 lines
1.4 KiB
YAML
Raw Normal View History

2020-07-05 11:45:27 -05:00
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Set up game
block:
- name: Clone configuration repository
git:
repo: "{{ source_configrepo }}"
dest: $HOME/sourcecfg/{{ source_instancename }}
notify: "restart {{ source_instancename }}"
- name: Symlink configs
file:
src: "$HOME/sourcecfg/{{ source_instancename }}/{{ item }}"
path: "/var/steam/.steam/SteamApps/common/{{ source_path }}/{{ source_game }}/cfg/{{ item }}"
state: link
force: yes
loop:
- autoexec.cfg
- mount.cfg
- server.cfg
notify: "restart {{ source_instancename }}"
become: yes
become_user: steamcmd
- name: Set up system
block:
- name: Template out service
template:
src: sourcegame.service
dest: "/etc/systemd/system/source-{{ source_instancename }}.service"
notify: "restart {{ source_instancename }}"
- name: Reload available daemons
systemd:
daemon_reload: yes
- name: Enable service
systemd:
name: "source-{{ source_instancename }}"
state: started
enabled: yes
- name: Assure CNAME record
route53:
state: present
2020-07-23 21:02:56 -05:00
overwrite: yes
2020-07-05 11:45:27 -05:00
zone: "{{ zone }}"
type: CNAME
record: "{{ source_instancename }}.src.{{ zone }}."
ttl: 300
value:
- "{{ inventory_hostname_short }}.{{ zone }}."
2020-07-05 11:45:27 -05:00
become: yes