From 9843677655f5c144f2bfc4744bcea0a4129c27a4 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 4 Dec 2022 15:36:03 +0100 Subject: [PATCH] Replace 00-test-hosts play --- ansible.cfg | 3 --- playbooks/00-test-hosts.yml | 9 --------- plays/group-all.yml | 1 + hosts => production | 3 +++ testing | 40 +++++++++++++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 12 deletions(-) delete mode 100644 playbooks/00-test-hosts.yml rename hosts => production (95%) create mode 100644 testing diff --git a/ansible.cfg b/ansible.cfg index ce48feb..3f3deef 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,5 +1,2 @@ -[defaults] -inventory = ./hosts - [privilege_escalation] become = True diff --git a/playbooks/00-test-hosts.yml b/playbooks/00-test-hosts.yml deleted file mode 100644 index 10b1cca..0000000 --- a/playbooks/00-test-hosts.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: Configure hosts - hosts: asgard - - tasks: - - import_tasks: tasks/hosts/sshd.yml - - import_tasks: tasks/hosts/firewall.yml - - import_tasks: tasks/hosts/utils.yml - - import_tasks: tasks/hosts/root-shell.yml diff --git a/plays/group-all.yml b/plays/group-all.yml index cd7f01e..b419fcc 100644 --- a/plays/group-all.yml +++ b/plays/group-all.yml @@ -4,6 +4,7 @@ roles: - role: "system_mail" tags: "role:system_mail" + when: the_nine_worlds_production | bool - role: "system_base" tags: "role:system_base" vars: diff --git a/hosts b/production similarity index 95% rename from hosts rename to production index 4bab071..cda9e50 100644 --- a/hosts +++ b/production @@ -1,3 +1,6 @@ +[all:vars] +the_nine_worlds_production=true + # -------------------------------------------------------------------------------------------------- # Functionality. # -------------------------------------------------------------------------------------------------- diff --git a/testing b/testing new file mode 100644 index 0000000..bdd375e --- /dev/null +++ b/testing @@ -0,0 +1,40 @@ +heimdall ansible_host=heimdall-virt +valkyrie ansible_host=valkyrie-virt +yggdrasil ansible_host=yggdrasil-virt + +[all:vars] +the_nine_worlds_production=false + +# -------------------------------------------------------------------------------------------------- +# Functionality. +# -------------------------------------------------------------------------------------------------- + +# VPN entry-points. +[bifrost] +heimdall + +# Service running hosts. +[asgard] +valkyrie +yggdrasil + +# -------------------------------------------------------------------------------------------------- +# Network. +# -------------------------------------------------------------------------------------------------- + +# Hosts physically located within the home LAN. +[home] +heimdall +yggdrasil + +# Hosts remote to the home LAN. +[remote] +valkyrie + +# -------------------------------------------------------------------------------------------------- +# Special. +# -------------------------------------------------------------------------------------------------- + +# Hosts running with ZFS. +[zfs] +yggdrasil