Host not using imported Ansible variables

Host not using the ansible variable I modified. Not errors giving just using default variables from ansible role.

Running Foreman 1.21 RC5
tfm-rubygem-foreman-tasks-core-0.2.5-2.fm1_20.el7.noarch
foreman-compute-1.21.0-0.8.RC5.el7.noarch
foreman-selinux-1.21.0-0.3.RC5.el7.noarch
foreman-installer-1.21.0-0.4.RC5.el7.noarch
tfm-rubygem-foreman-tasks-0.14.5-1.fm1_21.el7.noarch
foreman-ovirt-1.21.0-0.8.RC5.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.1.5-1.el7.noarch
foreman-release-scl-7-2.el7.noarch
foreman-postgresql-1.21.0-0.8.RC5.el7.noarch
tfm-rubygem-foreman_bootdisk-14.0.0-1.fm1_21.el7.noarch
foreman-cli-1.21.0-0.8.RC5.el7.noarch
tfm-rubygem-foreman_ansible_core-2.2.0-1.fm1_21.el7.noarch
foreman-proxy-1.21.0-0.5.RC5.el7.noarch
foreman-1.21.0-0.8.RC5.el7.noarch
foreman-vmware-1.21.0-0.8.RC5.el7.noarch
foreman-debug-1.21.0-0.8.RC5.el7.noarch
foreman-release-1.21.0-0.4.RC5.el7.noarch
tfm-rubygem-foreman_ansible-2.3.1-1.fm1_21.el7.noarch
tfm-rubygem-foreman_discovery-14.0.1-1.fm1_21.el7.noarch
tfm-rubygem-foreman_remote_execution-1.7.0-1.fm1_21.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.16.0-1.el7.noarch

I imported ansible NTP role and variables from geerlingguy.ntp downloaded from Ansible Galaxy.

I tried different variable types including text. None seem to have any affect.

The Host’s YAML page does show the variable listed in this case ntp_servers: 1.centos.pool.ntp.org so not sure if this is a bug or if I’m doing something wrong.

Has anyone tried to use the ansible variables with 1.21 rc5?

Thank you.

Looking into this issue I’m having further. It appears that the Hosts YAML file only get updated with the ansible variables when using matchers for the variables, I verified with hostgroup and fqdn. From what I read in the Ansible plugin document is that matchers only work with type text. Is this a known bug?

Hi,
thank you for testing. You need to use the matchers for now, the default values not being used is a known bug and should be fixed by

https://github.com/theforeman/foreman_ansible/pull/241

You are right, there is a mention in plugin docs about matchers supporting only String type for Ansible, but matchers in core support other data types as well. I think structured types for Ansible were not yet implemented/tested. Feel free to file a feature request if that is something you would like to see in the near future.

Thank you for the information. I do think that the matcher variable type should be able to be changed from type text or at least be the type assigned to the role variable otherwise the output will be unpredictable and some cases jinga templates may need to be modified to use text inputs which in that why bother allowing to change variable types at all. I will file a feature request as suggested. You guys are great. Keep up the good work.