From 942deb06680fe020ad0d19309c62ab811967da32 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 24 Mar 2022 15:00:47 -0400 Subject: [PATCH] Move secondary-nic tag to common role So I can use it for LRC hosts Signed-off-by: David Galloway --- roles/common/README.rst | 8 ++++++++ roles/common/tasks/main.yml | 6 ++++++ roles/{testnode => common}/tasks/secondary_nic.yml | 0 roles/testnode/README.rst | 8 -------- roles/testnode/tasks/main.yml | 6 ------ 5 files changed, 14 insertions(+), 14 deletions(-) rename roles/{testnode => common}/tasks/secondary_nic.yml (100%) diff --git a/roles/common/README.rst b/roles/common/README.rst index d6b80bc..5659116 100644 --- a/roles/common/README.rst +++ b/roles/common/README.rst @@ -79,6 +79,11 @@ tasks OS-agnostic. They variables are mostly self-explanatory and defined in - nagios-nrpe-server - nagios-plugins-basic +Definining ``secondary_nic_mac`` as a hostvar will configure the corresponding NIC to use DHCP. This +assumes you've configured a static IP definition on your DHCP server and only supports one additional NIC at this time:: + + secondary_nic_mac: '' + Tags ++++ @@ -101,6 +106,9 @@ nagios applicable). ``monitoring-scripts`` is also always run with this tag since NRPE isn't very useful without them. +secondary-nic + Configure secondary NIC if ``secondary_nic_mac`` is defined. + To Do +++++ diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 9c4200f..8d25598 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -60,3 +60,9 @@ (selinux_status is defined and selinux_status.stdout != "Disabled") tags: - nagios + +- name: include secondary NIC config tasks + import_tasks: secondary_nic.yml + when: secondary_nic_mac is defined + tags: + - secondary-nic diff --git a/roles/testnode/tasks/secondary_nic.yml b/roles/common/tasks/secondary_nic.yml similarity index 100% rename from roles/testnode/tasks/secondary_nic.yml rename to roles/common/tasks/secondary_nic.yml diff --git a/roles/testnode/README.rst b/roles/testnode/README.rst index 857bf96..81faaff 100644 --- a/roles/testnode/README.rst +++ b/roles/testnode/README.rst @@ -207,11 +207,6 @@ The latter is only done if ``lab_domain`` is defined:: lab_domain: '' -Up until recently, testnodes only had one uplink. Definining ``secondary_nic_mac`` as a hostvar will configure the corresponding NIC to use DHCP. This -assumes you've configured a static IP definition on your DHCP server and only supports one additional NIC at this time:: - - secondary_nic_mac: '' - A dictionary of drives/devices you want to partition. ``scratch_devs`` is not required. All other values are self-explanatory given this example:: # Example: @@ -355,9 +350,6 @@ remove-ceph repos Perform all repo related tasks. Creates and manages our custom repo files. -secondary-nic - Configure secondary NIC if ``secondary_nic_mac`` is defined. - selinux Configure selinux on yum systems. diff --git a/roles/testnode/tasks/main.yml b/roles/testnode/tasks/main.yml index 2cc2888..fb62514 100644 --- a/roles/testnode/tasks/main.yml +++ b/roles/testnode/tasks/main.yml @@ -129,12 +129,6 @@ tags: - resolvconf -- name: include secondary NIC config tasks - import_tasks: secondary_nic.yml - when: secondary_nic_mac is defined - tags: - - secondary-nic - # http://tracker.ceph.com/issues/20623 - name: List any leftover Ceph artifacts from previous jobs shell: 'find {{ item }} -name "*ceph*"' -- 2.39.5