Hi All
I searched for a solution but everything I found didn’t helped.
We catch up all pub.key files from servers when we connect and then we would like to deploy them to the correct enviroment.
Here the config:
- name: copy all needed pub.key files from deployuser
copy:
src: “{{ item }}”
dest: /tmp/
with_fileglob: - /opt/ansible/playbooks/roles/tdInfra/files/ssh_public_keys/{{ tdInfraKey|upper }}
We have different enviroments, dev and prod. The Files have the hostname in the name with …PROD… or …DEV…
So I tryed to match them with |upper which works fine to bring those letters up.
When I do a:
- debug: var=tdInfraKey
This is the outpu:
ok: [host.td.infra.sys] => {
“tdInfraKey”: [
“dev”
]
}
With the configuration I have posted on top the matching does not work and it find all files with a D in the first position.
user@DEV001.domain.local
user@DLOG051.domain.local
user@DEV401.domain.local
user@LOOP031.domain.local
I have no clue anymore where the issue could come from. So I would be very thankful if anybody could help me with an idea.
OS: CentOS7
Ansible Version: 2.4.2.0-2.el7
Thank you and kind regards,
Phillip