Are you doing this in a shell loop? Look at the -e option. 

Mike

> On Aug 25, 2022, at 13:04, Frederick <[email protected]> wrote:
> 
> Good Day!
> 
> I am very new to Ansible so I apologize. I am trying to make a playbook where 
> I push a file to the client host with the hostname/fqdn inside the file. For 
> example:
> 
> My file: cluster/files/etciscsi-initiatorname.iscsi
> 
> InitiatorName=iqn.1994-05.com.redhat:{|rhn.system.hostname|}
> 
> 
> Where {|rhn.system.hostname|} is replaced with the fqdn that the file is 
> being pushed to. I figured out how to get the ansible_fqdn from the 
> ansible_facts but i'm struggling beyond that.
> 
> 
> [root@walter tasks]# cat initiatorname.iscsi.yml 
> 
> ---
> - name: Copy configuration file
>   copy: src=files/etciscsi-initiatorname.iscsi 
> dest=/etc/iscsi/initiatorname.iscsi
> 
> 
> Thank you
> 
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/c69e5b9a-144c-4234-a00d-23b3eaa13fben%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/89F4C894-3DC9-4180-B015-FA333652D43A%40gmail.com.

Reply via email to