help with yaml file

20 views
Skip to first unread message

Vinod P

unread,
Jun 8, 2021, 2:21:28 AM6/8/21
to Ansible Development
Hello All,
Need some help with yaml file

I am trying to run find command to fetch old IP address from multiple files in /etc directory and replace them with new IP address as follows

sudo find /etc  -type f -exec sed -i -e 's/10.1.3.51/10.2.3.54/g' {} +

I can accomplish this using the command but how do I do it using yaml file as i need to run it on multiple servers. 

Please help and thanks in advance.  

Som Das

unread,
Jun 8, 2021, 4:40:55 AM6/8/21
to Ansible Development
Hi Vinod,

You cannot use it like this directly, my suggestion would be to use a shell script or try using shell command  like this

shell: | 
set timeout 300 spawn ssh admin@{{ cimc_host }}

hope this helps :-)

Vinod P

unread,
Jun 9, 2021, 7:45:53 PM6/9/21
to Som Das, Ansible Development
Thanks Som Das.. 

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-devel/cZ5pUYR_WR4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/c21c718c-908e-4f1d-b32e-bf6d9cc887c8n%40googlegroups.com.


--
Thanks & Regards
Vinod P
Reply all
Reply to author
Forward
0 new messages