Thank you Kai!!
I was searching for hours!
Well, stupid problem as a newbie in Ansible but thank you very much.
Am Freitag, 14. Dezember 2018 15:41:40 UTC+1 schrieb Kai Stian Olstad:
>
> On Friday, 14 December 2018 12:23:58 CET Phillip wrote:
> > 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"
> > ]
> > }
>
> Your tdInfraKey is a list with one element, so to get the value you need
> to specify the first element.
>
> {{ tdInfraKey.0|upper }}
>
>
> --
> 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/df64cf9e-13e9-4426-addb-f8354aebd3ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.