From 7975e874e8c517669d981cc3a1ce900ebe4b39ec Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Tue, 13 Oct 2020 14:25:36 +0300 Subject: [PATCH] Install openswitch and firewall if need a bridge only In case of nodeset which doesn't have peers and switch there is no need to install openswitch and firewall rules, because nothing will be installed. Let's skip it if no need. Change-Id: I98cf5ec390ee22e538baa076c9ab87eea6a44c9e --- roles/multi-node-bridge/tasks/main.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/multi-node-bridge/tasks/main.yaml b/roles/multi-node-bridge/tasks/main.yaml index 384d1abf8..3fe15bda7 100644 --- a/roles/multi-node-bridge/tasks/main.yaml +++ b/roles/multi-node-bridge/tasks/main.yaml @@ -4,6 +4,9 @@ - include: common.yaml environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" + when: >- + inventory_hostname in groups['switch'] or + inventory_hostname in groups['peers'] - include: switch.yaml environment: @@ -20,3 +23,6 @@ - name: Persist iptables rules include_role: name: persistent-firewall + when: >- + inventory_hostname in groups['switch'] or + inventory_hostname in groups['peers']