Name : ansible
Version : 1.9.2
I’ve got a simple play
`
Name : ansible
Version : 1.9.2
I’ve got a simple play
`
Okay
I found this
https://github.com/ansible/ansible/issues/9552
and the solution is to specify full package name in with_items
what the hell… it’s not a solution at all
I wanted to use some var as a package name prefix because
on Fedora and Red Hat systems
on on Debian and Ubuntu systems.
f
I’d like to write a multi-platform code.
Right, i’d suggest you have 2 dicts or lists - one for Debians and one for EL linuxes - and conditionally load them into the yum: task based on ansible_os_family.
You don’t get it.
Plugins are optional.
They may or may not be wanted by user.
So I pushed to my repo the code that breaks just to illustrate want I’d like to achieve with ansible
https://github.com/kostyrevaa/ansible-role-foreman
We’ve got vars
for Ubuntu https://github.com/kostyrevaa/ansible-role-foreman/blob/wip_plugins/vars/Ubuntu.yml
and for RHEL
https://github.com/kostyrevaa/ansible-role-foreman/blob/wip_plugins/vars/RedHat_7.yml
those vars are pulled with
https://github.com/kostyrevaa/ansible-role-foreman/blob/wip_plugins/tasks/main.yml#L4
and code that installs those plugins:
https://github.com/kostyrevaa/ansible-role-foreman/blob/wip_plugins/tasks/plugins.yml#L21
Of course it’s not gonna work for ubuntu 'cause I don’t render repo files for it
but
it also fails for rhel with aforementioned error.
Is there any workaround I could use to get what I want?
Thanks!
I don’t know which plugins someone would like to install so I can’t have hard-coded list.
and I’d like to add that end-user should not be bothered with differences in packages’ names in OSes
Setting
foreman_plugins:
is all what have to be done.
Strangely enough but after rewriting
`
`
into
it works! so my problem solved