trying to replace a word in file. I have a testfile1.conf:

-------------------------------------------
this is a test file
this server name is placeholder
-------------------------------------------

I have an inventory file (and a hosts file, still trying to figure those 
out):

[servers]
server01 ansible_ssh_host=192.168.6.131
server02 ansible_ssh_host=192.168.6.139
server03 ansible_ssh_host=192.168.6.140

and my playbook:

---
- name: read IP from hosts match w var replace with vars
  hosts: servers
  tasks:

   - name: replace placeholder
     replace:
          dest=/vartest/testfile1.conf
          regexp='placeholder'
          replace={{ inventory_hostname }}
          backup=no


When I run the playbook, I get no errors, but instead of putting in the 
server name (server01, server02, or server03) it puts in the IP address of 
the target machine.

What am I missing? 

regards, Richard

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/169e3c63-06ab-44f5-a683-1dd80840ed09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to