Skip to content

Variable inheritance

TF edited this page Feb 16, 2023 · 4 revisions

About

This plugin makes some assumptions and decisions which are explained here. It tries to keep closely what you might expect by Ansible and so should hopefully makes things easy to understand. The main principle is that a local file should have more power then a group variable defined in an Open-AudIT location but the variable defined in a device should be the one with the most power - while all can be overwritten on the CLI.

inheritance (next overwrites the previous):

Parsing flow* Definition Configuration
1 Open-AudIT -> Groups field Description see Group-Variables
2 Open-AudIT -> Locations field suite see Group-Variables
3 Ansible -> compose** inventory file, e.g. in hosts.openaudit.yml syntax explained here
4 Ansible -> groups inventory file, e.g. in hosts.openaudit.yml syntax explained here
5 Ansible -> keyed_groups inventory file, e.g. in hosts.openaudit.yml syntax explained here
6 Open-AudIT -> Fields -> <custom field> custom field must be set in Open-AudIT -> device . See Host-Variables
7 Ansible -> CLI extravars ansible-playbook .... -e <varname>=<value>

*1 gets overwritten by 2 and 3 overwrites 2 and 1 and so on. Ansible playbook extravars on the cli will overwrite everything before and the lowest one would be a groups variable definition.

**note: compose is not capable of matching variables based on conditions. That means every(!) hosts will get the variable as long as it is itself valid. Just keep this in mind.

Clone this wiki locally