diff --git a/playbooks/cluster_setup_ha.yaml b/playbooks/cluster_setup_ha.yaml index d070f9556..fde6fa9aa 100644 --- a/playbooks/cluster_setup_ha.yaml +++ b/playbooks/cluster_setup_ha.yaml @@ -8,7 +8,6 @@ - name: Configure HA basics hosts: cluster_machines become: true - gather_facts: true vars: tmpdir: "/tmp" corosync_node_list: "{{ groups['cluster_machines'] | list }}" diff --git a/playbooks/seapath_setup_main.yaml b/playbooks/seapath_setup_main.yaml index 90f05757d..d9cc1ea7a 100644 --- a/playbooks/seapath_setup_main.yaml +++ b/playbooks/seapath_setup_main.yaml @@ -9,23 +9,21 @@ # This playbooks can also configure VMs created with build_debian_iso # This playbook also configures Yocto standalone machine (no cluster) -- name: Gather ansible_distribution +- name: Detect Seapath distribution hosts: - cluster_machines - standalone_machine - tasks: - - name: Gather only the ansible_distribution fact - ansible.builtin.setup: - filter: ansible_distribution + roles: + - detect_seapath_distro - import_playbook: seapath_setup_prerequiscentos.yaml - when: ansible_distribution | regex_search("CentOS|RedHat") + when: seapath_distro == "CentOS" - import_playbook: seapath_setup_prerequisdebian.yaml - when: ansible_distribution | regex_search("Debian") + when: seapath_distro == "Debian" - import_playbook: seapath_setup_prerequisyocto.yaml - when: ansible_distribution | regex_search("Yocto") + when: seapath_distro == "Yocto" - import_playbook: seapath_setup_network.yaml diff --git a/playbooks/seapath_setup_snmp.yaml b/playbooks/seapath_setup_snmp.yaml index 56abdfe3b..cd70fe645 100644 --- a/playbooks/seapath_setup_snmp.yaml +++ b/playbooks/seapath_setup_snmp.yaml @@ -1,15 +1,6 @@ # Copyright (C) 2024, RTE (http://www.rte-france.com) # SPDX-License-Identifier: Apache-2.0 -- name: Gather ansible_distribution - hosts: - - cluster_machines - - standalone_machine - tasks: - - name: Gather only the ansible_distribution fact - ansible.builtin.setup: - filter: ansible_distribution - - name: Configure snmp hosts: - cluster_machines diff --git a/playbooks/seapath_setup_timemaster.yaml b/playbooks/seapath_setup_timemaster.yaml index c2dcd7c55..1d8cfa5ac 100644 --- a/playbooks/seapath_setup_timemaster.yaml +++ b/playbooks/seapath_setup_timemaster.yaml @@ -1,15 +1,6 @@ # Copyright (C) 2024, RTE (http://www.rte-france.com) # SPDX-License-Identifier: Apache-2.0 -- name: Gather ansible_distribution - hosts: - - cluster_machines - - standalone_machine - tasks: - - name: Gather only the ansible_distribution fact - ansible.builtin.setup: - filter: ansible_distribution - - name: Configure timemaster hosts: - cluster_machines diff --git a/playbooks/test_run_cukinia.yaml b/playbooks/test_run_cukinia.yaml index 442f32e5d..771484d6c 100644 --- a/playbooks/test_run_cukinia.yaml +++ b/playbooks/test_run_cukinia.yaml @@ -11,8 +11,10 @@ - cluster_machines - standalone_machine - VMs + roles: + - detect_seapath_distro tasks: - - include_vars: "../vars/{{ ansible_distribution }}_paths.yml" + - include_vars: "../vars/{{ seapath_distro }}_paths.yml" - hosts: - cluster_machines diff --git a/roles/ci_restore_snapshot/README.md b/roles/ci_restore_snapshot/README.md index 3cbcede39..a9215a611 100644 --- a/roles/ci_restore_snapshot/README.md +++ b/roles/ci_restore_snapshot/README.md @@ -4,7 +4,7 @@ This role restores the LVM snapshot of the root LV and re-creates it ## Requirements -no requirement. +- detect_seapath_distro ## Role Variables diff --git a/roles/ci_restore_snapshot/meta/main.yml b/roles/ci_restore_snapshot/meta/main.yml index fa12f2a38..6fc33a4eb 100644 --- a/roles/ci_restore_snapshot/meta/main.yml +++ b/roles/ci_restore_snapshot/meta/main.yml @@ -10,5 +10,5 @@ galaxy_info: - name: Debian versions: - all -dependencies: [] - +dependencies: + - role: detect_seapath_distro diff --git a/roles/ci_restore_snapshot/tasks/main.yml b/roles/ci_restore_snapshot/tasks/main.yml index 271d4e7bb..4e5a26fa6 100644 --- a/roles/ci_restore_snapshot/tasks/main.yml +++ b/roles/ci_restore_snapshot/tasks/main.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 --- -- include_vars: "{{ ansible_distribution | replace(' ', '_') }}.yml" +- include_vars: "{{ seapath_distro }}.yml" - name: "grub conf" lineinfile: diff --git a/roles/ci_restore_snapshot/vars/Seapath_host_Yocto_distribution.yml b/roles/ci_restore_snapshot/vars/Yocto.yml similarity index 100% rename from roles/ci_restore_snapshot/vars/Seapath_host_Yocto_distribution.yml rename to roles/ci_restore_snapshot/vars/Yocto.yml diff --git a/roles/configure_admin_user/README.md b/roles/configure_admin_user/README.md index 695637f1e..7afbf4f12 100644 --- a/roles/configure_admin_user/README.md +++ b/roles/configure_admin_user/README.md @@ -3,7 +3,7 @@ This role copy the root ssh key to admin user's. This user is used by Debian whe ## Requirements -no requirement. +- detect_seapath_distro ## Role Variables diff --git a/roles/configure_admin_user/meta/main.yml b/roles/configure_admin_user/meta/main.yml index 333020b0d..65ba30470 100644 --- a/roles/configure_admin_user/meta/main.yml +++ b/roles/configure_admin_user/meta/main.yml @@ -10,4 +10,5 @@ galaxy_info: - name: Debian versions: - all -dependencies: [] +dependencies: + - role: detect_seapath_distro diff --git a/roles/configure_admin_user/tasks/main.yml b/roles/configure_admin_user/tasks/main.yml index 86f6069c1..7ca1b7c7d 100644 --- a/roles/configure_admin_user/tasks/main.yml +++ b/roles/configure_admin_user/tasks/main.yml @@ -17,4 +17,4 @@ state: present key: "{{ lookup('file','buffer/' + item + '-id_rsa.pub') }}" with_items: "{{ groups['hypervisors'] }}" - when: ansible_distribution | regex_search("CentOS|Debian") + when: seapath_distro in [ "CentOS", "Debian" ] diff --git a/roles/configure_ha/README.md b/roles/configure_ha/README.md index d86b65ec4..027ba013b 100644 --- a/roles/configure_ha/README.md +++ b/roles/configure_ha/README.md @@ -4,7 +4,7 @@ This role configures the High Availability part of a seapath cluster (Corosync a ## Requirements -no requirement. +- detect_seapath_distro ## Role Variables diff --git a/roles/configure_ha/meta/main.yml b/roles/configure_ha/meta/main.yml index dc9b468c3..26327d7b2 100644 --- a/roles/configure_ha/meta/main.yml +++ b/roles/configure_ha/meta/main.yml @@ -8,4 +8,5 @@ galaxy_info: - name: Debian versions: - all -dependencies: [] +dependencies: + - role: detect_seapath_distro diff --git a/roles/configure_ha/tasks/main.yml b/roles/configure_ha/tasks/main.yml index a4ac3d273..378a9787e 100644 --- a/roles/configure_ha/tasks/main.yml +++ b/roles/configure_ha/tasks/main.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 --- -- include_vars: "{{ ansible_distribution | replace(' ', '_') }}.yml" +- include_vars: "{{ seapath_distro }}.yml" - name: Save cluster machine informations template: diff --git a/roles/configure_ha/vars/Seapath_host_Yocto_distribution.yml b/roles/configure_ha/vars/Yocto.yml similarity index 100% rename from roles/configure_ha/vars/Seapath_host_Yocto_distribution.yml rename to roles/configure_ha/vars/Yocto.yml diff --git a/roles/network_configovs/README.md b/roles/network_configovs/README.md index 2ec1f6c22..ca054dcfb 100644 --- a/roles/network_configovs/README.md +++ b/roles/network_configovs/README.md @@ -4,7 +4,7 @@ This role configures OVS ## Requirements -no requirement. +- detect_seapath_distro ## Role Variables diff --git a/roles/network_configovs/meta/main.yml b/roles/network_configovs/meta/main.yml index b44124c14..c9d000286 100644 --- a/roles/network_configovs/meta/main.yml +++ b/roles/network_configovs/meta/main.yml @@ -10,4 +10,5 @@ galaxy_info: - name: Debian versions: - all -dependencies: [] +dependencies: + - role: detect_seapath_distro diff --git a/roles/network_configovs/tasks/main.yml b/roles/network_configovs/tasks/main.yml index 7b9e578bf..01ddc912d 100644 --- a/roles/network_configovs/tasks/main.yml +++ b/roles/network_configovs/tasks/main.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 --- -- include_vars: "{{ ansible_distribution | replace(' ', '_') }}.yml" +- include_vars: "{{ seapath_distro }}.yml" - name: Create OVS configuration template: @@ -29,4 +29,3 @@ when: - ovs_vsctl_cmds is defined loop: "{{ ovs_vsctl_cmds }}" - diff --git a/roles/network_configovs/vars/Seapath_host_Yocto_distribution.yml b/roles/network_configovs/vars/Yocto.yml similarity index 100% rename from roles/network_configovs/vars/Seapath_host_Yocto_distribution.yml rename to roles/network_configovs/vars/Yocto.yml diff --git a/roles/snmp/README.md b/roles/snmp/README.md index 7247b787f..86c8ccec4 100644 --- a/roles/snmp/README.md +++ b/roles/snmp/README.md @@ -4,7 +4,7 @@ This role configure the SNMP feature ## Requirements -no requirement. +- detect_seapath_distro ## Role Variables diff --git a/roles/snmp/meta/main.yml b/roles/snmp/meta/main.yml index 390f37487..ff529a116 100644 --- a/roles/snmp/meta/main.yml +++ b/roles/snmp/meta/main.yml @@ -10,4 +10,5 @@ galaxy_info: - name: Debian versions: - all -dependencies: [] +dependencies: + - role: detect_seapath_distro diff --git a/roles/snmp/tasks/main.yml b/roles/snmp/tasks/main.yml index 48bf99662..500c9bd0c 100644 --- a/roles/snmp/tasks/main.yml +++ b/roles/snmp/tasks/main.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 --- -- include_vars: "{{ ansible_distribution | replace(' ', '_') }}.yml" +- include_vars: "{{ seapath_distro }}.yml" - name: configure snmp block: diff --git a/roles/snmp/vars/Seapath_host_Yocto_distribution.yml b/roles/snmp/vars/Yocto.yml similarity index 100% rename from roles/snmp/vars/Seapath_host_Yocto_distribution.yml rename to roles/snmp/vars/Yocto.yml diff --git a/roles/timemaster/README.md b/roles/timemaster/README.md index fbcd591e5..109b21958 100644 --- a/roles/timemaster/README.md +++ b/roles/timemaster/README.md @@ -4,7 +4,7 @@ This role configures timemaster ## Requirements -no requirement. +- detect_seapath_distro ## Role Variables diff --git a/roles/timemaster/meta/main.yml b/roles/timemaster/meta/main.yml index 56cf3fe19..71f163ac5 100644 --- a/roles/timemaster/meta/main.yml +++ b/roles/timemaster/meta/main.yml @@ -10,4 +10,5 @@ galaxy_info: - name: Debian versions: - all -dependencies: [] +dependencies: + - role: detect_seapath_distro diff --git a/roles/timemaster/tasks/main.yml b/roles/timemaster/tasks/main.yml index ba4a5214a..2f4ed5754 100644 --- a/roles/timemaster/tasks/main.yml +++ b/roles/timemaster/tasks/main.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 --- -- include_vars: "{{ ansible_distribution | replace(' ', '_') }}.yml" +- include_vars: "{{ seapath_distro }}.yml" - name: Populate service facts service_facts: diff --git a/roles/timemaster/vars/Seapath_host_Yocto_distribution.yml b/roles/timemaster/vars/Yocto.yml similarity index 100% rename from roles/timemaster/vars/Seapath_host_Yocto_distribution.yml rename to roles/timemaster/vars/Yocto.yml diff --git a/src/ceph-ansible-patches/distro_not_supported.diff b/src/ceph-ansible-patches/distro_not_supported.diff index f5da869eb..46913cf9d 100644 --- a/src/ceph-ansible-patches/distro_not_supported.diff +++ b/src/ceph-ansible-patches/distro_not_supported.diff @@ -1,5 +1,16 @@ +diff --git a/roles/ceph-validate/meta/main.yml b/roles/ceph-validate/meta/main.yml +index 1c6197efd..339e30deb 100644 +--- a/roles/ceph-validate/meta/main.yml ++++ b/roles/ceph-validate/meta/main.yml +@@ -11,4 +11,5 @@ galaxy_info: + - 7 + galaxy_tags: + - system +-dependencies: [] ++dependencies: ++ - role: ../../roles/detect_seapath_distro diff --git a/roles/ceph-validate/tasks/check_system.yml b/roles/ceph-validate/tasks/check_system.yml -index dc8cdd6fd..4a9ffff4d 100644 +index dc8cdd6fd..8f7d224eb 100644 --- a/roles/ceph-validate/tasks/check_system.yml +++ b/roles/ceph-validate/tasks/check_system.yml @@ -22,7 +22,9 @@ @@ -9,7 +20,7 @@ index dc8cdd6fd..4a9ffff4d 100644 - when: ansible_facts['os_family'] not in ['Debian', 'RedHat', 'ClearLinux', 'Suse'] + when: + - ansible_facts['os_family'] not in ['Debian', 'RedHat', 'ClearLinux', 'Suse'] -+ - "'Yocto' not in ansible_distribution" ++ - seapath_distro != "Yocto" - name: fail on unsupported CentOS release fail: diff --git a/src/ceph-ansible-patches/osd_no_package.diff b/src/ceph-ansible-patches/osd_no_package.diff index 12ff2f69e..72c85e499 100644 --- a/src/ceph-ansible-patches/osd_no_package.diff +++ b/src/ceph-ansible-patches/osd_no_package.diff @@ -1,12 +1,23 @@ +diff --git a/roles/ceph-osd/meta/main.yml b/roles/ceph-osd/meta/main.yml +index 3c2a26e89..283bae30b 100644 +--- a/roles/ceph-osd/meta/main.yml ++++ b/roles/ceph-osd/meta/main.yml +@@ -11,4 +11,5 @@ galaxy_info: + - 7 + galaxy_tags: + - system +-dependencies: [] ++dependencies: ++ - role: ../../roles/detect_seapath_distro diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml -index 623731ddd..d9e281f2b 100644 +index 623731ddd..e1631dc01 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -24,6 +24,7 @@ when: - not containerized_deployment | bool - ansible_facts['os_family'] != 'ClearLinux' -+ - "'Yocto' not in ansible_distribution" - ++ - seapath_distro != "Yocto" + - name: install numactl when needed package: diff --git a/src/ceph-ansible-patches/purge_yocto_cluster.diff b/src/ceph-ansible-patches/purge_yocto_cluster.diff index c59558ba4..52de2e8c2 100644 --- a/src/ceph-ansible-patches/purge_yocto_cluster.diff +++ b/src/ceph-ansible-patches/purge_yocto_cluster.diff @@ -1,38 +1,39 @@ diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml -index 109a25697..29a0c842a 100644 +index 109a25697..3afab0460 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml -@@ -50,7 +50,7 @@ - - name: check there's no ceph kernel threads present - hosts: clients +@@ -42,6 +42,9 @@ + - mgrs + - monitoring become: true -- gather_facts: false + gather_facts: true - any_errors_fatal: true ++ roles: ++ - detect_seapath_distro tasks: - - import_role: -@@ -106,6 +106,7 @@ + - debug: + msg: "gather facts on all Ceph hosts for following reference" +@@ -106,6 +109,7 @@ - rbd - ceph - libceph -+ when: "'Yocto' not in ansible_distribution" ++ when: seapath_distro != "Yocto" - name: purge ceph nfs cluster -@@ -545,6 +546,16 @@ +@@ -545,6 +549,16 @@ when: - containerized_deployment | bool or ceph_volume_present.rc == 0 -+ - "'Yocto' not in ansible_distribution" ++ - seapath_distro != "Yocto" + + - name: Get real path for OSD disk + command: "realpath {{ ceph_osd_disk }}" # Get the resolved path of the disk given initially by the "/dev/disk/by-path/" for ceph purposes + register: ceph_osd_realdisk -+ when: "'Yocto' in ansible_distribution" ++ when: seapath_distro == "Yocto" + + - name: Cleanup Ceph OSD disks with ceph-volume + command: "ceph-volume lvm zap {{ ceph_osd_realdisk.stdout }} --destroy" -+ when: "'Yocto' in ansible_distribution" ++ when: seapath_distro == "Yocto" - name: get ceph block partitions shell: | diff --git a/vars/Seapath_host_Yocto_distribution_paths.yml b/vars/Yocto_paths.yml similarity index 100% rename from vars/Seapath_host_Yocto_distribution_paths.yml rename to vars/Yocto_paths.yml