Trying to add a ssh key when a inventory_hostname belong to certain groups. I would assume that the following is saying when inventory_hostname belongs to group hadoop OR report.
when: inventory_hostname in [ groups.hadoop , groups.report ]
ISSUE: The following task is skipping, even though the host belongs to group report.
- name: add root authorized keys for test key
authorized_key: user=root key=“{{ item }}”
when: inventory_hostname in [ groups.hadoop , groups.report ]
with_items: - “ssh-rsa ZzzzzzHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5xHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5xHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5xHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5x testkey”
TASK: [provision_server | add root authorized keys for test key] ************
skipping: [server1] => (item=ssh-rsa ZzzzzzHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5xHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5xHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5xHV+drdA0PWHRaDw1fqtM/PElGVbysuNCxFJ9JUBebnsbvAqNFQyMDEweMe5x testkey)
Is there something wrong with with my syntax for an OR condition for host groups?
Thanks!