On 02.08.2018 08:13, [email protected] wrote:
best would be a list like this:
"itsv_hostgroup": {WBG,LNZ,...}
Typo I guess list is is ["WBG","LNZ",...]
- set_fact:
itsv_hostgroup: "LNZ"
cacheable: true
when: (itsv_machine_serial.stdout is match "IBM,02781A6BX") or
(itsv_machine_serial.stdout is match "IBM,02781A6CX") or
(itsv_machine_serial.stdout is match "IBM,02781A6DX")
To add just do this to all of them
itsv_hostgroup: '{{ itsv_hostgroup | default([]) + ["LNZ"] }}'
The default([]) is there so it doesn't fail when itsv_hostgroup is not
defined, it will then be set to a empty list [].
And the rest just add a element to the list.
--
Kai Stian Olstad
--
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/661ef7e257592c0b03699bf7a7ce2e50%40olstad.com.
For more options, visit https://groups.google.com/d/optout.