Skip to content
Snippets Groups Projects
Commit fb02e3bf authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Add group_vars/all into roles

This is related to NAT-680 'inventory restructure' - some of data is
moved from `group_vars/routers` to `group_vars/all`. Hence, the need to
load `group_vars/all` folder in almost all roles, except
`base_config_checks`.
parent bea2d350
No related branches found
No related tags found
1 merge request!158Add group_vars/all into roles
Pipeline #88122 passed
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers dir: /opt/ansible_inventory/group_vars/routers
- name: Import variables from 'all'
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Generate an ID for this run - name: Generate an ID for this run
ansible.legacy.set_fact: ansible.legacy.set_fact:
opid: "{{ lookup('community.general.random_string', length=18, special=false) }}" opid: "{{ lookup('community.general.random_string', length=18, special=false) }}"
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers dir: /opt/ansible_inventory/group_vars/routers
- name: Import variables from 'all'
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Generate an ID for this run - name: Generate an ID for this run
ansible.legacy.set_fact: ansible.legacy.set_fact:
opid: "{{ lookup('community.general.random_string', length=18, special=false) }}" opid: "{{ lookup('community.general.random_string', length=18, special=false) }}"
......
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers dir: /opt/ansible_inventory/group_vars/routers
- name: Import variables from 'all'
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Set an ID for this run - name: Set an ID for this run
ansible.builtin.set_fact: ansible.builtin.set_fact:
opid: "{{ lookup('community.general.random_string', length=18, special=false) }}" opid: "{{ lookup('community.general.random_string', length=18, special=false) }}"
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
ansible.builtin.meta: end_play ansible.builtin.meta: end_play
when: (check is not defined) or (check not in checks) when: (check is not defined) or (check not in checks)
- name: Import variables from 'all'
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Import routers variables - name: Import routers variables
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers dir: /opt/ansible_inventory/group_vars/routers
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
ansible.builtin.meta: end_play ansible.builtin.meta: end_play
when: ((verb is not defined) or (config_object is not defined)) or (verb not in verbs) or (config_object not in config_objects) when: ((verb is not defined) or (config_object is not defined)) or (verb not in verbs) or (config_object not in config_objects)
- name: Import variables from 'all'
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Import routers variables - name: Import routers variables
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers dir: /opt/ansible_inventory/group_vars/routers
......
--- ---
# tasks file for iptrunk_twamp # tasks file for iptrunk_twamp
- name: Import variables from 'all'
ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/all
- name: Import routers variables - name: Import routers variables
ansible.builtin.include_vars: ansible.builtin.include_vars:
dir: /opt/ansible_inventory/group_vars/routers dir: /opt/ansible_inventory/group_vars/routers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment