Bug #25455
closed
Ansible variables aren't available in playbook
Added by Fabien Brachere about 6 years ago.
Updated almost 6 years ago.
Description
Hi,
I tried to use ansible variables as described in the manual with no success.
I've imported variables from my role and defined the default value with the method 1 (imported variable) . The variable is not created in the inventory (in /tmp/foreman-inventories/xxxx ).
This is ok when I define a variable in "host parameters" but I want to use array, not string so this method isn't helpful for me.
Tested versions are:
Is this feature supposed to be functionnal or am I missing something ?
Same behavior with official foreman 1.20 and foreman-ansible 2.3.0.
Just sanity check, you set the variable to override and assigned the given role to the host right? I think what is missing here is the association of the override. If you go to ansible variable form, there's matchers section. Also other matchers can be defined, e.g. on hostgroup/subnet/domain/organization/location level. As of now, you need to fill in fqdn=host's fqdn in order to set the value there. The better UI experience is WIP.
Marek Hulán wrote:
Just sanity check, you set the variable to override and assigned the given role to the host right?
Yes, exactly.
I think what is missing here is the association of the override. If you go to ansible variable form, there's matchers section. Also other matchers can be defined, e.g. on hostgroup/subnet/domain/organization/location level. As of now, you need to fill in fqdn=host's fqdn in order to set the value there. The better UI experience is WIP.
I added the fqdn's matcher for my host. Same result, there is no variable created in the inventory.
- Status changed from New to Ready For Testing
- Assignee set to Ondřej Pražák
- Pull request https://github.com/theforeman/foreman_ansible/pull/237 added
Ok, fixed for me. Thank you very much.
The need to specify a matcher on fqdn is annoying. Should I open another issue or we keep this one open ?
- Fixed in Releases foreman-ansible 2.3.1 added
- Status changed from Ready For Testing to Closed
Also available in: Atom
PDF