Greetings.
I feel like I've done this before, but for some reason, I can't figure it
out.
I've got two hashes defined.
password_change:
cobbler: [ ebhpw ]
cougar: [ ehymowitz ]
password_groups:
ebhpw: ehymowitz
Then I've got a play.
- name: eric testing 9
debug:
msg: "it worked!!!! variable is {{password_change.cobbler}}"
when:
- password_change.cobbler is defined
This works:
TASK [eric testing 9]
ok: [gs-444-e10285] => {
"msg": "it worked!!!! variable is [u'ebhpw']"
}
I don't fully understand what the brackets and the u are for. But I think
that's getting in my way. Because now I'm trying to do this:
- name: eric testing 9
debug:
msg: "it worked!!!! variable is {{password_change.cobbler}}"
when:
- password_change.cobbler is defined
- password_groups[password_change.cobbler] is defined
and it fails.
TASK [eric testing 9]
skipping: [gs-444-e10285]
So what am I missing? It knows what password_change.cobbler is ("ebhpw") ,
and it knows what password_groups[ebhpw] is ("ehymowitz"), so why I can't I
properly test for the value of password_groups[password_change.cobbler] ?
Thanks.
--EbH
==========
I don't know if this is related or not, but I'll put it here just in case.
I've got this inside of a play:
lineinfile:
path:
"/var/lib/cobbler/snippets/password_{{password_change[inventory_hostname]}}"
The file /var/lib/cobbler/snippets/password_ehymowitz definitely exists ...
but ansible is complaining that "Destination
/var/lib/cobbler/snippets/password_[u'ehymowitz'] does not exist" .
Again with the brackets and the u . I don't understand what that is, or
why I'm getting it, or how to get rid of it. I don't know if that's
causing the above problem.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/002c7ca6-9dde-4e4c-92ce-0631db8a7c33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.