# Problem with groups

**URL:** <https://forum.ansible.com/t/problem-with-groups/26456>\
**Category:** Ansible Project\
**Tags:** rhel, ubuntu\
**Created:** [January 10, 2018, 8:35pm UTC](https://forum.ansible.com/t/problem-with-groups/26456 "2018-01-10T20:35:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Barlock](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@Chris\_Barlock](https://forum.ansible.com/u/Chris_Barlock)\
**Post date:** [January 10, 2018, 8:35pm UTC](https://forum.ansible.com/t/problem-with-groups/26456/1 "2018-01-10T20:35:03Z")

</div>

I have the following in one of my playbooks:

- name: “Copy SSH keys”  
command: sshpass -f ~/temp.pass ssh-copy-id -i ~/.ssh/id\_rsa.pub {{ ansible\_user }}@{{ item }}  
with\_flattened:
- groups.worker
- groups.proxy  
when: item not in groups.master

with the inventory file:

[master]  
9.42.23.241 kubelet\_extra\_args=‘[“–eviction-hard=memory.available\<100Mi,nodefs.available\<2Gi,nodefs.inodesFree\<5%”, “–image-gc-high-threshold=100%”, “–image-gc-low-threshold=100%”]’

[worker]  
9.42.23.147

[proxy]  
9.42.23.241 kubelet\_extra\_args=‘[“–eviction-hard=memory.available\<100Mi,nodefs.available\<2Gi,nodefs.inodesFree\<5%”, “–image-gc-high-threshold=100%”, “–image-gc-low-threshold=100%”]’

[management]  
9.42.23.241 kubelet\_extra\_args=‘[“–eviction-hard=memory.available\<100Mi,nodefs.available\<2Gi,nodefs.inodesFree\<5%”, “–image-gc-high-threshold=100%”, “–image-gc-low-threshold=100%”]’

This runs fine on Ubuntu, but when I run on RHEL, I get:

TASK [configure-master : Copy SSH keys] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [9.42.23.241] (item=groups.worker) =\> {“changed”: true, “cmd”: [“sshpass”, “-f”, “~/temp.pass”, “ssh-copy-id”, “-i”, “~/.ssh/id\_rsa.pub”, “root@groups.worker”], “delta”: “0:00:00.096340”, “end”: “2018-01-10 15:28:14.514589”, “failed”: true, “item”: “groups.worker”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-01-10 15:28:14.418249”, “stderr”: “/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_rsa.pub"\n/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n\n/usr/bin/ssh-copy-id: ERROR: ssh: Could not resolve hostname groups.worker: Name or service not known”, “stderr\_lines”: [“/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_rsa.pub"”, “/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed”, “”, “/usr/bin/ssh-copy-id: ERROR: ssh: Could not resolve hostname groups.worker: Name or service not known”], “stdout”: “”, “stdout\_lines”: }  
failed: [9.42.23.241] (item=groups.proxy) =\> {“changed”: true, “cmd”: [“sshpass”, “-f”, “~/temp.pass”, “ssh-copy-id”, “-i”, “~/.ssh/id\_rsa.pub”, “root@groups.proxy”], “delta”: “0:00:00.101189”, “end”: “2018-01-10 15:28:14.900749”, “failed”: true, “item”: “groups.proxy”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2018-01-10 15:28:14.799560”, “stderr”: “/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_rsa.pub"\n/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n\n/usr/bin/ssh-copy-id: ERROR: ssh: Could not resolve hostname groups.proxy: Name or service not known”, “stderr\_lines”: [“/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id\_rsa.pub"”, “/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed”, “”, “/usr/bin/ssh-copy-id: ERROR: ssh: Could not resolve hostname groups.proxy: Name or service not known”], “stdout”: “”, “stdout\_lines”: }  
to retry, use: --limit @/root/ansible/deploy.retry

groups.worker and groups.proxy is just those literal strings, not the IP addresses specified in the inventory file. Thoughts on what is wrong?

Chris
