Undefined variables in filetree_create role #918
Labels
bug
Something isn't working
filetree/filetree_create
new
New issue, this should be removed once reviewed
Summary
When running the
infra.controller_configuration.filetree_create
role, it fails due to a variable being undefined as well as an attribute on a looping variable being missing/undefined.Issue Type
Ansible, Collection, Controller details
OS / ENVIRONMENT
Desired Behavior
When required variables are provided:
The role should capture the controller's AWX configuration and output a filetree of the relevant variable files.
Actual Behavior
The role fails at the following tasks:
infra.controller_configuration.filetree_create : Add current inventory source to the inventory sources flat file
Error:
Searching through the repository, the only place that variable is found is the referenced task. It isn't defined or registered anywhere else.
Passing in that variable as an extra var with an arbitrary value allows the role to continue past the task, but of course this isn't the intended behavior.
infra.controller_configuration.filetree_create : Add current team roles to the team roles flat file
Error:
This attribute is found in the
current_team_roles.j2
template.I suspect the issue be because the
resource_names
andresource_type
attributes (which are referenced in the template) are defined on theobject_roles
object, but thename
attribute is never defined.Due to this being an attribute called dynamically, it's not possible to simply pass in an extra var to bypass this task. The workaround I found was to copy the entirety of the the
filetree_create
andmeta_dependency_check
roles locally so that I can modify this line in the template to add a default value:After defining the default value for
team_name
, the team roles were all created with noname
values:My configuration
Playbook:
Vars file:
STEPS TO REPRODUCE
infra.controller_configuration.filetree_create
role using the above playbook/vars files.The text was updated successfully, but these errors were encountered: