From b04afd85fbe998d9390c4cd30e0ec3e52875d02a Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Mon, 13 Apr 2020 14:04:38 +0200 Subject: [PATCH] Spit out environment for now --- plays/lib/config.yml | 7 ------- plays/lib/database.yml | 1 - plays/lib/debug.yml | 10 +++++----- plays/lib/vars.yml | 18 ++++++++++-------- plays/lib/vault.yml | 13 ------------- plays/post_delete.yml | 5 ++--- plays/post_deploy.yml | 31 ++++++++++--------------------- plays/pre_deploy.yml | 21 ++++++--------------- 8 files changed, 33 insertions(+), 73 deletions(-) delete mode 100644 plays/lib/config.yml delete mode 100644 plays/lib/vault.yml diff --git a/plays/lib/config.yml b/plays/lib/config.yml deleted file mode 100644 index 6e38856..0000000 --- a/plays/lib/config.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Load app config into playbook context - include_vars: - dir: "{{ app_config_root }}" - extensions: - - yml - - yaml diff --git a/plays/lib/database.yml b/plays/lib/database.yml index bd7948d..a47aa1d 100644 --- a/plays/lib/database.yml +++ b/plays/lib/database.yml @@ -1,5 +1,4 @@ --- - - name: Setup preparatory facts set_fact: db_type: "{{ db['type'] }}" diff --git a/plays/lib/debug.yml b/plays/lib/debug.yml index e926834..5a9a28e 100644 --- a/plays/lib/debug.yml +++ b/plays/lib/debug.yml @@ -4,21 +4,21 @@ msg: | Module Variables ("vars"): -------------------------------- - {{ vars | to_nice_json }} + {{ vars }} Environment Variables ("environment"): -------------------------------- - {{ environment | to_nice_json }} + {{ environment }} GROUP NAMES Variables ("group_names"): -------------------------------- - {{ group_names | to_nice_json }} + {{ group_names }} GROUPS Variables ("groups"): -------------------------------- - {{ groups | to_nice_json }} + {{ groups }} HOST Variables ("hostvars"): -------------------------------- - {{ hostvars | to_nice_json }} + {{ hostvars }} when: debug diff --git a/plays/lib/vars.yml b/plays/lib/vars.yml index baa0a05..3327a0f 100644 --- a/plays/lib/vars.yml +++ b/plays/lib/vars.yml @@ -1,9 +1,11 @@ --- -- name: Check if internal variables are available for loading - stat: - path: "{{ app_config_root }}/vars.yml" - register: internal_vars - -- name: Load internal variables - include_vars: "{{ app_config_root }}/vars.yml" - when: internal_vars.stat.exists +- name: Load all deployment variables + include_vars: + dir: "{{ item }}" + extensions: + - yml + - yaml + with_items: + - "{{ plugin_config_root }}" + - "{{ app_config_root }}" + - "{{ app_config_root }}/vault" diff --git a/plays/lib/vault.yml b/plays/lib/vault.yml deleted file mode 100644 index 6bb2180..0000000 --- a/plays/lib/vault.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Check if vault variables are available for loading - stat: - path: "{{ app_config_root }}/vault/" - register: vault_dir - -- name: Load vault variables into playbook context - include_vars: - dir: "{{ app_config_root }}/vault/" - extensions: - - yml - - yaml - when: vault_dir.stat.exists diff --git a/plays/post_delete.yml b/plays/post_delete.yml index 625e1c8..ebd9042 100644 --- a/plays/post_delete.yml +++ b/plays/post_delete.yml @@ -2,6 +2,5 @@ - hosts: all gather_facts: false tasks: - - name: TODO - debug: - msg: "TODO: implement post-delete" + - name: Include debug tasks + include: ./lib/debug.yml diff --git a/plays/post_deploy.yml b/plays/post_deploy.yml index 95298da..a96ab66 100644 --- a/plays/post_deploy.yml +++ b/plays/post_deploy.yml @@ -2,26 +2,15 @@ - hosts: all gather_facts: false tasks: - - name: Include config tasks - include: ./lib/config.yml - - name: Include debug tasks include: ./lib/debug.yml - - - name: Include vars tasks - include: ./lib/vars.yml - - - name: Include vault tasks - include: ./lib/vault.yml - - - name: Include http tasks - include: ./lib/http.yml - - - name: Include certs tasks - include: ./lib/certs.yml - - - name: Include proxy tasks - include: ./lib/proxy.yml - - - name: Include https tasks - include: ./lib/https.yml + # - name: Include vars tasks + # include: ./lib/vars.yml + # - name: Include http tasks + # include: ./lib/http.yml + # - name: Include certs tasks + # include: ./lib/certs.yml + # - name: Include proxy tasks + # include: ./lib/proxy.yml + # - name: Include https tasks + # include: ./lib/https.yml diff --git a/plays/pre_deploy.yml b/plays/pre_deploy.yml index 82abce3..2b33c5b 100644 --- a/plays/pre_deploy.yml +++ b/plays/pre_deploy.yml @@ -2,20 +2,11 @@ - hosts: all gather_facts: false tasks: - - name: Include config tasks - include: ./lib/config.yml - - name: Include debug tasks include: ./lib/debug.yml - - - name: Include vars tasks - include: ./lib/vars.yml - - - name: Include vault tasks - include: ./lib/vault.yml - - - name: Include domain tasks - include: ./lib/domain.yml - - - name: Include env tasks - include: ./lib/env.yml + # - name: Include vars tasks + # include: ./lib/vars.yml + # - name: Include domain tasks + # include: ./lib/domain.yml + # - name: Include env tasks + # include: ./lib/env.yml