Hi,
I am trying to use previous task output to new task to modify one file, But
it is throwing error variable not defined -
---
- hosts: host4
remote_user: root
tasks:
- name: Get MAC of host4
shell: cat /sys/class/net/eth0/address
register: x
- debug: var=x.stdout
- hosts: host3
remote_user: root
tasks:
- name: find MAC_hos4 word in topology.cfg and replace the same with actual
MAC of host4
lineinfile: path=/root/topology.cfg
regexp= '^mac=MAC_IS'
line= 'mac={{x.stdout}}'
Can any one please suggest something to rectify the problem.
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/74caacfd-2c2b-4799-a5be-2e70628d2da8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.