From d358e3b64f5f9e1224d558c2fd67d36686539ad8 Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 1 Aug 2020 16:29:01 -0500 Subject: [PATCH] Move Minecraft DNS out of role --- playbooks/gameservers.yml | 19 +++++++++++++++++++ roles/minecraft/tasks/main.yml | 20 -------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/playbooks/gameservers.yml b/playbooks/gameservers.yml index 286a26c..5ea175d 100644 --- a/playbooks/gameservers.yml +++ b/playbooks/gameservers.yml @@ -30,6 +30,25 @@ source_args: "+gamemode terrortown +map ttt_lttp_kakariko_a4 +host_workshop_collection 2155532035" source_configrepo: "https://git.9iron.club/salt/gmodconfig" tags: [ steam, gmod ] + tasks: + - name: Assure Minecraft CNAME record + route53: + state: present + overwrite: yes + zone: 9iron.club + type: CNAME + record: "{{ mcname }}.mc.9iron.club." + ttl: 300 + value: [ "{{ inventory_hostname }}." ] + - name: Assure Minecraft SRV record + route53: + state: present + overwrite: yes + zoen: 9iron.club + type: SRV + record: "_minecraft._tcp.{{ mcname }}.mc.{{ zone }}." + ttl: 300 + value: [ "1 10 {{ mcport }} {{ inventory_hostname }}." #- hosts: game2 # roles: # - role: backups diff --git a/roles/minecraft/tasks/main.yml b/roles/minecraft/tasks/main.yml index 062e7f9..ba5ebe0 100644 --- a/roles/minecraft/tasks/main.yml +++ b/roles/minecraft/tasks/main.yml @@ -178,24 +178,4 @@ src: "backup.sh" dest: "/opt/backups/modules/minecraft-{{ mcname }}.sh" mode: "0600" - - name: Assure CNAME record - route53: - state: present - overwrite: yes - zone: "{{ zone }}" - type: CNAME - record: "{{ mcname }}.mc.{{ zone }}." - ttl: 300 - value: - - "{{ inventory_hostname_short }}.{{ zone }}." - - name: Assure SRV record - route53: - state: present - overwrite: yes - zone: "{{ zone }}" - type: SRV - record: "_minecraft._tcp.{{ mcname }}.mc.{{ zone }}." - ttl: 300 - value: - - "1 10 {{ mcport }} {{ inventory_hostname_short }}.{{ zone }}." become: yes