From 91761545519d88d2f8caa7b372de7af7bfa2066c Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Tue, 21 Nov 2023 10:48:47 +0100 Subject: [PATCH] Copylegacy_groups.yml into its sole user --- playbooks/boilerplate.yml | 48 +++++++++++++++++++++++++++++++++++-- playbooks/legacy_groups.yml | 47 ------------------------------------ 2 files changed, 46 insertions(+), 49 deletions(-) delete mode 100644 playbooks/legacy_groups.yml diff --git a/playbooks/boilerplate.yml b/playbooks/boilerplate.yml index 4e37da2fa83..137a4c2c5b4 100644 --- a/playbooks/boilerplate.yml +++ b/playbooks/boilerplate.yml @@ -2,8 +2,52 @@ - name: Check ansible version import_playbook: ansible_version.yml -- name: Ensure compatibility with old groups - import_playbook: legacy_groups.yml +# These are inventory compatibility tasks to ensure we keep compatibility with old style group names + +- name: Add kube-master nodes to kube_control_plane + hosts: kube-master + gather_facts: false + tags: always + tasks: + - name: Add nodes to kube_control_plane group + group_by: + key: 'kube_control_plane' + +- name: Add kube-node nodes to kube_node + hosts: kube-node + gather_facts: false + tags: always + tasks: + - name: Add nodes to kube_node group + group_by: + key: 'kube_node' + +- name: Add k8s-cluster nodes to k8s_cluster + hosts: k8s-cluster + gather_facts: false + tags: always + tasks: + - name: Add nodes to k8s_cluster group + group_by: + key: 'k8s_cluster' + +- name: Add calico-rr nodes to calico_rr + hosts: calico-rr + gather_facts: false + tags: always + tasks: + - name: Add nodes to calico_rr group + group_by: + key: 'calico_rr' + +- name: Add no-floating nodes to no_floating + hosts: no-floating + gather_facts: false + tags: always + tasks: + - name: Add nodes to no-floating group + group_by: + key: 'no_floating' - name: Install bastion ssh config hosts: bastion[0] diff --git a/playbooks/legacy_groups.yml b/playbooks/legacy_groups.yml deleted file mode 100644 index 643032ff098..00000000000 --- a/playbooks/legacy_groups.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -# This is an inventory compatibility playbook to ensure we keep compatibility with old style group names - -- name: Add kube-master nodes to kube_control_plane - hosts: kube-master - gather_facts: false - tags: always - tasks: - - name: Add nodes to kube_control_plane group - group_by: - key: 'kube_control_plane' - -- name: Add kube-node nodes to kube_node - hosts: kube-node - gather_facts: false - tags: always - tasks: - - name: Add nodes to kube_node group - group_by: - key: 'kube_node' - -- name: Add k8s-cluster nodes to k8s_cluster - hosts: k8s-cluster - gather_facts: false - tags: always - tasks: - - name: Add nodes to k8s_cluster group - group_by: - key: 'k8s_cluster' - -- name: Add calico-rr nodes to calico_rr - hosts: calico-rr - gather_facts: false - tags: always - tasks: - - name: Add nodes to calico_rr group - group_by: - key: 'calico_rr' - -- name: Add no-floating nodes to no_floating - hosts: no-floating - gather_facts: false - tags: always - tasks: - - name: Add nodes to no-floating group - group_by: - key: 'no_floating'