Project

General

Profile

Actions

Bug #25455

closed

Ansible variables aren't available in playbook

Added by Fabien Brachere over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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 ?

Actions #1

Updated by Fabien Brachere over 5 years ago

Same behavior with official foreman 1.20 and foreman-ansible 2.3.0.

Actions #2

Updated by Marek Hulán over 5 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.

Actions #3

Updated by Fabien Brachere over 5 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.

Actions #4

Updated by The Foreman Bot about 5 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
Actions #5

Updated by Fabien Brachere about 5 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 ?

Actions #6

Updated by Marek Hulán about 5 years ago

  • Fixed in Releases foreman-ansible 2.3.1 added
Actions #7

Updated by Anonymous about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF