-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String variables under compose in the inventory file are not applied to hosts #570
Comments
Looks like this might need to be addressed in the ansible core repo: |
@rwhagw Thank you for raising this. The values in compose are Jinja expressions and the double quotes that you included are YAML syntax will go away when the file is parsed. Including quotes in the dict values, so that they are valid Jinja expressions, should solve your issue. If I use
|
Hello, I have a command that seems like Could you give me a clue about that? Thanks 😄 |
I missed the notification for this; thank you @alinabuzachis, that works! @adrian-arapiles maybe like this:
|
Documentation for the use of strings with compose is documented in https://docs.ansible.com/ansible/latest/plugins/inventory.html#using-inventory-plugins . This documentation and example should be provided in the invetory module as well. Related to ansible-collections#570
Add documentation for the use of strings with compose SUMMARY Documentation for the use of strings with compose is documented in https://docs.ansible.com/ansible/latest/plugins/inventory.html#using-inventory-plugins. However, in the module, it is not well documented. This documentation and example provides documentation in the module docs. Related to #570 ISSUE TYPE Docs Pull Request COMPONENT NAME aws_ec2 inventory Reviewed-by: Gonéri Le Bouder <[email protected]> Reviewed-by: Mark Chappell <None>
Add documentation for the use of strings with compose SUMMARY Documentation for the use of strings with compose is documented in https://docs.ansible.com/ansible/latest/plugins/inventory.html#using-inventory-plugins. However, in the module, it is not well documented. This documentation and example provides documentation in the module docs. Related to #570 ISSUE TYPE Docs Pull Request COMPONENT NAME aws_ec2 inventory Reviewed-by: Gonéri Le Bouder <[email protected]> Reviewed-by: Mark Chappell <None> (cherry picked from commit e823f89)
[PR #1283/e823f890 backport][stable-5] Add documentation for the use of strings with compose This is a backport of PR #1283 as merged into main (e823f89). SUMMARY Documentation for the use of strings with compose is documented in https://docs.ansible.com/ansible/latest/plugins/inventory.html#using-inventory-plugins. However, in the module, it is not well documented. This documentation and example provides documentation in the module docs. Related to #570 ISSUE TYPE Docs Pull Request COMPONENT NAME aws_ec2 inventory Reviewed-by: Mark Chappell <None>
…kdef_conv ecs_taskdefinition: ensure cast to integer and idempotency fix SUMMARY ecs_taskdefinition: Ensure cast to integer and fix taskdefinition creation idempotency. Fixes: ansible-collections#570 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ecs_taskdefinition Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Mark Chappell <None> Reviewed-by: Jill R <None> Reviewed-by: None <None>
…kdef_conv ecs_taskdefinition: ensure cast to integer and idempotency fix SUMMARY ecs_taskdefinition: Ensure cast to integer and fix taskdefinition creation idempotency. Fixes: ansible-collections#570 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ecs_taskdefinition Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Mark Chappell <None> Reviewed-by: Jill R <None> Reviewed-by: None <None>
It appears that this issue has been resolved in the latest release. If you believe otherwise, please feel free to reopen the issue. |
Summary
When adding variables under compose in an inventory file, any dictionaries, lists, and tuples are applied to the hosts, but string variables are ignored.
Issue Type
Bug Report
Component Name
amazon.aws.aws_ec2 - EC2 inventory source
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Host OS: Arch Linux
Target OS: CentOS 7.6
Steps to Reproduce
After running
ansible-inventory --host HOSTNAME
with the above inventory file, "location_vars.location" is set but "location" is not.Expected Results
I expected "location" to be set as the string value defined in the inventory file.
Actual Results
location is not in the dictionary of variables.
Code of Conduct
The text was updated successfully, but these errors were encountered: