refactor: restructure inventory, split roles and add new services
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
- name: install package
|
||||
ansible.builtin.apt:
|
||||
name: steamcmd
|
||||
update_cache: true
|
||||
@@ -0,0 +1,23 @@
|
||||
- name: check steam session
|
||||
ansible.builtin.stat:
|
||||
path: /var/lib/steamcmd/.local/share/Steam/config/config.vdf
|
||||
register: steam_session
|
||||
|
||||
- name: abort if steam authorization is missing
|
||||
ansible.builtin.fail:
|
||||
msg: "Manual Steam authorization required. Please log in interactively."
|
||||
when: not steam_session.stat.exists
|
||||
|
||||
- name: install valheim server
|
||||
ansible.builtin.command:
|
||||
cmd: su - steamcmd -c "/usr/games/steamcmd +force_install_dir /mnt/steamcmd/valheim +login anonymous +app_update 896660 validate +exit"
|
||||
register: valheim_result
|
||||
changed_when: "'downloading' in valheim_result.stdout"
|
||||
notify: restart valheim
|
||||
|
||||
- name: install dayz server
|
||||
ansible.builtin.command:
|
||||
cmd: su - steamcmd -c "/usr/games/steamcmd +force_install_dir /mnt/steamcmd/dayz +login gshinzu +app_update 223350 validate +exit"
|
||||
register: dayz_result
|
||||
changed_when: "'downloading' in dayz_result.stdout"
|
||||
notify: restart dayz
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
- name: deploy start_server.sh
|
||||
ansible.builtin.copy:
|
||||
src: start_server.sh
|
||||
dest: /mnt/steamcmd/valheim/start_server-custom.sh
|
||||
owner: steamcmd
|
||||
group: steamcmd
|
||||
mode: '0775'
|
||||
|
||||
- name: deploy valheim.service
|
||||
ansible.builtin.copy:
|
||||
src: valheim.service
|
||||
dest: /etc/systemd/system/valheim.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: restart valheim
|
||||
|
||||
- name: deploy serverDZ.cfg
|
||||
ansible.builtin.copy:
|
||||
src: serverDZ.cfg
|
||||
dest: /mnt/steamcmd/dayz/serverDZ-custom.cfg
|
||||
owner: steamcmd
|
||||
group: steamcmd
|
||||
mode: '0755'
|
||||
|
||||
- name: deploy dayz.service
|
||||
ansible.builtin.copy:
|
||||
src: dayz.service
|
||||
dest: /etc/systemd/system/dayz.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: restart dayz
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: configure debian-unstable.sources
|
||||
ansible.builtin.deb822_repository:
|
||||
name: debian-unstable
|
||||
types: deb
|
||||
uris: http://deb.debian.org/debian
|
||||
suites:
|
||||
- unstable
|
||||
components:
|
||||
- contrib
|
||||
- main
|
||||
- non-free
|
||||
signed_by: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
state: present
|
||||
@@ -0,0 +1,6 @@
|
||||
- name: accept agreement
|
||||
ansible.builtin.debconf:
|
||||
name: steamcmd
|
||||
question: steam/question
|
||||
vtype: string
|
||||
value: "I AGREE"
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: create valheim dir
|
||||
ansible.builtin.file:
|
||||
path: /mnt/steamcmd/valheim
|
||||
owner: steamcmd
|
||||
group: steamcmd
|
||||
state: "directory"
|
||||
|
||||
- name: create dayz dir
|
||||
ansible.builtin.file:
|
||||
path: /mnt/steamcmd/dayz
|
||||
owner: steamcmd
|
||||
group: steamcmd
|
||||
state: "directory"
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: check if i386 architecture
|
||||
ansible.builtin.command: dpkg --print-foreign-architectures
|
||||
register: check_i386
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: add i386 architecture
|
||||
ansible.builtin.command: dpkg --add-architecture i386
|
||||
when: "'i386' not in check_i386.stdout"
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: include deb822
|
||||
ansible.builtin.include_tasks: deb822.yml
|
||||
|
||||
- name: include i386
|
||||
ansible.builtin.include_tasks: i386.yml
|
||||
|
||||
- name: include file
|
||||
ansible.builtin.include_tasks: file.yml
|
||||
|
||||
- name: include debconf
|
||||
ansible.builtin.include_tasks: debconf.yml
|
||||
|
||||
- name: include apt
|
||||
ansible.builtin.include_tasks: apt.yml
|
||||
|
||||
- name: include command
|
||||
ansible.builtin.include_tasks: command.yml
|
||||
|
||||
- name: include copy
|
||||
ansible.builtin.include_tasks: copy.yml
|
||||
Reference in New Issue
Block a user