From 118f39391e3648d1ec247340836e63296ec6ab9c Mon Sep 17 00:00:00 2001 From: Benjamin Labrecque Date: Mon, 20 Jul 2026 14:07:01 +0200 Subject: [PATCH] chore: ansible extract env vars to inventory --- ansible/inventories/dev/hosts.yml | 29 ++++++++++++++++++----------- ansible/inventories/prod/hosts.yml | 29 ++++++++++++++++++----------- ansible/tasks/ioc/ioc-install.yml | 4 ---- ansible/tasks/ioc/ioc-restart.yml | 2 -- 4 files changed, 36 insertions(+), 28 deletions(-) diff --git a/ansible/inventories/dev/hosts.yml b/ansible/inventories/dev/hosts.yml index c95b9b6..1640ae0 100644 --- a/ansible/inventories/dev/hosts.yml +++ b/ansible/inventories/dev/hosts.yml @@ -1,11 +1,18 @@ -lc: - hosts: - sls-lc: - ansible_remote_tmp: /tmp/.ansible_${ansible_user}_tmp -vserv: - hosts: - sls-vserv-bd-01-dev: - ansible_ssh_pipelining: true -vserv-hla: - hosts: - sls-vserv-bd-hla01-dev: +all: + vars: + agebd_env: "dev" + env_suffix_upper: "-DEV" + env_suffix_lower: "-dev" + + children: + lc: + hosts: + sls-lc: + ansible_remote_tmp: /tmp/.ansible_${ansible_user}_tmp + vserv: + hosts: + sls-vserv-bd-01-dev: + ansible_ssh_pipelining: true + vserv-hla: + hosts: + sls-vserv-bd-hla01-dev: diff --git a/ansible/inventories/prod/hosts.yml b/ansible/inventories/prod/hosts.yml index 3721522..20ea709 100644 --- a/ansible/inventories/prod/hosts.yml +++ b/ansible/inventories/prod/hosts.yml @@ -1,11 +1,18 @@ -lc: - hosts: - sls-lca: - ansible_remote_tmp: /tmp/.ansible_${ansible_user}_tmp -vserv: - hosts: - sls-vserv-bd-01: - ansible_ssh_pipelining: true -vserv-hla: - hosts: - sls-vserv-bd-hla01: +all: + vars: + agebd_env: "prod" + env_suffix_upper: "" + env_suffix_lower: "" + + children: + lc: + hosts: + sls-lca: + ansible_remote_tmp: /tmp/.ansible_${ansible_user}_tmp + vserv: + hosts: + sls-vserv-bd-01: + ansible_ssh_pipelining: true + vserv-hla: + hosts: + sls-vserv-bd-hla01: diff --git a/ansible/tasks/ioc/ioc-install.yml b/ansible/tasks/ioc/ioc-install.yml index 8d56fb1..1681c04 100644 --- a/ansible/tasks/ioc/ioc-install.yml +++ b/ansible/tasks/ioc/ioc-install.yml @@ -38,10 +38,6 @@ - name: "[{{ target_service_name_lower }}] Establish environment naming conventions" ansible.builtin.set_fact: service_name_upper: "{{ target_service_name_lower | upper }}" - # Set suffix to "-DEV" if dev, otherwise empty "" - env_suffix_upper: "{{ '-DEV' if agebd_env == 'dev' else '' }}" - # Set suffix to "-dev" if dev, otherwise empty "" - env_suffix_lower: "{{ '-dev' if agebd_env == 'dev' else '' }}" - name: "[{{ target_service_name_lower }}] Define file paths" ansible.builtin.set_fact: diff --git a/ansible/tasks/ioc/ioc-restart.yml b/ansible/tasks/ioc/ioc-restart.yml index 121853b..615e3fc 100644 --- a/ansible/tasks/ioc/ioc-restart.yml +++ b/ansible/tasks/ioc/ioc-restart.yml @@ -15,8 +15,6 @@ - name: "[{{ target_service_name_lower }}] Establish environment naming conventions" ansible.builtin.set_fact: service_name_upper: "{{ target_service_name_lower | upper }}" - # Set suffix to "-DEV" if dev, otherwise empty "" - env_suffix_upper: "{{ '-DEV' if agebd_env == 'dev' else '' }}" - name: "[{{ target_service_name_lower }}] Define file paths" ansible.builtin.set_fact: