Bug #25455
closedAnsible variables aren't available in playbook
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.
- foreman 1.20-RC2
- foreman-ansible from branch master (latest commit on this day).
- smart_proxy_ansible from branch master
Is this feature supposed to be functionnal or am I missing something ?
Updated by Fabien Brachere about 6 years ago
Same behavior with official foreman 1.20 and foreman-ansible 2.3.0.
Updated by Marek Hulán about 6 years ago
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.
Updated by Fabien Brachere about 6 years ago
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.
Updated by The Foreman Bot almost 6 years ago
- 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
Updated by Fabien Brachere almost 6 years ago
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 ?
Updated by Marek Hulán almost 6 years ago
- Fixed in Releases foreman-ansible 2.3.1 added
Updated by Anonymous almost 6 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_ansible|e8693c97c58984e5d29e1f6bf2c3fc0f375f0f62.