Hi,
I have a file in which i need to replace worrd with hostname of my machine.
I am trying below code and getting error.
Pls let me know ho can i do this … i am new to ansible
-
name: hostame
shell: hostname
register: hostnameoutput -
debug: mesg=‘{{ hostnameoutput }}’
-
name: replace hostname
replace: dest=/root/test1 regexp=hostname replace={{ hostnameoutput }}