initial commit
This commit is contained in:
commit
13eace9ce9
219 files changed
+6918
No files matched your search
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
export templdpath=$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
|
||||
export SteamAppId=892970
|
||||
echo "Starting server PRESS CTRL-C to exit"
|
||||
./valheim_server.x86_64 -name "oyacoi" -port 2456 -world "world0" -password "ff32167" -public 0
|
||||
export LD_LIBRARY_PATH=$templdpath
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=valheim server
|
||||
Wants=network.target
|
||||
After=syslog.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
User=steamcmd
|
||||
WorkingDirectory=/mnt/valheim/data
|
||||
ExecStart=/bin/bash /mnt/valheim/data/start_server-custom.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: restart valheim
|
||||
ansible.builtin.systemd:
|
||||
name: valheim.service
|
||||
state: restarted
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
@@ -0,0 +1,94 @@
|
||||
---
|
||||
- name: create steamcmd group
|
||||
ansible.builtin.group:
|
||||
name: steamcmd
|
||||
system: true
|
||||
state: present
|
||||
|
||||
- name: create steamcmd user
|
||||
ansible.builtin.user:
|
||||
name: steamcmd
|
||||
group: steamcmd
|
||||
system: true
|
||||
shell: /bin/bash
|
||||
home: /var/lib/steamcmd
|
||||
create_home: true
|
||||
state: present
|
||||
|
||||
- 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
|
||||
|
||||
- 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"
|
||||
|
||||
- name: accept agreement
|
||||
ansible.builtin.debconf:
|
||||
name: steamcmd
|
||||
question: steam/question
|
||||
vtype: string
|
||||
value: "I AGREE"
|
||||
|
||||
- name: install steamcmd
|
||||
ansible.builtin.apt:
|
||||
name: steamcmd
|
||||
update_cache: true
|
||||
|
||||
- name: ensure valheim data directory exists
|
||||
ansible.builtin.file:
|
||||
path: /mnt/valheim/data
|
||||
owner: steamcmd
|
||||
group: steamcmd
|
||||
state: "directory"
|
||||
|
||||
- name: check steam session
|
||||
ansible.builtin.stat:
|
||||
path: /var/lib/steamcmd/.local/share/Steam/config/config.vdf
|
||||
register: steam_session
|
||||
|
||||
- name: ensure steam authorization exists
|
||||
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/valheim/data +login anonymous +app_update 896660 validate +exit"
|
||||
register: valheim_result
|
||||
changed_when: "'downloading' in valheim_result.stdout"
|
||||
notify: restart valheim
|
||||
|
||||
- name: deploy start_server.sh
|
||||
ansible.builtin.copy:
|
||||
src: start_server.sh
|
||||
dest: /mnt/valheim/data/start_server-custom.sh
|
||||
owner: steamcmd
|
||||
group: steamcmd
|
||||
mode: '0775'
|
||||
notify: restart valheim
|
||||
|
||||
- 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
|
||||
Reference in new issue
Block a user