Hello,
I am using Ansible to update templated VM machines with correct networking.
My inventory contains the templated hosts [nos5] and the deployed host
[nos6]. It should be noted that the interface I am changing is the one I'm
using in Ansible .
The Ansible playbook successfully updates the ifcfg-eth0 file and restarts
the network. However, it hangs for about 1-2 minutes before returning a
failure code.
fatal: [nos5]: FAILED! => {"changed": false, "failed": true, "invocation":
> {"module_name": "command"}, "module_stderr": "", "module_stdout": "\r\n",
> "msg": "MODULE FAILURE", "parsed": false}
>
The tasks I'm executing are as follows.
- name: Update Networking for NOS
> lineinfile:
> dest: /etc/sysconfig/network-scripts/ifcfg-eth0
> regexp: "^IPADDR"
> line: "IPADDR=10.157.{{ VDC_Number }}.100"
> when: target_vm == "NOS"
> register: network_nos_ok
>
> - name: Bounce the interface
> shell: ifdown eth0; ifup eth0
> when: target_vm == "NOS" and network_nos_ok is defined
>
The starting IP is 10.157.5.100, and the changed IP is 10.157.6.100.
Is there a way to make this happen without the excessive delaty and report
success?
--
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/95e84e1b-4c89-4a92-918f-0328bc76748d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.