Skip to content

Commit

Permalink
updating code
Browse files Browse the repository at this point in the history
  • Loading branch information
tosin2013 committed Apr 10, 2023
1 parent a12bb79 commit 4248637
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions roles/qubinode_kvmhost_setup/tasks/bridge_interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
# The command module gives us the behaviour we expect which is network restart without loosing
# connectivity and the bridge interface comes up.

- name: Restart network service
ansible.builtin.command: "systemctl restart {{ item }}"
- name: Restart network service for older systems
systemd:
name: "{{ item }}"
state: restarted
changed_when: false
with_items:
- network
Expand All @@ -68,7 +70,9 @@
when: (("RedHat" and ansible_distribution_major_version == '7') and (not bridge_name | bool or bridge_name is undefined))

- name: Restart network service
ansible.builtin.command: "systemctl restart {{ item }}"
systemd:
name: "{{ item }}"
state: restarted
changed_when: false
with_items:
- NetworkManager
Expand All @@ -82,6 +86,7 @@

- name: Disable old connection
ansible.builtin.command: "sudo nmcli connection down {{ libvirt_host_networks[type_idx].bridge_slave_dev }}"

changed_when: false
when: (("RedHat" and ansible_distribution_major_version == '8') and (not bridge_name | bool or bridge_name is undefined))
failed_when: true
Expand Down

0 comments on commit 4248637

Please sign in to comment.