ansible/roles/sourcegame/tasks/main.yml

40 lines
1.1 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
become: yes