On Mon, 02 Feb 2015 11:52 -0800, John Oliver <[email protected]> wrote:
> If I:
> 
> - name: Copy SSL cert
>   copy: src={{ ansible_hostname if ansible_hostname in valid_hosts else 
> ('test') }}.crt
>         dest=/etc/pki/tls/certs/
>         mode=0644
> 
> How can I capture the name of the certificate that was actually copied
> for 
> action in another task?


- name: Copy SSL cert
  copy: src={{ ansible_hostname if ansible_hostname in valid_hosts else
  ('test') }}.crt
        dest=/etc/pki/tls/certs/
        mode=0644
  register: cert_copy

- debug: var=cert_copy

http://docs.ansible.com/playbooks_variables.html#registered-variables

Giovanni

-- 
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/1422963775.3358504.222431837.2610FB18%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to