From 2626e7d15ac99c70b0ade59abde56bf86782a98f Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Mon, 6 Mar 2023 15:03:09 +0100 Subject: [PATCH] build(makefile): improve stacked execution with custom environments, for better summary --- Makefile | 9 +++++---- init.yml | 13 +++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 045f533..e0c61bf 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ -install: setup wg k3s +install: + ansible-playbook -i "inventory/hosts.yml" "init.yml" --extra-vars "enable_setup=true enable_wireguard=true enable_k3s=true" setup: - ansible-playbook -i "inventory/hosts.yml" "init.yml" + ansible-playbook -i "inventory/hosts.yml" "init.yml" --extra-vars "enable_setup=true enable_wireguard=false enable_k3s=false" wg: - ansible-playbook -i "inventory/hosts.yml" "wireguard/wireguard.yml" + ansible-playbook -i "inventory/hosts.yml" "init.yml" --extra-vars "enable_setup=false enable_wireguard=true enable_k3s=false" k3s: - ansible-playbook -i "inventory/hosts.yml" "k3s-ansible/site.yml" + ansible-playbook -i "inventory/hosts.yml" "init.yml" --extra-vars "enable_setup=false enable_wireguard=false enable_k3s=true" uninstall: ansible-playbook -i "inventory/hosts.yml" "k3s-ansible/reset.yml" diff --git a/init.yml b/init.yml index 95194b5..d5c38bf 100644 --- a/init.yml +++ b/init.yml @@ -1,4 +1,13 @@ --- - hosts: all - roles: - - node-configuration + tasks: + - name: Start basic node configuration + include_role: + name: node-configuration + when: enable_setup|bool == true +- name: Configure wireguard + ansible.builtin.import_playbook: wireguard/wireguard.yml + when: enable_wireguard|bool == true +- name: Configure k3s + ansible.builtin.import_playbook: wireguard/wireguard.yml + when: enable_k3s|bool == true