Maybe I’m missing what you exactly set in Foreman. Are you trying to define host parameter with name “chrony_commands.xxxxx”?
What is your Foreman version? Note that host parameters in Foreman 1.21 and below are only strings. In 1.22 (next Foreman version), parameters can have complex types. Also in newer version of foreman_ansible plugin, which is already available with 1.2.1, we added so called ansible variables, that allow defining arrays and dictionaries natively in Foreman.
Ty for your reply.
My Foreman version is “1.20.1”.
Yes, I’m trying to call arrays and dictionaries in Foreman (From Host/Group parametres), but it doesn’t work.
Hi.
I know this is a very old thread, but was wondering if this was every put in place?? its actually something im looking for myself and have tried different variations to get this to work with no luck.
my ansible vars are the below and i have tried to use ssh_config.PermitRootLogin and also ssh_config.[PermitRootLogin] with the string prohibit-password, but its not getting applied.
Hey.
Thanks for the info, its not just SSH i have a few other roles that are the same that use the dictionary key:value approach. Just example used was for configuring the sshd_config file to be able to manage that setup.
I also have sysctl parameters and others, so its not isolated to just ssh-key management its more overall functionality. If the dictionary key:value is not possible thats ok i can re-write the ansible roles, just was hoping it was possible as it would make things easier…
Hey.
Sorry i have managed to figure it out, looks like theforeman can only manage default variables any OS Specific variables in the vars directory are static and cannot be adjusted through the parameters…
After i moved all my vars from the OS specific vars to the defaults it allowed me to override them through theforeman host parms using ssh_config.Key → string → value
Yes, Foreman can only detect variables listed in defaults.yml. I think you can still define an ansible variable manually for a particular role, if it.can not be automatically detected and imported.