Hi, I’m trying to reconfigure a running OS to use bridge vs the actual interface. My playbook so far:
-
name: copy bridge config
template: src=if-br.j2 dest=/etc/sysconfig/network-scripts/if-{{ bridge_name }} backup=yes -
name: copy interface config
template: src=if-nic.j2 dest=/etc/sysconfig/network-scripts/if-{{ nic_name }} backup=yes
we will lose connectivity right after this
- name: add OVS port
openvswitch_port: bridge={{ bridge_name }} port={{ nic_name }} state=present
async: 60
poll: 30
we should recover connectivity right after this
- name: restart network
service: name=network state=restarted
async: 60
poll: 30
As you can see last two actions should be run async (due to loss of connectivity) however they also need to be executed sequentially. I like the way those tasks are defined using Ansible (with some add-on built logic for checking whether bridge exists etc. that I don’t have to implement) and would prefer it not to be a shell script instead. Are there any good options for doing it within ansible without resorting to “outsorcing” for that last chunk to a shell script?