User (GitHub handle unknown) Wrote by email:
One final question.
In the jerakia.yaml file used for Ansible under the scope section is there a mechanism to attempt relating multiple variables.
What we ended up having in our configuration file was:
scope:
hostname: ansible_nodename
environment: ansible_local.custom.environment
location: ansible_local.custom.location
osfamily: ansible_os_family
What we found was that this ended up generating errors on systems that were missing local facts files that defined environment and location. Knowing this now we have adjusted the behavior of our playbooks but we were wondering if there was a supported mechanism to specifiy default values or other variables to use if one is not defined, i.e. something like the following:
scope:
hostname: ansible_nodename
environment: ansible_local.custom.environment|default('development')
location: ansible_local.custom.location|default('deploying')
osfamily: ansible_os_family
Or
scope:
hostname: ansible_nodename
environment: ansible_local.custom.environment, playbook_var_environment
location: ansible_local.custom.location, playbook_var_location
osfamily: ansible_os_family
One final question.
In the jerakia.yaml file used for Ansible under the scope section is there a mechanism to attempt relating multiple variables.
What we ended up having in our configuration file was:
What we found was that this ended up generating errors on systems that were missing local facts files that defined environment and location. Knowing this now we have adjusted the behavior of our playbooks but we were wondering if there was a supported mechanism to specifiy default values or other variables to use if one is not defined, i.e. something like the following:
Or