From 61ed816059b08b0ba5cbb383a94093e43ae62832 Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 5 Jul 2020 09:26:21 -0500 Subject: [PATCH] Update inventory, add a new steamcmd role --- inventory/hosts.yml | 2 ++ playbooks/gameservers.yml | 4 ++++ roles/steamcmd/tasks/main.yml | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 roles/steamcmd/tasks/main.yml diff --git a/inventory/hosts.yml b/inventory/hosts.yml index 62e641e..ac723fa 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -28,3 +28,5 @@ all: ansible_host: game1.9iron.club game2: ansible_host: game2.9iron.club + game3: + ansible_host: game3.9iron.club diff --git a/playbooks/gameservers.yml b/playbooks/gameservers.yml index 4c45d91..ebd3892 100644 --- a/playbooks/gameservers.yml +++ b/playbooks/gameservers.yml @@ -61,3 +61,7 @@ mcviewdist: 14 mcleveltype: "default" tags: [ gameserver, minecraft, magicpack ] +- hosts: game3 + roles: + - role: steamcmd + tags: [ steamcmd ] diff --git a/roles/steamcmd/tasks/main.yml b/roles/steamcmd/tasks/main.yml new file mode 100644 index 0000000..473237a --- /dev/null +++ b/roles/steamcmd/tasks/main.yml @@ -0,0 +1,34 @@ +#!/usr/bin/ansible-playbook +# vim:ft=ansible: +--- +- name: Install steamcmd + block: + - name: Enable i386 architecture + lineinfile: + dest: /var/lib/dpkg/arch + line: i386 + create: yes + register: add_i386 + - name: Update repos + apt: + update_cache: yes + when: add_i386 is changed + - name: Configure debconf + debconf: + name: steamcmd + question: "steam/question" + value: "I AGREE" + vtype: string + - name: Install steamcmd + apt: + name: steamcmd + environment: + ACCEPT_EULA: "Y" + - name: Create steamcmd user + user: + name: steamcmd + password: "!" + home: "/var/steam" + shell: "/bin/bash" + system: yes + become: yes