Re: [ansible-project] How to get a hold of the hostname from inventory file?

10 views
Skip to first unread message

Serge van Ginderachter

unread,
Oct 8, 2014, 10:00:06 AM10/8/14
to ansible...@googlegroups.com
that would be the special var inventory_hostname

On 8 October 2014 15:47, Samnang Sen <samna...@gmail.com> wrote:
I need to fetch a file from all servers in my inventory file.

# ansible_hosts.txt

server1
server2
server3

# Command I run. I want to substitute <SERVER NAME> with the hostname within ansible_hosts.txt
ansible all -m fetch -a "src=/tmp/<SERVER NAME>.txt dest=special"

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a5611f7d-a2a6-4906-8c5e-553b9b6959ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages