Hi,
We’re renumbering our network. I can’t seem to get networking restarted. If I try with “fire and forget” (async 10 & poll 0) it reports:
PLAY [test-net] ***************************************************************
GATHERING FACTS ***************************************************************
ok: [ansible-nw-test.iedr.ie]
TASK: [network-project | Set resolv.conf] *************************************
ok: [ansible-nw-test.iedr.ie]
TASK: [network-project | Remove route-eth0 networking file] *******************
ok: [ansible-nw-test.iedr.ie]
TASK: [network-project | Update eth0 networking file] *************************
changed: [ansible-nw-test.iedr.ie]
TASK: [network-project | Restart networking] **********************************
<job 471496875238.17610> finished on ansible-nw-test.iedr.ie
PLAY RECAP ********************************************************************
ansible-nw-test.iedr.ie : ok=6 changed=1 unreachable=0 failed=0
and on the remote host:
Jun 4 05:34:48 ansible-nw-test ansible-setup: Invoked with filter=* fact_path=/etc/ansible/facts.d
Jun 4 05:35:04 ansible-nw-test ansible-file: Invoked with directory_mode=None force=False remote_src=None path=/etc/resolv.conf owner=root follow=True group=None state=None content=NOT_LOGGING_PARAMETER serole=None diff_peek=None setype=None dest=/etc/resolv.conf selevel=None original_basename=resolv.conf.j2 regexp=None validate=None src=None seuser=None recurse=False delimiter=None mode=664 backup=None
Jun 4 05:35:06 ansible-nw-test ansible-file: Invoked with directory_mode=None force=False remote_src=None path=/etc/sysconfig/network-scripts/route-eth0 owner=None follow=False group=None state=absent content=NOT_LOGGING_PARAMETER serole=None diff_peek=None setype=None selevel=None original_basename=None regexp=None validate=None src=None seuser=None recurse=False delimiter=None mode=None backup=None
Jun 4 05:35:07 ansible-nw-test ansible-copy: Invoked with src=/home/ansible/.ansible/tmp/ansible-tmp-1433409748.69-160995740642356/source directory_mode=None force=True remote_src=None dest=/etc/sysconfig/network-scripts/ifcfg-eth0 selevel=None seuser=None serole=None setype=None group=None content=NOT_LOGGING_PARAMETER delimiter=None original_basename=ifcfg-eth0 mode=0644 follow=True owner=root regexp=None validate=None backup=False
Jun 4 05:35:08 ansible-nw-test ansible-async_wrapper: Invoked with 471496875238 10 /home/ansible/.ansible/tmp/ansible-tmp-1433409750.05-94907608634475/command /home/ansible/.ansible/tmp/ansible-tmp-1433409750.05-94907608634475/arguments
… but networking isn’t restarted.
- name: Update eth0 networking file
template: src=roles/network-project/templates/ifcfg-eth0 dest=/etc/sysconfig/network-scripts/ifcfg-eth0 owner=root mode=0644
tags: netproj-rmroute
- name: Restart networking
shell: /etc/rc.d/init.d/network restart &
async: 10
poll: 0
tags: netproj-netrestart
i’ve tried “service: name=network state=restarted”, command. but with no success.
If I try without “fire and forget”, it restarts networking but my ansible SSH session hangs.
We need to do many VMs, so ideally, I’d like to fire and forget and continue to the next VM.
Any suggestions / corrections / help would be great.
Thanks in advance
Billy