From c60d819ace4817f749827c5eba815e9bf12619c7 Mon Sep 17 00:00:00 2001 From: Matthew Durand Date: Tue, 21 Nov 2023 14:30:22 -0800 Subject: [PATCH] Use full path names for all modules (#61) * Use FQCN for all module names * Fix name[casing] linting issues * fix var spacing * fix pipeline linting command --- .gitlab-ci.yml | 2 +- buildspec/ansible-lint.yml | 2 +- playbooks/deploy_dss_software.yml | 6 +-- playbooks/format_redeploy_dss_software.yml | 4 +- playbooks/format_restart_dss_software.yml | 4 +- playbooks/redeploy_dss_software.yml | 2 +- playbooks/remove_dss_software.yml | 4 +- playbooks/remove_vlans.yml | 2 +- playbooks/restart_dss_software.yml | 4 +- playbooks/stop_reset_dss_software.yml | 2 +- playbooks/upgrade_dss_software.yml | 4 +- roles/check_iommu_off/tasks/main.yml | 4 +- roles/check_minio_errors/tasks/main.yml | 4 +- roles/check_minio_up/tasks/main.yml | 6 +-- roles/check_target_errors/tasks/main.yml | 4 +- roles/check_target_up/tasks/main.yml | 6 +-- roles/cleanup_datamover/tasks/main.yml | 6 +-- .../tasks/check_subsystems.yml | 16 +++---- .../cleanup_dss_minio/tasks/cleanup_minio.yml | 16 +++---- .../tasks/execute_cleanup_script.yml | 6 +-- roles/configure_coredumps/tasks/main.yml | 14 +++--- roles/configure_dcqcn/handlers/main.yml | 2 +- .../configure_dcqcn/tasks/configure_dcqcn.yml | 12 ++--- roles/configure_dcqcn/tasks/main.yml | 10 ++-- roles/configure_firewalld/tasks/main.yml | 4 +- .../handlers/main.yml | 4 +- .../configure_host_only_vlans/tasks/main.yml | 20 ++++---- .../tasks/configure_pfc.yml | 4 +- roles/configure_host_pfc/tasks/main.yml | 8 ++-- roles/configure_host_vlans/handlers/main.yml | 4 +- roles/configure_host_vlans/tasks/main.yml | 20 ++++---- .../configure_inbox_infiniband/tasks/main.yml | 10 ++-- .../tasks/redhat_7.yml | 2 +- .../tasks/redhat_8.yml | 2 +- roles/configure_irq/tasks/main.yml | 2 +- roles/configure_lldpd/tasks/main.yml | 8 ++-- .../tasks/assign_endpoint.yml | 6 +-- roles/configure_mc_alias/tasks/main.yml | 26 +++++------ roles/configure_ntp/tasks/main.yml | 12 ++--- roles/configure_onyx_vlans/tasks/main.yml | 20 ++++---- .../tasks/configure_server_mc_alias.yml | 8 ++-- .../configure_server_mc_alias/tasks/main.yml | 2 +- roles/configure_sysctl/tasks/main.yml | 2 +- .../tasks/configure_tcp_aliases.yml | 42 ++++++++--------- roles/configure_tcp_aliases/tasks/main.yml | 2 +- roles/configure_tuned/tasks/main.yml | 10 ++-- .../tasks/collect_cluster_mountpoints.yml | 4 +- .../tasks/create_client_library_conf.yml | 46 +++++++++---------- .../create_client_library_conf/tasks/main.yml | 2 +- .../tasks/set_clusters.yml | 6 +-- .../tasks/set_endpoints.yml | 8 ++-- roles/create_datamover_conf/tasks/main.yml | 6 +-- roles/deploy_aws_sdk_cpp/tasks/main.yml | 14 +++--- roles/deploy_client_library/handlers/main.yml | 2 +- roles/deploy_client_library/tasks/main.yml | 26 +++++------ roles/deploy_datamover/tasks/main.yml | 8 ++-- roles/deploy_datamover_deps/tasks/main.yml | 20 ++++---- roles/deploy_dss_agent/tasks/main.yml | 8 ++-- roles/deploy_dss_diamond/tasks/main.yml | 8 ++-- roles/deploy_dss_host/handlers/main.yml | 2 +- roles/deploy_dss_host/tasks/main.yml | 28 +++++------ roles/deploy_dss_minio/tasks/deploy_minio.yml | 14 +++--- roles/deploy_dss_minio/tasks/main.yml | 2 +- roles/deploy_dss_target/handlers/main.yml | 2 +- roles/deploy_dss_target/tasks/main.yml | 32 ++++++------- roles/deploy_epel/tasks/main.yml | 2 +- roles/deploy_etcd_gateway/tasks/main.yml | 8 ++-- roles/deploy_gcc/tasks/main.yml | 16 +++---- roles/deploy_infiniband/tasks/main.yml | 6 +-- roles/deploy_kernel/handlers/main.yml | 8 ++-- .../deploy_kernel/tasks/deploy_kernel_rpm.yml | 10 ++-- roles/deploy_kernel/tasks/main.yml | 16 +++---- .../deploy_kernel/tasks/set_grub_cmdline.yml | 4 +- .../tasks/install_mellanox_tools.yml | 4 +- roles/deploy_mlnx_tools/tasks/main.yml | 14 +++--- roles/deploy_nvme_cli/tasks/main.yml | 6 +-- roles/deploy_nvme_cli/tasks/redhat_7.yml | 2 +- roles/deploy_nvme_cli/tasks/redhat_8.yml | 2 +- roles/deploy_ofed/tasks/deploy_ofed.yml | 22 ++++----- roles/deploy_ofed/tasks/install_ofed.yml | 14 +++--- roles/deploy_ofed/tasks/main.yml | 8 ++-- roles/deploy_ufm/tasks/main.yml | 20 ++++---- roles/deploy_ufm/tasks/ufm_centos.yml | 4 +- roles/deploy_ufm_etcd/tasks/main.yml | 16 +++---- roles/deploy_ufm_etcd/tasks/ports_centos.yml | 2 +- roles/deploy_ufm_etcd/tasks/redhat_7.yml | 4 +- roles/deploy_ufm_etcd/tasks/redhat_8.yml | 6 +-- roles/deploy_utils/tasks/main.yml | 6 +-- roles/format_blobfs/tasks/format_blobfs.yml | 16 +++---- roles/format_blobfs/tasks/main.yml | 16 +++---- roles/format_disks/tasks/main.yml | 4 +- roles/format_kvssds/tasks/check_async.yml | 4 +- roles/format_kvssds/tasks/main.yml | 10 ++-- .../tasks/collect_cluster_mountpoints.yml | 4 +- roles/get_clusters/tasks/main.yml | 16 +++---- roles/get_clusters/tasks/set_clusters.yml | 6 +-- roles/get_clusters/tasks/set_endpoints.yml | 8 ++-- roles/get_combined_vlan_ip_map/tasks/main.yml | 14 +++--- roles/get_connectx_mac_list/tasks/main.yml | 6 +-- roles/get_ip_numa/tasks/main.yml | 8 ++-- roles/get_last_octet/tasks/main.yml | 10 ++-- roles/get_minio_hostnames/tasks/main.yml | 4 +- roles/get_mlnx_ports/tasks/main.yml | 2 +- roles/get_mountpoints/tasks/main.yml | 28 +++++------ roles/get_ofed_versions/tasks/main.yml | 4 +- roles/get_onyx_lldp/tasks/main.yml | 6 +-- roles/get_subsystem_nqns/tasks/main.yml | 6 +-- roles/get_tcp_numa/tasks/get_tcp_numa.yml | 22 ++++----- roles/get_tcp_numa/tasks/main.yml | 2 +- roles/get_tcp_vlan_ip_list/tasks/main.yml | 6 +-- roles/get_vlan_devices/tasks/main.yml | 6 +-- roles/get_vlan_ips/tasks/main.yml | 6 +-- roles/get_vlan_map/tasks/main.yml | 18 ++++---- roles/identify_kvssd_firmware/tasks/main.yml | 6 +-- roles/load_mlnx_drivers/tasks/main.yml | 4 +- roles/remove_blobfs_files/tasks/main.yml | 6 +-- roles/remove_datamover_index/tasks/main.yml | 2 +- roles/remove_dss_agent/tasks/main.yml | 8 ++-- roles/remove_dss_diamond/tasks/main.yml | 8 ++-- roles/remove_dss_software/tasks/main.yml | 2 +- roles/remove_etcd_gateway/tasks/main.yml | 6 +-- roles/remove_host_vlans/handlers/main.yml | 6 +-- roles/remove_host_vlans/tasks/main.yml | 8 ++-- .../remove_onyx_allowed_vlans/tasks/main.yml | 6 +-- roles/remove_ufm/tasks/main.yml | 6 +-- roles/remove_ufm_etcd/tasks/main.yml | 4 +- roles/reset_spdk/tasks/main.yml | 4 +- roles/start_compaction/tasks/main.yml | 6 +-- roles/start_datamover/tasks/datamover_DEL.yml | 2 +- roles/start_datamover/tasks/datamover_GET.yml | 2 +- .../start_datamover/tasks/datamover_LIST.yml | 2 +- roles/start_datamover/tasks/datamover_PUT.yml | 2 +- .../start_datamover/tasks/datamover_TEST.yml | 2 +- roles/start_datamover/tasks/main.yml | 16 +++---- .../start_dss_agent/tasks/check_dss_agent.yml | 10 ++-- .../tasks/install_dss_agent.yml | 20 ++++---- roles/start_dss_agent/tasks/main.yml | 6 +-- .../start_dss_host/tasks/configure_driver.yml | 14 +++--- roles/start_dss_host/tasks/main.yml | 16 +++---- .../tasks/setup_host_clusters.yml | 30 ++++++------ .../tasks/generate_scripts.yml | 12 ++--- roles/start_dss_minio/tasks/main.yml | 2 +- roles/start_dss_minio/tasks/start_minio.yml | 22 ++++----- .../tasks/start_minio_clusters.yml | 14 +++--- roles/start_dss_target/handlers/main.yml | 4 +- .../tasks/check_hugepages.yml | 6 +-- roles/start_dss_target/tasks/dss_target.yml | 22 ++++----- roles/start_dss_target/tasks/main.yml | 38 +++++++-------- .../tasks/set_num_hugepages.yml | 18 ++++---- roles/start_etcd_gateway/tasks/main.yml | 4 +- roles/start_ufm_etcd/tasks/add_cluster.yml | 12 ++--- roles/start_ufm_etcd/tasks/add_cm_node.yml | 10 ++-- roles/start_ufm_etcd/tasks/main.yml | 12 ++--- roles/stop_dss_agent/tasks/main.yml | 6 +-- roles/stop_dss_host/tasks/main.yml | 4 +- roles/stop_dss_minio/tasks/main.yml | 10 ++-- roles/stop_dss_target/tasks/main.yml | 10 ++-- roles/stop_etcd_gateway/tasks/main.yml | 4 +- roles/stop_ufm_etcd/tasks/main.yml | 4 +- .../tasks/collect_ansible_facts.yml | 2 +- .../tasks/collect_ansible_log.yml | 2 +- .../support_bundle/tasks/collect_binaries.yml | 4 +- .../tasks/collect_coredumps.yml | 2 +- roles/support_bundle/tasks/collect_dmesg.yml | 4 +- .../tasks/collect_dss_config.yml | 4 +- .../support_bundle/tasks/collect_dss_logs.yml | 4 +- .../tasks/collect_etc_hosts.yml | 2 +- .../tasks/collect_host_scripts.yml | 4 +- .../tasks/collect_nkv_config.yml | 4 +- .../support_bundle/tasks/collect_numactl.yml | 4 +- .../tasks/collect_spdk_status.yml | 4 +- .../tasks/collect_target_scripts.yml | 4 +- .../support_bundle/tasks/generate_bundle.yml | 32 ++++++------- roles/support_bundle/tasks/main.yml | 10 ++-- roles/test_ib_read_bw/tasks/ib_read_bw.yml | 26 +++++------ roles/test_ib_read_bw/tasks/main.yml | 28 +++++------ roles/test_iperf/tasks/iperf.yml | 20 ++++---- roles/test_iperf/tasks/main.yml | 22 ++++----- roles/test_nkv_test_cli/tasks/get_ip_numa.yml | 12 ++--- roles/test_nkv_test_cli/tasks/main.yml | 20 ++++---- .../test_nkv_test_cli/tasks/nkv_test_cli.yml | 12 ++--- roles/test_ping/tasks/main.yml | 24 +++++----- roles/test_s3_benchmark/tasks/main.yml | 42 ++++++++--------- .../test_s3_benchmark/tasks/s3_benchmark.yml | 2 +- .../upgrade_connectx_firmware/tasks/main.yml | 6 +-- .../tasks/query_connectx6.yml | 6 +-- .../tasks/upgrade_connectx6.yml | 14 +++--- roles/validate_ansible/tasks/main.yml | 2 +- .../tasks/validate_ansible.yml | 8 ++-- .../tasks/validate_python_modules.yml | 6 +-- roles/validate_centos/tasks/main.yml | 2 +- 191 files changed, 893 insertions(+), 893 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f28ced1d..cccffe8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,4 +18,4 @@ stages: ansible-lint: stage: lint - script: ansible-lint . + script: ansible-lint * diff --git a/buildspec/ansible-lint.yml b/buildspec/ansible-lint.yml index e5bdfdbd..b74516cf 100644 --- a/buildspec/ansible-lint.yml +++ b/buildspec/ansible-lint.yml @@ -4,4 +4,4 @@ phases: build: commands: - echo Running ansible-lint ... - - ansible-lint . + - ansible-lint * diff --git a/playbooks/deploy_dss_software.yml b/playbooks/deploy_dss_software.yml index 07211c4e..960b5391 100644 --- a/playbooks/deploy_dss_software.yml +++ b/playbooks/deploy_dss_software.yml @@ -52,7 +52,7 @@ - validate_ansible - name: Download Artifacts - import_playbook: download_artifacts.yml + ansible.builtin.import_playbook: download_artifacts.yml - name: Check IOMMU Off gather_facts: false @@ -140,7 +140,7 @@ - deploy_dss_minio - name: Start DSS Software - import_playbook: start_dss_software.yml + ansible.builtin.import_playbook: start_dss_software.yml - name: Deploy Data Mover - import_playbook: deploy_client.yml + ansible.builtin.import_playbook: deploy_client.yml diff --git a/playbooks/format_redeploy_dss_software.yml b/playbooks/format_redeploy_dss_software.yml index b6d21554..d7206fbb 100644 --- a/playbooks/format_redeploy_dss_software.yml +++ b/playbooks/format_redeploy_dss_software.yml @@ -43,7 +43,7 @@ - validate_ansible - name: Remove DSS Software - import_playbook: remove_dss_software.yml + ansible.builtin.import_playbook: remove_dss_software.yml - name: Format Disks hosts: @@ -54,6 +54,6 @@ - format_disks - name: Deploy DSS Software - import_playbook: deploy_dss_software.yml + ansible.builtin.import_playbook: deploy_dss_software.yml vars: cleanup_minio: true diff --git a/playbooks/format_restart_dss_software.yml b/playbooks/format_restart_dss_software.yml index b5e0adc5..ab5d0a0f 100644 --- a/playbooks/format_restart_dss_software.yml +++ b/playbooks/format_restart_dss_software.yml @@ -44,7 +44,7 @@ - validate_ansible - name: Stop DSS Software - import_playbook: stop_dss_software.yml + ansible.builtin.import_playbook: stop_dss_software.yml - name: Format Disks hosts: @@ -65,7 +65,7 @@ - remove_datamover_index - name: Start DSS Software - import_playbook: start_dss_software.yml + ansible.builtin.import_playbook: start_dss_software.yml vars: cleanup_minio: true diff --git a/playbooks/redeploy_dss_software.yml b/playbooks/redeploy_dss_software.yml index 16c67238..e416940e 100644 --- a/playbooks/redeploy_dss_software.yml +++ b/playbooks/redeploy_dss_software.yml @@ -43,7 +43,7 @@ - validate_ansible - name: Remove DSS Software - import_playbook: remove_dss_software.yml + ansible.builtin.import_playbook: remove_dss_software.yml vars: remove_etc: false diff --git a/playbooks/remove_dss_software.yml b/playbooks/remove_dss_software.yml index 92057b29..41d891a9 100644 --- a/playbooks/remove_dss_software.yml +++ b/playbooks/remove_dss_software.yml @@ -43,10 +43,10 @@ - validate_ansible - name: Stop datamover - import_playbook: cleanup_datamover.yml + ansible.builtin.import_playbook: cleanup_datamover.yml - name: Stop DSS Software - import_playbook: stop_dss_software.yml + ansible.builtin.import_playbook: stop_dss_software.yml - name: Reset SPDK hosts: diff --git a/playbooks/remove_vlans.yml b/playbooks/remove_vlans.yml index ffaf591c..28229957 100644 --- a/playbooks/remove_vlans.yml +++ b/playbooks/remove_vlans.yml @@ -43,7 +43,7 @@ - validate_ansible - name: Remove DSS Software - import_playbook: remove_dss_software.yml + ansible.builtin.import_playbook: remove_dss_software.yml - name: Get Onyx LLDP tables hosts: onyx diff --git a/playbooks/restart_dss_software.yml b/playbooks/restart_dss_software.yml index 5c12ce2c..d6de35cb 100644 --- a/playbooks/restart_dss_software.yml +++ b/playbooks/restart_dss_software.yml @@ -42,7 +42,7 @@ - validate_ansible - name: Stop DSS Software - import_playbook: stop_dss_software.yml + ansible.builtin.import_playbook: stop_dss_software.yml - name: Start DSS Software - import_playbook: start_dss_software.yml + ansible.builtin.import_playbook: start_dss_software.yml diff --git a/playbooks/stop_reset_dss_software.yml b/playbooks/stop_reset_dss_software.yml index 8a795107..4264a74e 100644 --- a/playbooks/stop_reset_dss_software.yml +++ b/playbooks/stop_reset_dss_software.yml @@ -37,7 +37,7 @@ # Additionally, once DSS software is stopped, disks will be returned back to kernel mode (SPDK reset). - name: Stop DSS Software - import_playbook: stop_dss_software.yml + ansible.builtin.import_playbook: stop_dss_software.yml - name: Reset SPDK hosts: diff --git a/playbooks/upgrade_dss_software.yml b/playbooks/upgrade_dss_software.yml index d25488c5..54246831 100644 --- a/playbooks/upgrade_dss_software.yml +++ b/playbooks/upgrade_dss_software.yml @@ -43,7 +43,7 @@ - validate_ansible - name: Stop DSS Software and Reset SPDK - import_playbook: stop_reset_dss_software.yml + ansible.builtin.import_playbook: stop_reset_dss_software.yml - name: Deploy DSS Software - import_playbook: deploy_dss_software.yml + ansible.builtin.import_playbook: deploy_dss_software.yml diff --git a/roles/check_iommu_off/tasks/main.yml b/roles/check_iommu_off/tasks/main.yml index 2e0b88a0..2c8b9cff 100644 --- a/roles/check_iommu_off/tasks/main.yml +++ b/roles/check_iommu_off/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Find IOMMU groups - find: + ansible.builtin.find: path: /sys/kernel/iommu_groups file_type: directory recurse: false register: iommu_groups - name: Assert IOMMU off - assert: + ansible.builtin.assert: that: iommu_groups.matched == 0 msg: IOMMU is enabled. Please disable IOMMU to use DSS software. diff --git a/roles/check_minio_errors/tasks/main.yml b/roles/check_minio_errors/tasks/main.yml index abd65137..8a6e4fd9 100644 --- a/roles/check_minio_errors/tasks/main.yml +++ b/roles/check_minio_errors/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Check minio logs for errors - shell: > + ansible.builtin.shell: > grep -i error {{ dss_log_dir }}/nkv-minio*.log {%- for error in exclude_errors_list -%} | grep -v '{{ error }}' @@ -40,7 +40,7 @@ register: minio_errors - name: Assert minio errors not found - assert: + ansible.builtin.assert: that: minio_errors.stdout_lines | length == 0 msg: "{{ minio_errors.stdout }}" ignore_errors: true diff --git a/roles/check_minio_up/tasks/main.yml b/roles/check_minio_up/tasks/main.yml index a48d3352..b9a932d6 100644 --- a/roles/check_minio_up/tasks/main.yml +++ b/roles/check_minio_up/tasks/main.yml @@ -29,12 +29,12 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- -- name: pgrep minio instances - command: pgrep -x minio +- name: Search for minio instances with pgrep + ansible.builtin.command: pgrep -x minio changed_when: false failed_when: false register: minio_instances - name: Print number of minio instances running - debug: + ansible.builtin.debug: msg: "Minio instances running: {{ minio_instances.stdout_lines | length }}" diff --git a/roles/check_target_errors/tasks/main.yml b/roles/check_target_errors/tasks/main.yml index df0c39e8..f1ba9b74 100644 --- a/roles/check_target_errors/tasks/main.yml +++ b/roles/check_target_errors/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Check target logs for errors - shell: > + ansible.builtin.shell: > grep -i error {{ dss_log_dir }}/nkv-target.log {%- for error in exclude_errors_list -%} | grep -v '{{ error }}' @@ -40,7 +40,7 @@ register: target_errors - name: Assert target errors not found - assert: + ansible.builtin.assert: that: target_errors.stdout_lines | length == 0 msg: "{{ target_errors.stdout }}" ignore_errors: true diff --git a/roles/check_target_up/tasks/main.yml b/roles/check_target_up/tasks/main.yml index d6ef76a0..c60195de 100644 --- a/roles/check_target_up/tasks/main.yml +++ b/roles/check_target_up/tasks/main.yml @@ -29,12 +29,12 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- -- name: pgrep target instances - command: pgrep reactor_ +- name: Search for target instances with pgrep + ansible.builtin.command: pgrep reactor_ changed_when: false failed_when: false register: target_instances - name: Print number of target instances running - debug: + ansible.builtin.debug: msg: "Target instances running: {{ target_instances.stdout_lines | length }}" diff --git a/roles/cleanup_datamover/tasks/main.yml b/roles/cleanup_datamover/tasks/main.yml index 82707a6f..4c49cf39 100644 --- a/roles/cleanup_datamover/tasks/main.yml +++ b/roles/cleanup_datamover/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get PIDs of datamover processes - command: "pgrep -f 'python3 {{ item }}'" + ansible.builtin.command: "pgrep -f 'python3 {{ item }}'" register: datamover_pids changed_when: false failed_when: false @@ -41,14 +41,14 @@ - client_application.py - name: Get SIDs of datamover processes - command: "ps -p {{ item }} -o sess=" + ansible.builtin.command: "ps -p {{ item }} -o sess=" register: datamover_sids changed_when: false failed_when: false loop: "{{ datamover_pids.results | map(attribute='stdout_lines') | flatten | unique }}" - name: Kill datamover processes and sub-processes - command: "pkill -s {{ item }}" + ansible.builtin.command: "pkill -s {{ item }}" loop: "{{ datamover_sids.results | map(attribute='stdout_lines') | flatten | unique }}" register: pkill_sid become: true diff --git a/roles/cleanup_dss_minio/tasks/check_subsystems.yml b/roles/cleanup_dss_minio/tasks/check_subsystems.yml index 1283dc2c..9f02d920 100644 --- a/roles/cleanup_dss_minio/tasks/check_subsystems.yml +++ b/roles/cleanup_dss_minio/tasks/check_subsystems.yml @@ -30,12 +30,12 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: included_targets: [] combined_expected_num_subsystems: 0 - name: Set included_targets var - set_fact: + ansible.builtin.set_fact: included_targets: "{{ included_targets + [ target ] }}" loop: "{{ target_hostnames }}" loop_control: @@ -44,19 +44,19 @@ run_once: true - name: Check number of listeners in nvmf.in.conf - shell: | + ansible.builtin.shell: | grep '^ Listen RDMA' {{ target_conf_file }} | wc -l changed_when: false register: num_listeners when: inventory_hostname in included_targets - name: Set expected_num_subsystems var - set_fact: + ansible.builtin.set_fact: expected_num_subsystems: "{{ num_listeners.stdout }}" when: inventory_hostname in included_targets - name: Set combined_expected_num_subsystems var - set_fact: + ansible.builtin.set_fact: combined_expected_num_subsystems: "{{ combined_expected_num_subsystems | int + hostvars[host].expected_num_subsystems | int }}" loop: "{{ included_targets }}" loop_control: @@ -65,7 +65,7 @@ run_once: true - name: NVMe list subsystems - command: nvme list-subsys + ansible.builtin.command: nvme list-subsys environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false @@ -74,14 +74,14 @@ when: inventory_hostname in host_hostnames - name: Check number of mounted subsystems - set_fact: + ansible.builtin.set_fact: subsystems_found: "{{ nvme_subsys.stdout | regex_findall(nvme_re) | length }}" vars: nvme_re: 'traddr=[^\s]+\strsvcid=[^\s]+\slive' when: inventory_hostname in host_hostnames - name: Assert subsystems mounted - assert: + ansible.builtin.assert: that: subsystems_found == combined_expected_num_subsystems msg: > Subsystems are not mounted. Cannot cleanup MinIO unless DSS software is started. diff --git a/roles/cleanup_dss_minio/tasks/cleanup_minio.yml b/roles/cleanup_dss_minio/tasks/cleanup_minio.yml index b09832b8..400ffc35 100644 --- a/roles/cleanup_dss_minio/tasks/cleanup_minio.yml +++ b/roles/cleanup_dss_minio/tasks/cleanup_minio.yml @@ -1,24 +1,24 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" - name: Get all RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Set rocev2_alias_map var - set_fact: + ansible.builtin.set_fact: rocev2_alias_map: "{{ rocev2_alias_map | d([]) }} + [ { @@ -34,14 +34,14 @@ when: inventory_hostname in host_hostnames - name: Read local DSS conf - command: "cat {{ target_conf_dir }}/client_library_conf.json" + ansible.builtin.command: "cat {{ target_conf_dir }}/client_library_conf.json" register: local_dss_conf run_once: true delegate_to: "{{ host_hostnames[0] }}" changed_when: false - name: Set cluster_num_list var - set_fact: + ansible.builtin.set_fact: cluster_num_list: "{{ cluster_num_list | default([]) }} + [ {% for host in ansible_play_hosts %} @@ -52,14 +52,14 @@ run_once: true - name: Check subsystems are mounted - include_tasks: check_subsystems.yml + ansible.builtin.include_tasks: check_subsystems.yml loop: "{{ cluster_num_list | unique }}" loop_control: loop_var: current_cluster_num when: current_cluster_num | string == cluster_num | string - name: Cleanup MinIO - include_tasks: execute_cleanup_script.yml + ansible.builtin.include_tasks: execute_cleanup_script.yml loop: "{{ (local_dss_conf.stdout | from_json).clusters }}" loop_control: label: "{{ first_endpoint }}" diff --git a/roles/cleanup_dss_minio/tasks/execute_cleanup_script.yml b/roles/cleanup_dss_minio/tasks/execute_cleanup_script.yml index 6426ce31..7da2171d 100644 --- a/roles/cleanup_dss_minio/tasks/execute_cleanup_script.yml +++ b/roles/cleanup_dss_minio/tasks/execute_cleanup_script.yml @@ -30,7 +30,7 @@ --- - name: Get range of mountpoints - command: >- + ansible.builtin.command: >- grep -oP "mount_point\"\: \"/dev/nvme\K\d+" nkv_config_{{ rocev2_ip }}.json register: mountpoint_range args: @@ -38,12 +38,12 @@ changed_when: false - name: Set min_mountpoint and max_mountpoint vars - set_fact: + ansible.builtin.set_fact: min_mountpoint: "{{ mountpoint_range.stdout_lines[0] }}" max_mountpoint: "{{ mountpoint_range.stdout_lines[-1] }}" - name: Execute minio_cleanup.sh - command: "sh ./minio_cleanup.sh {{ min_mountpoint }} {{ max_mountpoint }} nkv_config_{{ rocev2_ip }}.json" + ansible.builtin.command: "sh ./minio_cleanup.sh {{ min_mountpoint }} {{ max_mountpoint }} nkv_config_{{ rocev2_ip }}.json" args: chdir: "{{ nkv_sdk_bin_dir }}" become: true diff --git a/roles/configure_coredumps/tasks/main.yml b/roles/configure_coredumps/tasks/main.yml index c7dede8f..0735b98b 100644 --- a/roles/configure_coredumps/tasks/main.yml +++ b/roles/configure_coredumps/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Install selinux deps - yum: + ansible.builtin.yum: name: python3-libselinux when: ansible_distribution_major_version == '8' become: true - name: Set unlimited core dump pam limit - pam_limits: + ansible.builtin.pam_limits: domain: '*' limit_type: '-' limit_item: core @@ -44,14 +44,14 @@ become: true - name: Create coredump compress dir - file: + ansible.builtin.file: path: "{{ target_conf_dir }}" state: directory mode: 0755 become: true - name: Create coredump compress file - copy: + ansible.builtin.copy: dest: "{{ target_conf_dir }}/compress_core.sh" content: | #!/bin/bash @@ -60,7 +60,7 @@ become: true - name: Set core_pattern in sysctl.d - sysctl: + ansible.builtin.sysctl: name: kernel.core_pattern value: "|{{ target_conf_dir }}/compress_core.sh %e %p" sysctl_set: true @@ -68,14 +68,14 @@ become: true - name: Set kernel.core_uses_pid in sysctl.d - sysctl: + ansible.builtin.sysctl: name: kernel.core_uses_pid value: '1' state: present become: true - name: Set fs.suid_dumpable in sysctl.d - sysctl: + ansible.builtin.sysctl: name: fs.suid_dumpable value: '2' state: present diff --git a/roles/configure_dcqcn/handlers/main.yml b/roles/configure_dcqcn/handlers/main.yml index 7958cff7..2460ef28 100644 --- a/roles/configure_dcqcn/handlers/main.yml +++ b/roles/configure_dcqcn/handlers/main.yml @@ -30,6 +30,6 @@ --- - name: Reboot system - dcqcn - reboot: + ansible.builtin.reboot: reboot_timeout: "{{ reboot_timeout }}" become: true diff --git a/roles/configure_dcqcn/tasks/configure_dcqcn.yml b/roles/configure_dcqcn/tasks/configure_dcqcn.yml index e206fef7..cc28ecb7 100644 --- a/roles/configure_dcqcn/tasks/configure_dcqcn.yml +++ b/roles/configure_dcqcn/tasks/configure_dcqcn.yml @@ -30,7 +30,7 @@ --- - name: Query mlxconfig - command: "mlxconfig -d {{ item.ibdev }} q" + ansible.builtin.command: "mlxconfig -d {{ item.ibdev }} q" changed_when: false register: mlxconfig loop: "{{ mellanox_devices_numa }}" @@ -39,7 +39,7 @@ become: true - name: Set ROCE_CC_PRIO_MASK_P1 - command: "mlxconfig -d {{ item.item.ibdev }} -y s ROCE_CC_PRIO_MASK_P1={{ dcqcn_roce_cc_prio_mask_p1 }}" + ansible.builtin.command: "mlxconfig -d {{ item.item.ibdev }} -y s ROCE_CC_PRIO_MASK_P1={{ dcqcn_roce_cc_prio_mask_p1 }}" loop: "{{ mlxconfig.results }}" loop_control: label: "{{ item.item.ibdev }}" @@ -52,7 +52,7 @@ become: true - name: Set CNP_DSCP_P1 - command: "mlxconfig -d {{ item.item.ibdev }} -y s CNP_DSCP_P1={{ dcqcn_cnp_dscp_p1 }}" + ansible.builtin.command: "mlxconfig -d {{ item.item.ibdev }} -y s CNP_DSCP_P1={{ dcqcn_cnp_dscp_p1 }}" loop: "{{ mlxconfig.results }}" loop_control: label: "{{ item.item.ibdev }}" @@ -65,20 +65,20 @@ become: true - name: Set CNP_802P_PRIO_P1 - command: "mlxconfig -d {{ item.item.ibdev }} -y s CNP_802P_PRIO_P1={{ dcqcn_cnp_802p_prio_p1 }}" + ansible.builtin.command: "mlxconfig -d {{ item.item.ibdev }} -y s CNP_802P_PRIO_P1={{ dcqcn_cnp_802p_prio_p1 }}" loop: "{{ mlxconfig.results }}" loop_control: label: "{{ item.item.ibdev }}" vars: mlx_re: 'CNP_802P_PRIO_P1 +([^ ]+)' - when: + when: - item.stdout is regex(mlx_re) - item.stdout | regex_search(mlx_re,'\\1') | first != dcqcn_cnp_802p_prio_p1 | string notify: Reboot system - dcqcn become: true - name: Set PCI_WR_ORDERING - command: "mlxconfig -d {{ item.item.ibdev }} -y s PCI_WR_ORDERING={{ dcqcn_pci_wr_ordering }}" + ansible.builtin.command: "mlxconfig -d {{ item.item.ibdev }} -y s PCI_WR_ORDERING={{ dcqcn_pci_wr_ordering }}" loop: "{{ mlxconfig.results }}" loop_control: label: "{{ item.item.ibdev }}" diff --git a/roles/configure_dcqcn/tasks/main.yml b/roles/configure_dcqcn/tasks/main.yml index a0487d3e..f5f86d29 100644 --- a/roles/configure_dcqcn/tasks/main.yml +++ b/roles/configure_dcqcn/tasks/main.yml @@ -30,24 +30,24 @@ --- - name: Check mlxconfig exists - command: which mlxconfig + ansible.builtin.command: which mlxconfig register: which_mlxconfig changed_when: false failed_when: false - name: Install Mellanox Tools - include_role: + ansible.builtin.include_role: name: deploy_mlnx_tools when: which_mlxconfig.rc != 0 - name: Get list of Mellanox ports - include_role: + ansible.builtin.include_role: name: get_mlnx_ports when: mellanox_ports is not defined - name: Configure DCQCN for each device - include_tasks: configure_dcqcn.yml + ansible.builtin.include_tasks: configure_dcqcn.yml when: ansible_virtualization_role != 'guest' - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers diff --git a/roles/configure_firewalld/tasks/main.yml b/roles/configure_firewalld/tasks/main.yml index 53d60ebc..32782f38 100644 --- a/roles/configure_firewalld/tasks/main.yml +++ b/roles/configure_firewalld/tasks/main.yml @@ -30,10 +30,10 @@ --- - name: Gather service facts - service_facts: + ansible.builtin.service_facts: - name: Firewall is stopped and disabled - service: + ansible.builtin.service: name: firewalld state: stopped enabled: false diff --git a/roles/configure_host_only_vlans/handlers/main.yml b/roles/configure_host_only_vlans/handlers/main.yml index 789f80b4..c5c847a6 100644 --- a/roles/configure_host_only_vlans/handlers/main.yml +++ b/roles/configure_host_only_vlans/handlers/main.yml @@ -30,10 +30,10 @@ --- - name: Restart network service - service: + ansible.builtin.service: name: "{{ network_service }}" state: restarted become: true - name: Reload facts - setup: + ansible.builtin.setup: diff --git a/roles/configure_host_only_vlans/tasks/main.yml b/roles/configure_host_only_vlans/tasks/main.yml index 0cd13317..9b77a099 100644 --- a/roles/configure_host_only_vlans/tasks/main.yml +++ b/roles/configure_host_only_vlans/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Assert valid rocev2_vlan_interfaces var - assert: + ansible.builtin.assert: that: - rocev2_vlan_interfaces is defined - rocev2_vlan_interfaces is not mapping @@ -39,7 +39,7 @@ msg: Cannot configure vlans. Check value of `rocev2_vlan_interfaces` var. - name: Assert RoCEv2 VLAN Interfaces are present on host - assert: + ansible.builtin.assert: that: matching_interfaces | length > 0 msg: "{{ item.interface }} is not a valid interface on this host. Please check `rocev2_vlan_interfaces` var" loop: "{{ rocev2_vlan_interfaces }}" @@ -48,7 +48,7 @@ matching_interfaces: "{{ all_interfaces | selectattr('device', 'equalto', item.interface ) | list }}" - name: Assert RoCEv2 VLAN IP addresses are defined - assert: + ansible.builtin.assert: that: rocev2_ip_list | length >= ansible_loop.index msg: "{{ item }} (index {{ ansible_loop.index0 }}) does not have a corresponding IP address defined. Check rocev2_ip_list var." loop: "{{ rocev2_vlan_interfaces }}" @@ -57,16 +57,16 @@ extended: true - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Find ifcfg files - find: + ansible.builtin.find: paths: /etc/sysconfig/network-scripts/ patterns: "ifcfg-*" register: ifcfg_files - name: Remove ifcfg files for adapters that do not exist - file: + ansible.builtin.file: path: "{{ item.path }}" state: absent loop: "{{ ifcfg_files.files }}" @@ -82,7 +82,7 @@ become: true - name: Configure parent adapters - template: + ansible.builtin.template: src: parent_ifcfg.j2 dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.interface }}" mode: 0644 @@ -93,7 +93,7 @@ become: true - name: Configure VLAN child adapters - template: + ansible.builtin.template: src: vlan_ifcfg.j2 dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.interface }}.{{ item.vlan_id }}" mode: 0644 @@ -112,7 +112,7 @@ become: true - name: Remove non-confirming VLAN configurations - file: + ansible.builtin.file: path: "/etc/sysconfig/network-scripts/ifcfg-{{ item }}" state: absent loop: "{{ ansible_interfaces }}" @@ -131,4 +131,4 @@ become: true - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers diff --git a/roles/configure_host_pfc/tasks/configure_pfc.yml b/roles/configure_host_pfc/tasks/configure_pfc.yml index d4b1b4e7..3a4bf2fc 100644 --- a/roles/configure_host_pfc/tasks/configure_pfc.yml +++ b/roles/configure_host_pfc/tasks/configure_pfc.yml @@ -30,7 +30,7 @@ --- - name: Query mlnx_qos - command: "mlnx_qos -i {{ item.netdev }}" + ansible.builtin.command: "mlnx_qos -i {{ item.netdev }}" register: mlnx_qos changed_when: false loop: "{{ mellanox_devices_numa }}" @@ -38,7 +38,7 @@ label: "{{ item.netdev }}" - name: Set mlnx_qos - command: "mlnx_qos -i {{ item.item.netdev }} -f {{ set_pfc_string }}" + ansible.builtin.command: "mlnx_qos -i {{ item.item.netdev }} -f {{ set_pfc_string }}" become: true loop: "{{ mlnx_qos.results }}" loop_control: diff --git a/roles/configure_host_pfc/tasks/main.yml b/roles/configure_host_pfc/tasks/main.yml index f5a835a3..2c5a2be2 100644 --- a/roles/configure_host_pfc/tasks/main.yml +++ b/roles/configure_host_pfc/tasks/main.yml @@ -30,21 +30,21 @@ --- - name: Check mlnx_qos exists - command: which mlnx_qos + ansible.builtin.command: which mlnx_qos register: which_mlnx_qos changed_when: false failed_when: false - name: Install Mellanox Tools - include_role: + ansible.builtin.include_role: name: deploy_mlnx_tools when: which_mlnx_qos.rc != 0 - name: Get list of Mellanox ports - include_role: + ansible.builtin.include_role: name: get_mlnx_ports when: mellanox_ports is not defined - name: Configure host PFC - include_tasks: configure_pfc.yml + ansible.builtin.include_tasks: configure_pfc.yml when: ansible_virtualization_role != 'guest' diff --git a/roles/configure_host_vlans/handlers/main.yml b/roles/configure_host_vlans/handlers/main.yml index 789f80b4..c5c847a6 100644 --- a/roles/configure_host_vlans/handlers/main.yml +++ b/roles/configure_host_vlans/handlers/main.yml @@ -30,10 +30,10 @@ --- - name: Restart network service - service: + ansible.builtin.service: name: "{{ network_service }}" state: restarted become: true - name: Reload facts - setup: + ansible.builtin.setup: diff --git a/roles/configure_host_vlans/tasks/main.yml b/roles/configure_host_vlans/tasks/main.yml index 7d9a4437..bd5bb909 100644 --- a/roles/configure_host_vlans/tasks/main.yml +++ b/roles/configure_host_vlans/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Assert VLAN lists are defined - assert: + ansible.builtin.assert: that: - tcp_vlan_id_list is defined - rocev2_vlan_id_list is defined @@ -38,21 +38,21 @@ fail_msg: "{{ inventory_hostname }} needs 'tcp_vlan_id_list' and 'rocev2_vlan_id_list' variables defined" - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Get VLAN map - include_role: + ansible.builtin.include_role: name: get_vlan_map when: interface_switch_vlan_map is not defined - name: Find ifcfg files - find: + ansible.builtin.find: paths: /etc/sysconfig/network-scripts/ patterns: "ifcfg-*" register: ifcfg_files - name: Remove ifcfg files for adapters that do not exist - file: + ansible.builtin.file: path: "{{ item.path }}" state: absent loop: "{{ ifcfg_files.files }}" @@ -68,7 +68,7 @@ become: true - name: Configure parent adapters - template: + ansible.builtin.template: src: parent_ifcfg.j2 dest: "/etc/sysconfig/network-scripts/ifcfg-{{ device.local_interface }}" mode: 0644 @@ -82,11 +82,11 @@ become: true - name: Get last octet of IP addresses for high-speed interfaces - include_role: + ansible.builtin.include_role: name: get_last_octet - name: Configure ConnectX adapters - template: + ansible.builtin.template: src: vlan_ifcfg.j2 dest: "/etc/sysconfig/network-scripts/ifcfg-{{ device }}.{{ vlan.id }}" mode: 0644 @@ -105,7 +105,7 @@ become: true - name: Remove non-conforming VLAN configurations - file: + ansible.builtin.file: path: "/etc/sysconfig/network-scripts/ifcfg-{{ item }}" state: absent loop: "{{ ansible_interfaces }}" @@ -124,4 +124,4 @@ become: true - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers diff --git a/roles/configure_inbox_infiniband/tasks/main.yml b/roles/configure_inbox_infiniband/tasks/main.yml index b7dcb091..4b8acec7 100644 --- a/roles/configure_inbox_infiniband/tasks/main.yml +++ b/roles/configure_inbox_infiniband/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Check OFED version - command: ofed_info -n + ansible.builtin.command: ofed_info -n failed_when: false changed_when: false register: ofed_version - name: Assert OFED not installed - assert: + ansible.builtin.assert: that: ofed_version.rc != 0 msg: | Mellanox OFED is presently installed on this host. @@ -45,17 +45,17 @@ ofed_uninstall.sh --force - name: Install Infiniband - include_tasks: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_tasks: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Start and enable RDMA service - service: + ansible.builtin.service: name: rdma enabled: true state: started become: true - name: Copy show_gids script - copy: + ansible.builtin.copy: src: show_gids.sh dest: /usr/local/bin/show_gids mode: 0755 diff --git a/roles/configure_inbox_infiniband/tasks/redhat_7.yml b/roles/configure_inbox_infiniband/tasks/redhat_7.yml index 088c921f..b7777e38 100644 --- a/roles/configure_inbox_infiniband/tasks/redhat_7.yml +++ b/roles/configure_inbox_infiniband/tasks/redhat_7.yml @@ -30,7 +30,7 @@ --- - name: Install Infiniband - yum: + ansible.builtin.yum: name: '@Infiniband Support' state: present become: true diff --git a/roles/configure_inbox_infiniband/tasks/redhat_8.yml b/roles/configure_inbox_infiniband/tasks/redhat_8.yml index 6667a716..58d612e0 100644 --- a/roles/configure_inbox_infiniband/tasks/redhat_8.yml +++ b/roles/configure_inbox_infiniband/tasks/redhat_8.yml @@ -31,7 +31,7 @@ # Install CentOS 7 RPMs on CentOS Stream 8 - temporary work-around - name: Install Infiniband - yum: + ansible.builtin.yum: name: "{{ infiniband_rpm_urls }}" state: present disable_gpg_check: true diff --git a/roles/configure_irq/tasks/main.yml b/roles/configure_irq/tasks/main.yml index 4c9683b2..721f22e4 100644 --- a/roles/configure_irq/tasks/main.yml +++ b/roles/configure_irq/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Start and enable irqbalance service - service: + ansible.builtin.service: name: irqbalance state: started enabled: true diff --git a/roles/configure_lldpd/tasks/main.yml b/roles/configure_lldpd/tasks/main.yml index b64526b5..dbc6dc35 100644 --- a/roles/configure_lldpd/tasks/main.yml +++ b/roles/configure_lldpd/tasks/main.yml @@ -30,17 +30,17 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Remove lldpad if installed - yum: + ansible.builtin.yum: name: lldpad state: absent become: true - name: Install lldpd and net-snmp - yum: + ansible.builtin.yum: name: - lldpd - net-snmp @@ -48,7 +48,7 @@ become: true - name: Start and enable lldpd and snmpd services - service: + ansible.builtin.service: name: "{{ item }}" state: started enabled: true diff --git a/roles/configure_mc_alias/tasks/assign_endpoint.yml b/roles/configure_mc_alias/tasks/assign_endpoint.yml index bf921bbc..2ba444c1 100644 --- a/roles/configure_mc_alias/tasks/assign_endpoint.yml +++ b/roles/configure_mc_alias/tasks/assign_endpoint.yml @@ -1,19 +1,19 @@ --- - name: Reset assigned_endpoints if all endpoints used or if no more reachable endpoints - set_fact: + ansible.builtin.set_fact: assigned_endpoints: [] when: | combined_endpoints | length == assigned_endpoints | length or ping_endpoints.results | selectattr('rc', 'equalto', 0) | map(attribute='endpoint.alias') | difference(assigned_endpoints) == [] - name: Assert at least one endpoint is reachable - assert: + ansible.builtin.assert: that: ping_endpoints.results | selectattr('rc', 'equalto', 0) | map(attribute='endpoint.alias') | difference(assigned_endpoints) != [] msg: No endpoints are reachable. Ensure clients are able to reach (ping) server TCP endpoints - name: Assign endpoint - set_fact: + ansible.builtin.set_fact: endpoint_map: "{{ endpoint_map }} + [ { diff --git a/roles/configure_mc_alias/tasks/main.yml b/roles/configure_mc_alias/tasks/main.yml index 46f39979..94eff16f 100644 --- a/roles/configure_mc_alias/tasks/main.yml +++ b/roles/configure_mc_alias/tasks/main.yml @@ -30,21 +30,21 @@ --- - name: Set combined_endpoints var - set_fact: + ansible.builtin.set_fact: combined_endpoints: "{{ combined_endpoints | d([]) }} + - {% for tcp in hostvars[server].tcp_alias_list %} - [ - {{ tcp }}{% if not loop.last %},{% endif %} - ]{% if not loop.last %} +{% endif %} - {% endfor %} - " + {% for tcp in hostvars[server].tcp_alias_list %} + [ + {{ tcp }}{% if not loop.last %},{% endif %} + ]{% if not loop.last %} +{% endif %} + {% endfor %} + " loop: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" loop_control: loop_var: server run_once: true - name: Ping all endpoints - command: "ping -{{ family }} -c 1 {{ alias }}" + ansible.builtin.command: "ping -{{ family }} -c 1 {{ alias }}" loop: "{{ combined_endpoints }}" loop_control: loop_var: endpoint @@ -58,28 +58,28 @@ register: ping_endpoints - name: Initialize endpoint vars - set_fact: + ansible.builtin.set_fact: assigned_endpoints: [] endpoint_map: [] - name: Assign endpoint to each client - include_tasks: assign_endpoint.yml + ansible.builtin.include_tasks: assign_endpoint.yml loop: "{{ ansible_play_hosts }}" loop_control: loop_var: client_host - name: Set minio ip - set_fact: + ansible.builtin.set_fact: minio_endpoint: "http://{{ (endpoint_map | selectattr('client', 'equalto', inventory_hostname) | first).endpoint }}:{{ minio_port }}" - name: List local hosts with mc - shell: "{{ minio_dir }}/mc config host list {{ minio_mc_alias }} --json | sed -n '/^{/,$p'" + ansible.builtin.shell: "{{ minio_dir }}/mc config host list {{ minio_mc_alias }} --json | sed -n '/^{/,$p'" register: mc_host_list failed_when: false changed_when: false - name: Set Client Minio mc configuration - command: "{{ minio_dir }}/mc config host add {{ minio_mc_alias }} {{ minio_endpoint }} {{ minio_access_key }} {{ minio_secret_key }}" + ansible.builtin.command: "{{ minio_dir }}/mc config host add {{ minio_mc_alias }} {{ minio_endpoint }} {{ minio_access_key }} {{ minio_secret_key }}" when: > ((mc_host_list.stdout | from_json).status | default('') == 'error') or ((mc_host_list.stdout | from_json).URL | default('') != minio_endpoint) diff --git a/roles/configure_ntp/tasks/main.yml b/roles/configure_ntp/tasks/main.yml index 0e976277..b43868dd 100644 --- a/roles/configure_ntp/tasks/main.yml +++ b/roles/configure_ntp/tasks/main.yml @@ -30,27 +30,27 @@ --- - name: Install NTP packages - yum: + ansible.builtin.yum: name: - chrony - tzdata become: true - name: Set timezone - timezone: + ansible.builtin.timezone: name: "{{ ntp_timezone }}" become: true -- name: chronyd is started and enabled - service: +- name: Start and enable chronyd + ansible.builtin.service: name: chronyd state: started enabled: true become: true when: ntp_enabled -- name: chronyd is stopped and disabled - service: +- name: Stop and disable chronyd + ansible.builtin.service: name: chronyd state: stopped enabled: false diff --git a/roles/configure_onyx_vlans/tasks/main.yml b/roles/configure_onyx_vlans/tasks/main.yml index 1e820987..db49c256 100644 --- a/roles/configure_onyx_vlans/tasks/main.yml +++ b/roles/configure_onyx_vlans/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Find a host that has a defined combined_interface_switch_vlan_map - set_fact: + ansible.builtin.set_fact: combined_interface_switch_vlan_map: "{{ hostvars[host]['combined_interface_switch_vlan_map'] }}" loop: "{{ (groups['clients'] | d([]) + groups['servers'] | d([]) + groups['targets'] | d([]) + groups['hosts'] | d([])) | unique }}" loop_control: @@ -40,28 +40,28 @@ - combined_interface_switch_vlan_map is not defined - name: Assert combined_interface_switch_vlan_map is defined - assert: + ansible.builtin.assert: that: combined_interface_switch_vlan_map is defined fail_msg: Unable to obtain a list of MAC addresses from hosts. Check for playbook failures. quiet: true - name: Enable PFC - onyx_config: + ansible.builtin.onyx_config: lines: - dcb priority-flow-control enable force - name: Set pfc_prio_list - set_fact: + ansible.builtin.set_fact: pfc_prio_list: "{% for vlan in (rocev2_vlans + tcp_vlans) | map(attribute='id') | list %}[ {{ (vlan | string)[0] }} ] + {% endfor %}[ 0 ]" - name: Set PFC priorities - onyx_config: + ansible.builtin.onyx_config: lines: - "dcb priority-flow-control priority {{ item }} enable" loop: "{{ pfc_prio_list | unique }}" - name: Configure TCP VLANs - onyx_vlan: + ansible.builtin.onyx_vlan: vlan_id: "{{ item.id }}" name: "TCP_vlan{{ item.id }}" loop: "{{ tcp_vlans }}" @@ -69,7 +69,7 @@ label: "{{ item.id }}" - name: Configure RoCEv2 VLANs - onyx_vlan: + ansible.builtin.onyx_vlan: vlan_id: "{{ item.id }}" name: "RoCE_vlan{{ item.id }}" loop: "{{ rocev2_vlans }}" @@ -77,7 +77,7 @@ label: "{{ item.id }}" - name: Configure interfaces - onyx_config: + ansible.builtin.onyx_config: lines: - "interface ethernet {{ link.switch_port }} switchport mode hybrid" - "interface ethernet {{ link.switch_port }} switchport hybrid allowed-vlan add {{ link.vlan_id }}" @@ -91,7 +91,7 @@ when: link.switch_name == inventory_hostname - name: Enable PFC - onyx_pfc_interface: + ansible.builtin.onyx_pfc_interface: name: "Eth{{ link.switch_port }}" state: enabled loop: "{{ combined_interface_switch_vlan_map }}" @@ -101,7 +101,7 @@ when: link.switch_name == inventory_hostname - name: Configure MTU - onyx_interface: + ansible.builtin.onyx_interface: name: "Eth{{ link.switch_port }}" mtu: "{{ mtu_size }}" loop: "{{ combined_interface_switch_vlan_map }}" diff --git a/roles/configure_server_mc_alias/tasks/configure_server_mc_alias.yml b/roles/configure_server_mc_alias/tasks/configure_server_mc_alias.yml index 26af1b37..5ccbc57a 100644 --- a/roles/configure_server_mc_alias/tasks/configure_server_mc_alias.yml +++ b/roles/configure_server_mc_alias/tasks/configure_server_mc_alias.yml @@ -30,17 +30,17 @@ --- - name: Stat DSS Minio path - stat: + ansible.builtin.stat: path: "{{ minio_dir }}" register: mc_alias_path - name: Assert DSS Minio path exists - assert: + ansible.builtin.assert: that: mc_alias_path.stat.exists fail_msg: DSS Minio is not installed. Execute 'deploy_dss_software.yml' playbook first. - name: List local hosts with mc - command: "{{ minio_dir }}/mc config host list {{ local_mc_alias }}" + ansible.builtin.command: "{{ minio_dir }}/mc config host list {{ local_mc_alias }}" loop: "{{ range(0, tcp_alias_list | length) | list }}" loop_control: label: "{{ tcp_alias }}" @@ -53,7 +53,7 @@ changed_when: false - name: Set local hosts with mc - command: > + ansible.builtin.command: > {{ minio_dir }}/mc config host add {{ local_mc_alias }} http://{{ tcp_alias }}:{{ minio_port }} {{ minio_access_key }} {{ minio_secret_key }} diff --git a/roles/configure_server_mc_alias/tasks/main.yml b/roles/configure_server_mc_alias/tasks/main.yml index 5ebceee2..879ec3fe 100644 --- a/roles/configure_server_mc_alias/tasks/main.yml +++ b/roles/configure_server_mc_alias/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Configure server mc aliases - include_tasks: configure_server_mc_alias.yml + ansible.builtin.include_tasks: configure_server_mc_alias.yml when: not no_minio | d(false) diff --git a/roles/configure_sysctl/tasks/main.yml b/roles/configure_sysctl/tasks/main.yml index f6de44fb..3858357c 100644 --- a/roles/configure_sysctl/tasks/main.yml +++ b/roles/configure_sysctl/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Configure sysctl.conf entries - sysctl: + ansible.builtin.sysctl: name: "{{ item.name }}" value: "{{ item.value }}" state: "{{ item.state }}" diff --git a/roles/configure_tcp_aliases/tasks/configure_tcp_aliases.yml b/roles/configure_tcp_aliases/tasks/configure_tcp_aliases.yml index 52a9022f..28818566 100644 --- a/roles/configure_tcp_aliases/tasks/configure_tcp_aliases.yml +++ b/roles/configure_tcp_aliases/tasks/configure_tcp_aliases.yml @@ -30,7 +30,7 @@ --- - name: Initialize vars - set_fact: + ansible.builtin.set_fact: tcp_adapter_list: [] tcp_adapter_parent_list: [] tcp_adapter_numa_list: [] @@ -39,13 +39,13 @@ hostnames_list: [] - name: Query IPs from tcp_ip_list - shell: "getent ahosts {{ item }} | awk '{ print $1 }' | grep -v '^::1' | head -n 1" + ansible.builtin.shell: "getent ahosts {{ item }} | awk '{ print $1 }' | grep -v '^::1' | head -n 1" loop: "{{ tcp_ip_list }}" changed_when: false register: getent - name: Assert tcp_ip_list contains routable hostnames or IPs - assert: + ansible.builtin.assert: that: "{{ item.stdout | ipaddr != false }}" msg: "{{ item.item }} is not routable on this host" quiet: true @@ -54,7 +54,7 @@ label: "{{ item.item }}" - name: Assert no duplicate IPs on each host - assert: + ansible.builtin.assert: that: ip_list == unique_ip_list msg: "Duplicate IPs found on host: {{ ip_list }}" vars: @@ -62,7 +62,7 @@ unique_ip_list: "{{ ip_list | unique }}" - name: Set tcp_adapter_list var - set_fact: + ansible.builtin.set_fact: tcp_adapter_list: "{{ tcp_adapter_list | d([]) }} + [ {% for interface in ansible_interfaces %} @@ -86,12 +86,12 @@ inventory_name: "{{ item.item }}" - name: Assert TCP IPs are found - assert: + ansible.builtin.assert: that: tcp_adapter_list | length > 0 msg: No TCP IPs configured on host. Configure `tcp_ip_list` var for host or configure VLANs. See README.md for details. - name: Set combined_family_list var - set_fact: + ansible.builtin.set_fact: combined_family_list: "{{ combined_family_list | d([]) + hostvars[hostname].tcp_adapter_list | map(attribute='family') | list }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -99,7 +99,7 @@ run_once: true - name: Assert all TCP IP's are same family - assert: + ansible.builtin.assert: that: combined_family_list | unique | length == 1 msg: | tcp_ip_list must contain IPs or hostnames of the same family (IPV6 or IPV4) across all hosts in inventory. @@ -107,7 +107,7 @@ {{ tcp_adapter_list | to_nice_json }} - name: Assert IP addresses found on host - assert: + ansible.builtin.assert: that: item.stdout in tcp_adapter_list | map(attribute='tcp_ip') | list msg: "{{ item.item }} is not assigned to any adapter. Check 'tcp_ip_list' setting." quiet: true @@ -116,7 +116,7 @@ label: "{{ item.item }}" - name: Get parent adapters - shell: "echo $(basename $(readlink /sys/class/net/{{ item.interface }}/lower_* || echo '{{ item.interface }}'))" + ansible.builtin.shell: "echo $(basename $(readlink /sys/class/net/{{ item.interface }}/lower_* || echo '{{ item.interface }}'))" loop: "{{ tcp_adapter_list }}" loop_control: label: "{{ item.interface }}" @@ -124,7 +124,7 @@ register: parent_adapters - name: Set tcp_adapter_parent_list var - set_fact: + ansible.builtin.set_fact: tcp_adapter_parent_list: "{{ tcp_adapter_parent_list | default([]) }} + [ { @@ -140,7 +140,7 @@ label: "{{ item.item.tcp_ip }}" - name: Get NUMA for each adapter - command: "cat /sys/class/net/{{ item.parent_interface }}/device/numa_node" + ansible.builtin.command: "cat /sys/class/net/{{ item.parent_interface }}/device/numa_node" changed_when: false loop: "{{ tcp_adapter_parent_list }}" loop_control: @@ -148,7 +148,7 @@ register: numa_node_list - name: Set tcp_adapter_numa_list var - set_fact: + ansible.builtin.set_fact: tcp_adapter_numa_list: "{{ tcp_adapter_numa_list | default([]) }} + [ { @@ -165,11 +165,11 @@ label: "{{ item.item.tcp_ip }}" - name: Sort tcp_adapter_numa_list by numa - set_fact: + ansible.builtin.set_fact: tcp_adapter_numa_list: "{{ tcp_adapter_numa_list | sort(attribute='numa') }}" -- name: set tcp_alias_list var - set_fact: +- name: Set tcp_alias_list var + ansible.builtin.set_fact: tcp_alias_list: "{{ tcp_alias_list | default([]) }} + [ { @@ -193,7 +193,7 @@ extended: true - name: Set hostnames_list var for servers - set_fact: + ansible.builtin.set_fact: hostnames_list: "{{ (hostnames_list | d([]) + groups[item] | d([])) | unique }}" loop: - servers @@ -206,7 +206,7 @@ # inventory_hostname in groups['ufm_hosts'] | d([]) - name: Set hostnames_list var for clients - set_fact: + ansible.builtin.set_fact: hostnames_list: "{{ (hostnames_list | d([]) + groups[item] | d([])) | unique }}" loop: - servers @@ -215,7 +215,7 @@ when: inventory_hostname in groups['clients'] | d([]) - name: Set non_resolvable_aliases var - set_fact: + ansible.builtin.set_fact: needs_aliases: >- {%- set needs_alias = { 'value': false } -%} {%- for host in hostnames_list -%} @@ -229,7 +229,7 @@ run_once: true - name: Set hostname aliases in /etc/hosts - blockinfile: + ansible.builtin.blockinfile: path: /etc/hosts marker: "# {mark} ANSIBLE MANAGED BLOCK - TCP ALIASES FOR DSS" block: | @@ -244,7 +244,7 @@ become: true - name: Clear hostname aliases in /etc/hosts if aliases not needed - blockinfile: + ansible.builtin.blockinfile: path: /etc/hosts marker: "# {mark} ANSIBLE MANAGED BLOCK - TCP ALIASES FOR DSS" block: '' diff --git a/roles/configure_tcp_aliases/tasks/main.yml b/roles/configure_tcp_aliases/tasks/main.yml index 6f70b0c9..4410a153 100644 --- a/roles/configure_tcp_aliases/tasks/main.yml +++ b/roles/configure_tcp_aliases/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Configure aliases if not already set - include_tasks: configure_tcp_aliases.yml + ansible.builtin.include_tasks: configure_tcp_aliases.yml when: tcp_alias_list is not defined diff --git a/roles/configure_tuned/tasks/main.yml b/roles/configure_tuned/tasks/main.yml index 42bb57ff..c4097ab2 100644 --- a/roles/configure_tuned/tasks/main.yml +++ b/roles/configure_tuned/tasks/main.yml @@ -30,30 +30,30 @@ --- - name: Install tuned - yum: + ansible.builtin.yum: name: tuned become: true - name: Start and enable tuned service - service: + ansible.builtin.service: name: tuned state: started enabled: true become: true - name: Check tuned active profile - command: tuned-adm active + ansible.builtin.command: tuned-adm active changed_when: false failed_when: false register: tuned_active become: true - name: Set tuned off - command: tuned-adm off + ansible.builtin.command: tuned-adm off when: tuned_profile not in tuned_active.stdout become: true - name: Set tuned profile - command: "tuned-adm profile {{ tuned_profile }}" + ansible.builtin.command: "tuned-adm profile {{ tuned_profile }}" when: tuned_profile not in tuned_active.stdout become: true diff --git a/roles/create_client_library_conf/tasks/collect_cluster_mountpoints.yml b/roles/create_client_library_conf/tasks/collect_cluster_mountpoints.yml index 84f2cd3c..8db5f6f3 100644 --- a/roles/create_client_library_conf/tasks/collect_cluster_mountpoints.yml +++ b/roles/create_client_library_conf/tasks/collect_cluster_mountpoints.yml @@ -30,11 +30,11 @@ --- - name: Get Mountpoints - include_role: + ansible.builtin.include_role: name: get_mountpoints - name: Append mountpoints to cluster_mountpoints - set_fact: + ansible.builtin.set_fact: cluster_mountpoints: "{{ cluster_mountpoints }} + [ { diff --git a/roles/create_client_library_conf/tasks/create_client_library_conf.yml b/roles/create_client_library_conf/tasks/create_client_library_conf.yml index 2aed1132..9db46281 100644 --- a/roles/create_client_library_conf/tasks/create_client_library_conf.yml +++ b/roles/create_client_library_conf/tasks/create_client_library_conf.yml @@ -30,25 +30,25 @@ --- - name: Set target/host group vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" cluster_num_list: [] - name: Stat DSS Minio path - stat: + ansible.builtin.stat: path: "{{ minio_dir }}" register: dss_minio_path when: inventory_hostname in host_hostnames - name: Assert DSS Minio path exists - assert: + ansible.builtin.assert: that: dss_minio_path.stat.exists fail_msg: DSS Minio is not installed. Execute 'deploy_dss_software.yml' playbook first. when: inventory_hostname in host_hostnames - name: Create conf dir - file: + ansible.builtin.file: path: "{{ target_conf_dir }}" state: directory mode: 0755 @@ -56,14 +56,14 @@ become: true - name: Check minio config - command: "{{ minio_dir }}/mc config host list" + ansible.builtin.command: "{{ minio_dir }}/mc config host list" changed_when: false failed_when: false register: mc_config_check when: inventory_hostname in host_hostnames - name: Assert minio config compatible - assert: + ansible.builtin.assert: that: fail_string not in mc_config_check.stderr msg: | Unable to load mc config. @@ -76,7 +76,7 @@ when: inventory_hostname in host_hostnames - name: Check minio connection - command: "{{ minio_dir }}/mc ls {{ local_mc_alias }}" + ansible.builtin.command: "{{ minio_dir }}/mc ls {{ local_mc_alias }}" loop: "{{ range(0, tcp_alias_list | length) | list }}" loop_control: label: "{{ tcp_alias }}" @@ -88,7 +88,7 @@ when: inventory_hostname in host_hostnames - name: Set cluster_num_list var - set_fact: + ansible.builtin.set_fact: cluster_num_list: "{{ cluster_num_list }} + [ {% for host in ansible_play_hosts %} @@ -98,35 +98,35 @@ run_once: true - name: Get all RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Initialize cluster_mountpoints var - set_fact: + ansible.builtin.set_fact: cluster_mountpoints: [] - name: Collect mountpoints for each cluster - include_tasks: collect_cluster_mountpoints.yml + ansible.builtin.include_tasks: collect_cluster_mountpoints.yml loop: "{{ cluster_num_list | unique }}" loop_control: loop_var: current_cluster_num when: current_cluster_num | string == cluster_num | string - name: Initialize vars for cluster map - set_fact: + ansible.builtin.set_fact: clusters: [] cluster_index: 0 - name: Set clusters array - include_tasks: set_clusters.yml + ansible.builtin.include_tasks: set_clusters.yml loop: "{{ range(0, cluster_mountpoints | length) | list }}" loop_control: loop_var: current_cluster_count @@ -136,7 +136,7 @@ when: current_cluster.cluster_num | string == cluster_num | string - name: Set client library json data Gen1 - set_fact: + ansible.builtin.set_fact: client_library_json: version: 0.1 init_time: "{{ client_library_init_time }}" @@ -144,7 +144,7 @@ when: not gen2 | bool - name: Set client library json data Gen2 - set_fact: + ansible.builtin.set_fact: client_library_json: version: 0.1 init_time: "{{ client_library_init_time }}" @@ -153,7 +153,7 @@ when: gen2 | bool - name: Create client library conf.json - copy: + ansible.builtin.copy: dest: "{{ target_conf_dir }}/client_library_conf.json" content: | {{ client_library_json | to_nice_json(sort_keys=False) }} @@ -162,7 +162,7 @@ become: true - name: Read DSS conf - command: "{{ minio_dir }}/mc cat {{ local_mc_alias }}/{{ dss_bucket_name }}/conf.json" + ansible.builtin.command: "{{ minio_dir }}/mc cat {{ local_mc_alias }}/{{ dss_bucket_name }}/conf.json" loop: "{{ range(0, tcp_alias_list | length) | list }}" loop_control: label: "{{ tcp_alias }}" @@ -176,13 +176,13 @@ when: inventory_hostname in host_hostnames - name: Read local DSS conf - command: "cat {{ target_conf_dir }}/client_library_conf.json" + ansible.builtin.command: "cat {{ target_conf_dir }}/client_library_conf.json" register: local_dss_conf changed_when: false when: inventory_hostname in host_hostnames - name: Set subsystem_endpoints var - set_fact: + ansible.builtin.set_fact: subsystem_endpoints: "{{ subsystem_endpoints | default([]) + [ item.endpoints[0].ipv4 ] }}" loop: "{{ (local_dss_conf.stdout | from_json).clusters }}" loop_control: @@ -190,7 +190,7 @@ when: inventory_hostname in host_hostnames - name: Check DSS bucket - command: "{{ minio_dir }}/mc ls {{ local_mc_alias }}/{{ dss_bucket_name }}" + ansible.builtin.command: "{{ minio_dir }}/mc ls {{ local_mc_alias }}/{{ dss_bucket_name }}" loop: "{{ range(0, tcp_alias_list | length) | list }}" loop_control: label: "{{ tcp_alias }}" @@ -204,7 +204,7 @@ when: inventory_hostname in host_hostnames - name: Create DSS bucket - command: "{{ minio_dir }}/mc mb {{ local_mc_alias }}/{{ dss_bucket_name }}" + ansible.builtin.command: "{{ minio_dir }}/mc mb {{ local_mc_alias }}/{{ dss_bucket_name }}" loop: "{{ range(0, check_dss_bucket.results | length) | list }}" loop_control: label: "{{ tcp_alias }}" @@ -218,7 +218,7 @@ - tcp_alias in subsystem_endpoints - name: Write remote DSS conf - command: "{{ minio_dir }}/mc cp {{ target_conf_dir }}/client_library_conf.json {{ local_mc_alias }}/{{ dss_bucket_name }}/conf.json" + ansible.builtin.command: "{{ minio_dir }}/mc cp {{ target_conf_dir }}/client_library_conf.json {{ local_mc_alias }}/{{ dss_bucket_name }}/conf.json" loop: "{{ range(0, read_dss_conf.results | length) | list }}" loop_control: label: "{{ tcp_alias }}" diff --git a/roles/create_client_library_conf/tasks/main.yml b/roles/create_client_library_conf/tasks/main.yml index a2799a49..147af40d 100644 --- a/roles/create_client_library_conf/tasks/main.yml +++ b/roles/create_client_library_conf/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Create Client Library Config file - include_tasks: create_client_library_conf.yml + ansible.builtin.include_tasks: create_client_library_conf.yml when: not no_minio | d(false) diff --git a/roles/create_client_library_conf/tasks/set_clusters.yml b/roles/create_client_library_conf/tasks/set_clusters.yml index 072c68b4..5e40fb29 100644 --- a/roles/create_client_library_conf/tasks/set_clusters.yml +++ b/roles/create_client_library_conf/tasks/set_clusters.yml @@ -1,11 +1,11 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: included_hosts: [] - name: Set included_hosts var - set_fact: + ansible.builtin.set_fact: included_hosts: "{{ included_hosts | default([]) + [ host ] }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -16,7 +16,7 @@ run_once: true - name: Set endpoints for each min_subsystem_list - include_tasks: set_endpoints.yml + ansible.builtin.include_tasks: set_endpoints.yml loop: "{{ current_cluster.min_subsystem_list | unique }}" loop_control: loop_var: unique_subsystem diff --git a/roles/create_client_library_conf/tasks/set_endpoints.yml b/roles/create_client_library_conf/tasks/set_endpoints.yml index f9448d7e..44429b85 100644 --- a/roles/create_client_library_conf/tasks/set_endpoints.yml +++ b/roles/create_client_library_conf/tasks/set_endpoints.yml @@ -1,13 +1,13 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: endpoints: [] combined_endpoints: [] combined_rdd_endpoints: [] - name: Set endpoints var - set_fact: + ansible.builtin.set_fact: endpoints: "{{ endpoints | d([]) }} + [ { @@ -29,7 +29,7 @@ when: current_cluster.min_subsystem_list[vlan] == unique_subsystem - name: Set combined_endpoints var - set_fact: + ansible.builtin.set_fact: combined_endpoints: "{{ combined_endpoints + hostvars[host].endpoints }}" combined_rdd_endpoints: "{{ combined_rdd_endpoints + hostvars[host].rdd_endpoints }}" loop: "{{ included_hosts }}" @@ -39,7 +39,7 @@ run_once: true - name: Set clusters var and increment cluster_index - set_fact: + ansible.builtin.set_fact: clusters: "{{ clusters }} + [ { diff --git a/roles/create_datamover_conf/tasks/main.yml b/roles/create_datamover_conf/tasks/main.yml index 76d2df1f..f82b390f 100644 --- a/roles/create_datamover_conf/tasks/main.yml +++ b/roles/create_datamover_conf/tasks/main.yml @@ -30,18 +30,18 @@ --- - name: Create datamover conf dir - file: + ansible.builtin.file: path: "{{ datamover_conf_dir }}" state: directory mode: 0755 become: true - name: Get MinIO Hostnames - include_role: + ansible.builtin.include_role: name: get_minio_hostnames - name: Set datamover conf template - template: + ansible.builtin.template: src: config.json.j2 dest: "{{ datamover_conf_dir }}/config.json" mode: 0644 diff --git a/roles/deploy_aws_sdk_cpp/tasks/main.yml b/roles/deploy_aws_sdk_cpp/tasks/main.yml index b4a4d594..51b323a6 100644 --- a/roles/deploy_aws_sdk_cpp/tasks/main.yml +++ b/roles/deploy_aws_sdk_cpp/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Identify aws-sdk-cpp RPM - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'aws-sdk-cpp*.rpm' delegate_to: localhost @@ -38,17 +38,17 @@ register: aws_sdk_cpp_rpm - name: Assert aws-sdk-cpp RPM found - assert: + ansible.builtin.assert: that: aws_sdk_cpp_rpm.files | length > 0 fail_msg: "No aws_sdk_cpp RPM found. Please download RPM to {{ artifacts_dir }}" - name: Identify newest version of aws-sdk-cpp RPM found - set_fact: + ansible.builtin.set_fact: aws_sdk_cpp_rpm_file: "{{ (aws_sdk_cpp_rpm.files | sort(attribute='mtime', reverse=true) | first).path }}" run_once: true - name: Check if aws-sdk-cpp RPM is installed - shell: "rpm -qa | grep {{ aws_sdk_cpp_rpm_file | basename | splitext | first }}" + ansible.builtin.shell: "rpm -qa | grep {{ aws_sdk_cpp_rpm_file | basename | splitext | first }}" args: warn: false register: aws_sdk_cpp_rpm_qa @@ -56,20 +56,20 @@ failed_when: false - name: Copy aws-sdk-cpp RPM to staging directory - copy: + ansible.builtin.copy: src: "{{ aws_sdk_cpp_rpm_file }}" dest: "{{ deploy_aws_sdk_cpp_staging_dir }}" mode: 0644 when: aws_sdk_cpp_rpm_qa.rc != 0 - name: Install aws-sdk-cpp RPM - yum: + ansible.builtin.yum: name: "{{ deploy_aws_sdk_cpp_staging_dir }}/{{ aws_sdk_cpp_rpm_file | basename }}" disable_gpg_check: true become: true when: aws_sdk_cpp_rpm_qa.rc != 0 - name: Delete aws-sdk-cpp RPM from staging directory - file: + ansible.builtin.file: path: "{{ deploy_aws_sdk_cpp_staging_dir }}/{{ aws_sdk_cpp_rpm_file | basename }}" state: absent diff --git a/roles/deploy_client_library/handlers/main.yml b/roles/deploy_client_library/handlers/main.yml index 3ae58f55..ed98f7fc 100644 --- a/roles/deploy_client_library/handlers/main.yml +++ b/roles/deploy_client_library/handlers/main.yml @@ -1,5 +1,5 @@ --- - name: Run ldconfig - command: ldconfig + ansible.builtin.command: ldconfig become: true diff --git a/roles/deploy_client_library/tasks/main.yml b/roles/deploy_client_library/tasks/main.yml index c3287679..c5b2d940 100644 --- a/roles/deploy_client_library/tasks/main.yml +++ b/roles/deploy_client_library/tasks/main.yml @@ -30,19 +30,19 @@ --- - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Install yum dependencies - yum: + ansible.builtin.yum: name: "{{ client_library_deps }}" become: true - name: Identify client tarball - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'dss_client*.tgz' delegate_to: localhost @@ -50,21 +50,21 @@ register: client_tgz - name: Assert client tarball found - assert: + ansible.builtin.assert: that: client_tgz.files | length > 0 fail_msg: "No client tarball found. Please download tarball to {{ artifacts_dir }}" success_msg: "Found client tarball" run_once: true - name: Create client library destination path - file: + ansible.builtin.file: path: "{{ client_library_dir }}" state: directory mode: 0755 become: true - name: Deploy client library from tarball - unarchive: + ansible.builtin.unarchive: src: "{{ (client_tgz.files | sort(attribute='mtime', reverse=true) | first).path }}" dest: "{{ client_library_dir }}" owner: root @@ -74,17 +74,17 @@ become: true - name: Get python3 platform lib dir - command: python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" + ansible.builtin.command: python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" register: python3_platform_lib_dir changed_when: false - name: Get python3 lib dir - command: python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" + ansible.builtin.command: python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" register: python3_lib_dir changed_when: false - name: Set symlink for dss.cpython-36m-x86_64-linux-gnu.so - file: + ansible.builtin.file: src: "{{ client_library_dir }}/dss.cpython-36m-x86_64-linux-gnu.so" dest: "{{ python3_platform_lib_dir.stdout }}/dss.cpython-36m-x86_64-linux-gnu.so" state: link @@ -92,20 +92,20 @@ become: true - name: Remove dss.cpython-36m-x86_64-linux-gnu.so from python3 lib dir if different from platform lib dir - file: + ansible.builtin.file: dest: "{{ python3_lib_dir.stdout }}/dss.cpython-36m-x86_64-linux-gnu.so" state: absent when: python3_lib_dir.stdout != python3_platform_lib_dir.stdout become: true - name: Remove existing libdss.so Library symlink - file: + ansible.builtin.file: path: /usr/local/lib64/libdss.so state: absent become: true - name: Set ld.conf.so - copy: + ansible.builtin.copy: dest: /etc/ld.so.conf.d/dss_client_library.conf content: | # DSS libs for client library diff --git a/roles/deploy_datamover/tasks/main.yml b/roles/deploy_datamover/tasks/main.yml index e550f967..c4db9424 100644 --- a/roles/deploy_datamover/tasks/main.yml +++ b/roles/deploy_datamover/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Identify datamover tarball - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'nkv-datamover*.tgz' delegate_to: localhost @@ -38,21 +38,21 @@ register: datamover_tgz - name: Assert datamove tarball found - assert: + ansible.builtin.assert: that: datamover_tgz.files | length > 0 fail_msg: "No datamove tarball found. Please download tarball to {{ artifacts_dir }}" success_msg: "Found datamover tarball" run_once: true - name: Create datamover destination path - file: + ansible.builtin.file: path: "{{ datamover_dir }}" state: directory mode: 0755 become: true - name: Deploy datamover from tarball - unarchive: + ansible.builtin.unarchive: src: "{{ (datamover_tgz.files | sort(attribute='mtime', reverse=true) | first).path }}" dest: "{{ datamover_dir }}" owner: root diff --git a/roles/deploy_datamover_deps/tasks/main.yml b/roles/deploy_datamover_deps/tasks/main.yml index 1dea430e..6f5c36af 100644 --- a/roles/deploy_datamover_deps/tasks/main.yml +++ b/roles/deploy_datamover_deps/tasks/main.yml @@ -30,11 +30,11 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Install datamover yum dependencies - yum: + ansible.builtin.yum: name: - nfs-utils - libnfsidmap @@ -42,43 +42,43 @@ become: true - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Install pip3 - yum: + ansible.builtin.yum: name: "{{ pip3_deps }}" become: true - name: Identify pip3 executable - shell: which pip3 pip-3 | grep 'bin/pip' | head -n 1 + ansible.builtin.shell: which pip3 pip-3 | grep 'bin/pip' | head -n 1 register: pip3_path changed_when: false failed_when: false - name: Assert pip_path is found - assert: + ansible.builtin.assert: that: pip3_path.stdout != '' msg: "pip3 is not installed" - name: Upgrade pip - pip: + ansible.builtin.pip: name: "pip=={{ pip3_version }}" executable: "{{ pip3_path.stdout }}" become: true - name: Install python dependencies from requirements.txt - pip: + ansible.builtin.pip: requirements: "{{ datamover_dir }}/requirements.txt" executable: "{{ pip3_path.stdout }}" register: benchmark_requirements become: true - name: Create datamover config file - include_role: + ansible.builtin.include_role: name: create_datamover_conf - name: Create log dir - file: + ansible.builtin.file: path: "{{ dss_log_dir }}" state: directory mode: 0755 diff --git a/roles/deploy_dss_agent/tasks/main.yml b/roles/deploy_dss_agent/tasks/main.yml index 8636d9d0..5d730f18 100644 --- a/roles/deploy_dss_agent/tasks/main.yml +++ b/roles/deploy_dss_agent/tasks/main.yml @@ -29,15 +29,15 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- -- name: create dirs... - file: +- name: Create agent directories + ansible.builtin.file: state: directory path: "{{ dss_agent_config_file_dir }}" mode: 0755 become: true - name: Create agent configuration file - blockinfile: + ansible.builtin.blockinfile: path: "{{ dss_agent_config_file_dir }}/agent.conf" create: true mode: 0755 @@ -75,7 +75,7 @@ become: true - name: Copy sflowtool binary - copy: + ansible.builtin.copy: src: sflowtool dest: /usr/bin/sflowtool mode: 0755 diff --git a/roles/deploy_dss_diamond/tasks/main.yml b/roles/deploy_dss_diamond/tasks/main.yml index 26df1c72..4b1ae8e2 100644 --- a/roles/deploy_dss_diamond/tasks/main.yml +++ b/roles/deploy_dss_diamond/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Create target destination path for diamond collector - file: + ansible.builtin.file: path: "{{ item }}" state: directory mode: 0555 @@ -40,7 +40,7 @@ become: true - name: Configure diamond configuration file - template: + ansible.builtin.template: src: diamond.conf.j2 dest: /etc/diamond/diamond.conf mode: 0644 @@ -48,14 +48,14 @@ become: true - name: Configure diamond service file - template: + ansible.builtin.template: src: diamond.service.j2 dest: /etc/systemd/system/diamond.service mode: 0644 become: true - name: Enable diamond service - systemd: + ansible.builtin.systemd: name: diamond daemon_reload: true enabled: true diff --git a/roles/deploy_dss_host/handlers/main.yml b/roles/deploy_dss_host/handlers/main.yml index 3ae58f55..ed98f7fc 100644 --- a/roles/deploy_dss_host/handlers/main.yml +++ b/roles/deploy_dss_host/handlers/main.yml @@ -1,5 +1,5 @@ --- - name: Run ldconfig - command: ldconfig + ansible.builtin.command: ldconfig become: true diff --git a/roles/deploy_dss_host/tasks/main.yml b/roles/deploy_dss_host/tasks/main.yml index adf8081a..fc3a9e51 100644 --- a/roles/deploy_dss_host/tasks/main.yml +++ b/roles/deploy_dss_host/tasks/main.yml @@ -30,20 +30,20 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Install DSS host dependencies - yum: + ansible.builtin.yum: name: "{{ dss_host_deps }}" become: true # Needed for CentOS Stream 8 - name: Set symlink for libjemalloc.so.1 - file: + ansible.builtin.file: src: /usr/lib64/libjemalloc.so dest: /usr/lib64/libjemalloc.so.1 state: link @@ -52,7 +52,7 @@ # Needed for CentOS Stream 8 - name: Set symlink for libboost_filesystem.so - file: + ansible.builtin.file: src: /usr/lib64/libboost_filesystem.so dest: /usr/lib64/libboost_filesystem.so.1.53.0 state: link @@ -60,24 +60,24 @@ become: true - name: Identify pip2 executable - shell: which pip2 pip-2 | grep 'bin/pip' | head -n 1 + ansible.builtin.shell: which pip2 pip-2 | grep 'bin/pip' | head -n 1 register: pip2_path changed_when: false failed_when: false - name: Assert pip2_path is found - assert: + ansible.builtin.assert: that: pip2_path.stdout != '' msg: "pip2 is not installed" - name: Upgrade pip - pip: + ansible.builtin.pip: name: "pip=={{ pip2_version }}" executable: "{{ pip2_path.stdout }}" become: true - name: Install python dependencies - pip: + ansible.builtin.pip: name: - paramiko - pssh @@ -85,7 +85,7 @@ become: true - name: Identify host tarball - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'nkv-sdk-bin-*.tgz' delegate_to: localhost @@ -93,19 +93,19 @@ register: host_tgz - name: Assert host tarball found - assert: + ansible.builtin.assert: that: host_tgz.files | length > 0 fail_msg: "No host tarball found. Please download tarball to {{ artifacts_dir }}" - name: Create host destination path - file: + ansible.builtin.file: path: "{{ nkv_sdk_dir }}" state: directory mode: 0555 become: true - name: Deploy host from tarball - unarchive: + ansible.builtin.unarchive: src: "{{ (host_tgz.files | sort(attribute='mtime', reverse=true) | first).path }}" dest: "{{ nkv_sdk_dir }}" extra_opts: [--strip-components=1] @@ -116,7 +116,7 @@ become: true - name: Set ld.conf.so - copy: + ansible.builtin.copy: dest: /etc/ld.so.conf.d/dss_host.conf content: | # DSS libs for dss-sdk host diff --git a/roles/deploy_dss_minio/tasks/deploy_minio.yml b/roles/deploy_dss_minio/tasks/deploy_minio.yml index 9e578d96..23a18f13 100644 --- a/roles/deploy_dss_minio/tasks/deploy_minio.yml +++ b/roles/deploy_dss_minio/tasks/deploy_minio.yml @@ -30,7 +30,7 @@ --- - name: Install minio dependencies - yum: + ansible.builtin.yum: name: "{{ item }}" loop: - numactl @@ -41,7 +41,7 @@ become: true - name: Identify host tarball - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'dss-minio-bin-*.tgz' delegate_to: localhost @@ -49,19 +49,19 @@ register: minio_tgz - name: Assert minio tarball found - assert: + ansible.builtin.assert: that: minio_tgz.files | length > 0 fail_msg: "No minio tarball found. Please download tarball to {{ artifacts_dir }}" - name: Create minio destination path - file: + ansible.builtin.file: path: "{{ minio_dir }}" state: directory mode: 0755 become: true - name: Deploy minio from tarball - unarchive: + ansible.builtin.unarchive: src: "{{ (minio_tgz.files | sort(attribute='mtime', reverse=true) | first).path }}" dest: "{{ minio_dir }}" owner: root @@ -70,7 +70,7 @@ become: true - name: Create minio symlink to host bin dir - file: + ansible.builtin.file: src: "{{ minio_dir }}/minio" dest: "{{ nkv_sdk_bin_dir }}/minio" state: link @@ -81,7 +81,7 @@ become: true - name: Create log dir - file: + ansible.builtin.file: path: "{{ dss_log_dir }}" state: directory mode: 0755 diff --git a/roles/deploy_dss_minio/tasks/main.yml b/roles/deploy_dss_minio/tasks/main.yml index aca15192..59180dd7 100644 --- a/roles/deploy_dss_minio/tasks/main.yml +++ b/roles/deploy_dss_minio/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Deploy MinIO - include_tasks: deploy_minio.yml + ansible.builtin.include_tasks: deploy_minio.yml when: not no_minio | d(false) diff --git a/roles/deploy_dss_target/handlers/main.yml b/roles/deploy_dss_target/handlers/main.yml index 3ae58f55..ed98f7fc 100644 --- a/roles/deploy_dss_target/handlers/main.yml +++ b/roles/deploy_dss_target/handlers/main.yml @@ -1,5 +1,5 @@ --- - name: Run ldconfig - command: ldconfig + ansible.builtin.command: ldconfig become: true diff --git a/roles/deploy_dss_target/tasks/main.yml b/roles/deploy_dss_target/tasks/main.yml index 17b91e8e..685e0392 100644 --- a/roles/deploy_dss_target/tasks/main.yml +++ b/roles/deploy_dss_target/tasks/main.yml @@ -30,42 +30,42 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Install target runtime dependencies - yum: + ansible.builtin.yum: name: "{{ dss_target_deps }}" become: true - name: Identify pip2 executable - shell: which pip2 pip-2 | grep 'bin/pip' | head -n 1 + ansible.builtin.shell: which pip2 pip-2 | grep 'bin/pip' | head -n 1 register: pip2_path changed_when: false failed_when: false - name: Assert pip2_path is found - assert: + ansible.builtin.assert: that: pip2_path.stdout != '' msg: "pip2 is not installed" - name: Upgrade pip - pip: + ansible.builtin.pip: name: "pip=={{ pip2_version }}" executable: "{{ pip2_path.stdout }}" become: true - name: Install netifaces python dependency - pip: + ansible.builtin.pip: name: netifaces executable: "{{ pip2_path.stdout }}" become: true - name: Identify target tarball - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'nkv-target*.tgz' delegate_to: localhost @@ -73,12 +73,12 @@ register: target_tgz - name: Assert target tarball found - assert: + ansible.builtin.assert: that: target_tgz.files | length > 0 fail_msg: "No target tarball found. Please download tarball to {{ artifacts_dir }}" - name: Identify XRT tarball - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: "{{ xrt_tarball }}" delegate_to: localhost @@ -86,14 +86,14 @@ register: xrt_tgz - name: Create target destination path - file: + ansible.builtin.file: path: "{{ target_dir }}" state: directory mode: 0555 become: true - name: Deploy target from tarball - unarchive: + ansible.builtin.unarchive: src: "{{ (target_tgz.files | sort(attribute='mtime', reverse=true) | first).path }}" dest: "{{ target_dir }}" extra_opts: [--strip-components=1] @@ -104,7 +104,7 @@ become: true - name: Deploy XRT from tarball - unarchive: + ansible.builtin.unarchive: src: "{{ (xrt_tgz.files | sort(attribute='mtime', reverse=true) | first).path }}" dest: '/' owner: root @@ -114,7 +114,7 @@ become: true - name: Set ld.conf.so - copy: + ansible.builtin.copy: dest: /etc/ld.so.conf.d/dss_target.conf content: | # DSS libs for dss-sdk target @@ -125,7 +125,7 @@ become: true - name: Create log dir - file: + ansible.builtin.file: path: "{{ dss_log_dir }}" state: directory mode: 0755 @@ -134,7 +134,7 @@ become: true - name: Create conf dir - file: + ansible.builtin.file: path: "{{ target_conf_dir }}" state: directory mode: 0755 diff --git a/roles/deploy_epel/tasks/main.yml b/roles/deploy_epel/tasks/main.yml index 6b79d8a7..5629e2da 100644 --- a/roles/deploy_epel/tasks/main.yml +++ b/roles/deploy_epel/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Install epel-release repo - yum: + ansible.builtin.yum: name: epel-release enablerepo: extras state: present diff --git a/roles/deploy_etcd_gateway/tasks/main.yml b/roles/deploy_etcd_gateway/tasks/main.yml index bc9185e7..339657c0 100644 --- a/roles/deploy_etcd_gateway/tasks/main.yml +++ b/roles/deploy_etcd_gateway/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Install etcd-gateway.service systemd unit - blockinfile: + ansible.builtin.blockinfile: path: /etc/systemd/system/etcd-gateway.service create: true mode: 0644 @@ -52,14 +52,14 @@ register: etcd_gateway_service become: true -- name: systemctl daemon-reload - systemd: +- name: Run systemctl daemon-reload + ansible.builtin.systemd: daemon_reload: true when: etcd_gateway_service.changed become: true - name: Start etcd-gateway systemd unit - systemd: + ansible.builtin.systemd: enabled: true name: etcd-gateway when: etcd_gateway_service.changed diff --git a/roles/deploy_gcc/tasks/main.yml b/roles/deploy_gcc/tasks/main.yml index e5fee407..0d461999 100644 --- a/roles/deploy_gcc/tasks/main.yml +++ b/roles/deploy_gcc/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Identify GCC RPM - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: "{{ gcc_rpm_name }}-*.rpm" delegate_to: localhost @@ -38,17 +38,17 @@ register: gcc_rpm - name: Assert GCC RPM found - assert: + ansible.builtin.assert: that: gcc_rpm.files | length > 0 fail_msg: "No gcc RPM found. Please download RPM to {{ artifacts_dir }}" - name: Identify newest version of GCC RPM found - set_fact: + ansible.builtin.set_fact: gcc_rpm_file: "{{ (gcc_rpm.files | sort(attribute='mtime', reverse=true) | first).path }}" run_once: true - name: Check if GCC RPM is installed - shell: "rpm -qa | grep {{ gcc_rpm_file | basename | splitext | first }}" + ansible.builtin.shell: "rpm -qa | grep {{ gcc_rpm_file | basename | splitext | first }}" args: warn: false register: gcc_rpm_qa @@ -56,27 +56,27 @@ failed_when: false - name: Copy GCC RPM to staging directory - copy: + ansible.builtin.copy: src: "{{ gcc_rpm_file }}" dest: "{{ deploy_gcc_staging_dir }}" mode: 0644 when: gcc_rpm_qa.rc != 0 - name: Remove conflicting GCC RPMs if present - yum: + ansible.builtin.yum: name: "{{ item }}" state: absent loop: "{{ gcc_remove_rpms }}" become: true - name: Install GCC RPM - yum: + ansible.builtin.yum: name: "{{ deploy_gcc_staging_dir }}/{{ gcc_rpm_file | basename }}" disable_gpg_check: true become: true when: gcc_rpm_qa.rc != 0 - name: Delete GCC RPM from staging directory - file: + ansible.builtin.file: path: "{{ deploy_gcc_staging_dir }}/{{ gcc_rpm_file | basename }}" state: absent diff --git a/roles/deploy_infiniband/tasks/main.yml b/roles/deploy_infiniband/tasks/main.yml index 2c0b2f2a..d3890c42 100644 --- a/roles/deploy_infiniband/tasks/main.yml +++ b/roles/deploy_infiniband/tasks/main.yml @@ -30,16 +30,16 @@ --- - name: Assert infinband_driver value - assert: + ansible.builtin.assert: that: infiniband_driver in ['ofed', 'inbox'] msg: infiniband_driver var must be either 'ofed' or 'inbox' - name: Install Mellanox OFED - include_role: + ansible.builtin.include_role: name: deploy_ofed when: infiniband_driver == 'ofed' - name: Install in-box Infiniband - include_role: + ansible.builtin.include_role: name: configure_inbox_infiniband when: infiniband_driver == 'inbox' diff --git a/roles/deploy_kernel/handlers/main.yml b/roles/deploy_kernel/handlers/main.yml index cca5c8c8..2e3cf121 100644 --- a/roles/deploy_kernel/handlers/main.yml +++ b/roles/deploy_kernel/handlers/main.yml @@ -30,20 +30,20 @@ --- - name: Identify UEFI boot - stat: + ansible.builtin.stat: path: /sys/firmware/efi register: uefi - name: Execute grub2-mkconfig - command: "grub2-mkconfig -o {{ grubpath }}" + ansible.builtin.command: "grub2-mkconfig -o {{ grubpath }}" become: true vars: grubpath: "/boot/{% if uefi.stat.exists %}efi/EFI/centos{% else %}grub2{% endif %}/grub.cfg" - name: Reboot system - kernel - reboot: + ansible.builtin.reboot: reboot_timeout: "{{ reboot_timeout }}" become: true - name: Gather facts post-reboot - setup: + ansible.builtin.setup: diff --git a/roles/deploy_kernel/tasks/deploy_kernel_rpm.yml b/roles/deploy_kernel/tasks/deploy_kernel_rpm.yml index 642e446d..229ffe01 100644 --- a/roles/deploy_kernel/tasks/deploy_kernel_rpm.yml +++ b/roles/deploy_kernel/tasks/deploy_kernel_rpm.yml @@ -30,12 +30,12 @@ --- - name: "Identify newest version of {{ rpm_name }} RPM found" - set_fact: + ansible.builtin.set_fact: kernel_rpm_file: "{{ (kernel_rpms.files | selectattr('path', 'search', rpm_name) | sort(attribute='mtime', reverse=true) | first).path }}" run_once: true - name: "Check if {{ rpm_name }} RPM is installed" - shell: "rpm -qa | grep {{ kernel_rpm_file | basename | splitext | first }}" + ansible.builtin.shell: "rpm -qa | grep {{ kernel_rpm_file | basename | splitext | first }}" args: warn: false register: kernel_rpm_qa @@ -43,20 +43,20 @@ failed_when: false - name: "Copy {{ rpm_name }} RPM to staging directory" - copy: + ansible.builtin.copy: src: "{{ kernel_rpm_file }}" dest: "{{ deploy_kernel_staging_dir }}" mode: 0644 when: kernel_rpm_qa.rc != 0 - name: "Install {{ rpm_name }} RPM" - yum: + ansible.builtin.yum: name: "{{ deploy_kernel_staging_dir }}/{{ kernel_rpm_file | basename }}" disable_gpg_check: true become: true when: kernel_rpm_qa.rc != 0 - name: "Delete {{ rpm_name }} RPM from staging directory" - file: + ansible.builtin.file: path: "{{ deploy_kernel_staging_dir }}/{{ kernel_rpm_file | basename }}" state: absent diff --git a/roles/deploy_kernel/tasks/main.yml b/roles/deploy_kernel/tasks/main.yml index 6c7ecd45..487fcc84 100644 --- a/roles/deploy_kernel/tasks/main.yml +++ b/roles/deploy_kernel/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Identify host kernel version - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'kernel-*.rpm' excludes: 'devel,headers' @@ -39,7 +39,7 @@ register: kernel_version - name: Identify kernel RPMs - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'kernel-*.rpm' delegate_to: localhost @@ -47,7 +47,7 @@ register: kernel_rpms - name: Assert kernel RPMs are found - assert: + ansible.builtin.assert: that: kernel_version.files | map(attribute='path') | select('search', rpm_name) | list | count > 0 fail_msg: "{{ rpm_name }} rpm not found. Please download kernel RPM's to {{ artifacts_dir }}" success_msg: "Found {{ rpm_name }} RPM" @@ -57,7 +57,7 @@ run_once: true - name: Deploy kernel RPMs - include_tasks: deploy_kernel_rpm.yml + ansible.builtin.include_tasks: deploy_kernel_rpm.yml loop: "{{ kernel_rpm_list }}" loop_control: loop_var: kernel_rpm_item @@ -66,7 +66,7 @@ when: inventory_hostname in (groups['servers'] | d([]) + groups['hosts'] | d([])) - name: Set default grub boot - command: "grub2-set-default 'CentOS {{ dist_string }} ({{ kernel_rpm_version }}) {{ ansible_distribution_major_version }}{{ core_string }}'" + ansible.builtin.command: "grub2-set-default 'CentOS {{ dist_string }} ({{ kernel_rpm_version }}) {{ ansible_distribution_major_version }}{{ core_string }}'" environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" vars: @@ -81,13 +81,13 @@ become: true - name: Set GRUB Commandline Options - import_tasks: set_grub_cmdline.yml + ansible.builtin.import_tasks: set_grub_cmdline.yml - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers - name: Assert host kernel version - assert: + ansible.builtin.assert: that: ansible_kernel is version (kernel_rpm_version, '==') fail_msg: "Expected kernel version {{ kernel_rpm_version }} but found {{ ansible_kernel }}" success_msg: "Detected host kernel version {{ kernel_rpm_version }}" diff --git a/roles/deploy_kernel/tasks/set_grub_cmdline.yml b/roles/deploy_kernel/tasks/set_grub_cmdline.yml index 464bb172..e756a0ed 100644 --- a/roles/deploy_kernel/tasks/set_grub_cmdline.yml +++ b/roles/deploy_kernel/tasks/set_grub_cmdline.yml @@ -30,7 +30,7 @@ --- - name: Set GRUB_CMDLINE_LINUX options - lineinfile: + ansible.builtin.lineinfile: path: /etc/default/grub state: present backrefs: true @@ -61,7 +61,7 @@ become: true - name: Set GRUB_DEFAULT - lineinfile: + ansible.builtin.lineinfile: path: /etc/default/grub state: present backrefs: true diff --git a/roles/deploy_mlnx_tools/tasks/install_mellanox_tools.yml b/roles/deploy_mlnx_tools/tasks/install_mellanox_tools.yml index 577abd09..e4987e6b 100644 --- a/roles/deploy_mlnx_tools/tasks/install_mellanox_tools.yml +++ b/roles/deploy_mlnx_tools/tasks/install_mellanox_tools.yml @@ -30,7 +30,7 @@ --- - name: Copy Mellanox Tools RPMs - copy: + ansible.builtin.copy: src: "{{ item }}" dest: "{{ mlnx_tools_staging_dir }}" mode: 0644 @@ -39,7 +39,7 @@ label: "{{ item }}" - name: Install Mellanox Tools RPMs - yum: + ansible.builtin.yum: name: "{{ mlnx_tools_staging_dir }}/{{ item | basename }}" disable_gpg_check: true become: true diff --git a/roles/deploy_mlnx_tools/tasks/main.yml b/roles/deploy_mlnx_tools/tasks/main.yml index 060e9fa9..3128d776 100644 --- a/roles/deploy_mlnx_tools/tasks/main.yml +++ b/roles/deploy_mlnx_tools/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get name of local Mellanox Tools RPMs - find: + ansible.builtin.find: path: "{{ inventory_dir }}/artifacts/" patterns: "{{ item }}-*.rpm" delegate_to: localhost @@ -39,7 +39,7 @@ register: mlnx_tools_rpms - name: Assert Mellanox Tools RPMs found - assert: + ansible.builtin.assert: that: item.files[0].path is defined msg: "Missing Mellanox Tools RPM. Ensure Mellanox Tools RPMs are located in `{{ inventory_dir }}/artifacts`: {{ mlnx_tools_rpm_names }}" quiet: true @@ -50,7 +50,7 @@ label: "{{ item.item }}" - name: Identify most-recent version of Mellanox Tools RPMs in artifacts dir - set_fact: + ansible.builtin.set_fact: mlnx_tools_rpm_filenames: "{{ mlnx_tools_rpm_filenames | d([]) + [ (item.files | sort(attribute='mtime', reverse=true) | first).path ] }}" run_once: true loop: "{{ mlnx_tools_rpms.results }}" @@ -58,7 +58,7 @@ label: "{{ item.item }}" - name: Verify Mellanox Tools RPMs are installed - shell: "rpm -qa | grep {{ item | basename | splitext | first }}" + ansible.builtin.shell: "rpm -qa | grep {{ item | basename | splitext | first }}" args: warn: false register: mlnx_tools_rpm_qa @@ -67,7 +67,7 @@ failed_when: false - name: Set mlnx_tools_rpms_missing var - set_fact: + ansible.builtin.set_fact: mlnx_tools_rpms_missing: >- {%- set count = [] -%} {%- for file in mlnx_tools_rpm_qa.results -%} @@ -78,11 +78,11 @@ {{ count | length }} - name: Install Mellanox Tools - import_tasks: install_mellanox_tools.yml + ansible.builtin.import_tasks: install_mellanox_tools.yml when: mlnx_tools_rpms_missing | int > 0 - name: Delete Mellanox Tools staging RPMs - file: + ansible.builtin.file: path: "{{ mlnx_tools_staging_dir }}/{{ item | basename }}" state: absent loop: "{{ mlnx_tools_rpm_filenames }}" diff --git a/roles/deploy_nvme_cli/tasks/main.yml b/roles/deploy_nvme_cli/tasks/main.yml index 265b61bf..4c68e801 100644 --- a/roles/deploy_nvme_cli/tasks/main.yml +++ b/roles/deploy_nvme_cli/tasks/main.yml @@ -30,17 +30,17 @@ --- - name: Install nvme-cli - include_tasks: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_tasks: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Check nvme-cli version post-install - command: nvme --version + ansible.builtin.command: nvme --version environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false register: post_nvme_cli_version - name: Assert nvme-cli version post-install - assert: + ansible.builtin.assert: that: post_nvme_cli_version.stdout.split(' ')[-1] is version(deploy_nvme_cli_version, '==') fail_msg: "Expected nvme-cli version {{ deploy_nvme_cli_version }}. Detected nvme-cli version {{ post_nvme_cli_version.stdout.split(' ')[-1] }}" success_msg: "Detected target nvme-cli version {{ deploy_nvme_cli_version }}." diff --git a/roles/deploy_nvme_cli/tasks/redhat_7.yml b/roles/deploy_nvme_cli/tasks/redhat_7.yml index bddd4a66..0d1c7fad 100644 --- a/roles/deploy_nvme_cli/tasks/redhat_7.yml +++ b/roles/deploy_nvme_cli/tasks/redhat_7.yml @@ -30,6 +30,6 @@ --- - name: Install nvme-cli - yum: + ansible.builtin.yum: name: "nvme-cli-{{ deploy_nvme_cli_version }}" become: true diff --git a/roles/deploy_nvme_cli/tasks/redhat_8.yml b/roles/deploy_nvme_cli/tasks/redhat_8.yml index e6609e38..83e7d8c6 100644 --- a/roles/deploy_nvme_cli/tasks/redhat_8.yml +++ b/roles/deploy_nvme_cli/tasks/redhat_8.yml @@ -30,7 +30,7 @@ --- - name: Install nvme-cli - yum: + ansible.builtin.yum: name: "{{ deploy_nvme_cli_url }}" disable_gpg_check: true become: true diff --git a/roles/deploy_ofed/tasks/deploy_ofed.yml b/roles/deploy_ofed/tasks/deploy_ofed.yml index 7dc6f8b3..d6918744 100644 --- a/roles/deploy_ofed/tasks/deploy_ofed.yml +++ b/roles/deploy_ofed/tasks/deploy_ofed.yml @@ -30,13 +30,13 @@ --- - name: Remove inbox infiniband drivers - yum: + ansible.builtin.yum: name: '@Infiniband Support' state: absent become: true - name: Set OFED version variables - set_fact: + ansible.builtin.set_fact: ofed_url: "{{ item.url }}" ofed_target_version: "{{ item.version }}" ofed_dir: "{{ item.dir }}" @@ -46,30 +46,30 @@ when: ansible_distribution_version is version(item.distribution_version, '==') - name: Check OFED version - command: ofed_info -n + ansible.builtin.command: ofed_info -n failed_when: false changed_when: false register: ofed_version - name: Install Mellanox OFED - import_tasks: install_ofed.yml + ansible.builtin.import_tasks: install_ofed.yml when: > ofed_version.rc != 0 or ofed_version.stdout is version(ofed_target_version, '!=') - name: Check OFED version post-deploy - command: ofed_info -n + ansible.builtin.command: ofed_info -n changed_when: false register: post_ofed_version - name: Assert target OFED version - assert: + ansible.builtin.assert: that: post_ofed_version.stdout is version(ofed_target_version, '==') fail_msg: "Expected OFED version {{ ofed_target_version }} but found {{ post_ofed_version.stdout }}" success_msg: "Detected target OFED version {{ ofed_target_version }}" - name: Stop and disable openibd service - service: + ansible.builtin.service: name: openibd state: stopped enabled: false @@ -77,23 +77,23 @@ become: true - name: Remove mlnx-ofa_kernel modules - file: + ansible.builtin.file: path: "/lib/modules/{{ ansible_kernel }}/extra/mlnx-ofa_kernel" state: absent register: rm_mlnx_ofa_kernel become: true - name: Reload module dependencies - command: depmod -a + ansible.builtin.command: depmod -a when: > openibd_service.changed or rm_mlnx_ofa_kernel.changed become: true - name: Load Mellanox Drivers - include_role: + ansible.builtin.include_role: name: load_mlnx_drivers - name: Upgrade ConnectX Firmware - include_role: + ansible.builtin.include_role: name: upgrade_connectx_firmware diff --git a/roles/deploy_ofed/tasks/install_ofed.yml b/roles/deploy_ofed/tasks/install_ofed.yml index 4bbae50a..94f7cedc 100644 --- a/roles/deploy_ofed/tasks/install_ofed.yml +++ b/roles/deploy_ofed/tasks/install_ofed.yml @@ -30,11 +30,11 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Install OFED dependencies - yum: + ansible.builtin.yum: name: - pciutils - wget @@ -55,30 +55,30 @@ become: true - name: Create staging directory for OFED tgz - file: + ansible.builtin.file: path: "{{ deploy_ofed_staging_dir }}" state: directory mode: 0755 - name: Unarchive OFED tgz - unarchive: + ansible.builtin.unarchive: src: "{{ ofed_url }}" dest: "{{ deploy_ofed_staging_dir }}" mode: 0754 remote_src: true - name: Install OFED - command: "./mlnxofedinstall --add-kernel-support --force" + ansible.builtin.command: "./mlnxofedinstall --add-kernel-support --force" args: chdir: "{{ deploy_ofed_staging_dir }}/{{ ofed_dir }}" become: true - name: Delete staging directory for OFED tgz - file: + ansible.builtin.file: path: "{{ deploy_ofed_staging_dir }}" state: absent become: true - name: Set mlnx_tune profile - command: "mlnx_tune {{ mlnx_tune_profile }}" + ansible.builtin.command: "mlnx_tune {{ mlnx_tune_profile }}" become: true diff --git a/roles/deploy_ofed/tasks/main.yml b/roles/deploy_ofed/tasks/main.yml index c3dbf25d..af1bf214 100644 --- a/roles/deploy_ofed/tasks/main.yml +++ b/roles/deploy_ofed/tasks/main.yml @@ -30,19 +30,19 @@ --- - name: Get OFED versions - include_role: + ansible.builtin.include_role: name: get_ofed_versions - name: Set infiniband_driver to 'inbox' if not supported distribution version - set_fact: + ansible.builtin.set_fact: ofed_unsupported: true when: ansible_distribution_version not in ofed_files | map(attribute='distribution_version') | list - name: Deploy Mellanox OFED - import_tasks: deploy_ofed.yml + ansible.builtin.import_tasks: deploy_ofed.yml when: not ofed_unsupported | d(false) - name: Install in-box Infiniband driver if OFED is not supported - include_role: + ansible.builtin.include_role: name: configure_inbox_infiniband when: ofed_unsupported | d(false) diff --git a/roles/deploy_ufm/tasks/main.yml b/roles/deploy_ufm/tasks/main.yml index 43f60e20..8d3595e5 100644 --- a/roles/deploy_ufm/tasks/main.yml +++ b/roles/deploy_ufm/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get name of local Fabric Mananger RPM - find: + ansible.builtin.find: path: "{{ inventory_dir }}/artifacts/" patterns: 'ufm-*.rpm' delegate_to: localhost @@ -38,7 +38,7 @@ register: ufm_rpm - name: Get name of local Fabric Mananger Broker RPM - find: + ansible.builtin.find: path: "{{ inventory_dir }}/artifacts/" patterns: 'ufmbroker-*.rpm' delegate_to: localhost @@ -46,7 +46,7 @@ register: ufmbroker_rpm - name: Fail if packages are missing - fail: + ansible.builtin.fail: msg: "Missing UFM packages. Check `{{ inventory_dir }}/artifacts` and execute build scripts if empty." delegate_to: localhost run_once: true @@ -55,13 +55,13 @@ ufmbroker_rpm.files[0].path is undefined - name: Identify newest version of RPMs found - set_fact: + ansible.builtin.set_fact: ufm_rpm_file: "{{ (ufm_rpm.files | sort(attribute='mtime', reverse=true) | first).path }}" ufmbroker_rpm_file: "{{ (ufmbroker_rpm.files | sort(attribute='mtime', reverse=true) | first).path }}" run_once: true - name: Check if UFM RPMs are installed - shell: "rpm -qa | grep {{ item | basename | splitext | first }}" + ansible.builtin.shell: "rpm -qa | grep {{ item | basename | splitext | first }}" args: warn: false register: ufm_rpm_qa @@ -72,7 +72,7 @@ failed_when: false - name: Set ufm_rpms_missing var - set_fact: + ansible.builtin.set_fact: ufm_rpms_missing: >- {%- set count = [] -%} {%- for file in ufm_rpm_qa.results -%} @@ -83,13 +83,13 @@ {{ count | length }} - name: Install FabricManager - CentOS - import_tasks: ufm_centos.yml + ansible.builtin.import_tasks: ufm_centos.yml when: - ansible_distribution_file_variety == 'RedHat' - ufm_rpms_missing | int > 0 - name: Start Services - systemd: + ansible.builtin.systemd_service: name: "{{ item }}" state: started enabled: true @@ -100,7 +100,7 @@ become: true - name: Check that UFM services are running - service: + ansible.builtin.service: name: "{{ item }}" register: service_status failed_when: service_status.status.ActiveState != "active" @@ -111,7 +111,7 @@ - ufm_api - name: Delete RPM files from Fabric Mananger Hosts - file: + ansible.builtin.file: path: "{{ ufm_staging_dir }}/{{ item | basename }}" state: absent loop: diff --git a/roles/deploy_ufm/tasks/ufm_centos.yml b/roles/deploy_ufm/tasks/ufm_centos.yml index 74866472..5e07f985 100644 --- a/roles/deploy_ufm/tasks/ufm_centos.yml +++ b/roles/deploy_ufm/tasks/ufm_centos.yml @@ -30,7 +30,7 @@ --- - name: Copy UFM RPMs to CentOS Fabric Manager Hosts - copy: + ansible.builtin.copy: src: "{{ item }}" dest: "{{ ufm_staging_dir }}" mode: 0644 @@ -41,7 +41,7 @@ label: "{{ item }}" - name: Install UFM RPMs - yum: + ansible.builtin.yum: name: "{{ ufm_staging_dir }}/{{ item | basename }}" disable_gpg_check: true register: ufm_rpm_status diff --git a/roles/deploy_ufm_etcd/tasks/main.yml b/roles/deploy_ufm_etcd/tasks/main.yml index 12181d5f..ce8eef88 100644 --- a/roles/deploy_ufm_etcd/tasks/main.yml +++ b/roles/deploy_ufm_etcd/tasks/main.yml @@ -30,40 +30,40 @@ --- - name: Gather service facts - service_facts: + ansible.builtin.service_facts: - name: Install dependencies - include_tasks: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_tasks: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Open Ports - CentOS - include_tasks: ports_centos.yml + ansible.builtin.include_tasks: ports_centos.yml - name: Identify pip2 executable - shell: which pip2 pip-2 | grep 'bin/pip' | head -n 1 + ansible.builtin.shell: which pip2 pip-2 | grep 'bin/pip' | head -n 1 register: pip2_path changed_when: false failed_when: false - name: Assert pip2_path is found - assert: + ansible.builtin.assert: that: pip2_path.stdout != '' msg: "pip2 is not installed" - name: Upgrade pip - pip: + ansible.builtin.pip: name: "pip=={{ pip2_version }}" executable: "{{ pip2_path.stdout }}" become: true - name: Install etcd3 python module - pip: + ansible.builtin.pip: name: etcd3 state: present executable: "{{ pip2_path.stdout }}" become: true - name: Stop and disable default etcd service - systemd: + ansible.builtin.systemd: name: etcd state: stopped enabled: false diff --git a/roles/deploy_ufm_etcd/tasks/ports_centos.yml b/roles/deploy_ufm_etcd/tasks/ports_centos.yml index 6a57d0ad..49d419ff 100644 --- a/roles/deploy_ufm_etcd/tasks/ports_centos.yml +++ b/roles/deploy_ufm_etcd/tasks/ports_centos.yml @@ -30,7 +30,7 @@ --- - name: Open etcd ports (firewalld) - firewalld: + ansible.builtin.firewalld: port: "{{ item }}/tcp" immediate: true permanent: true diff --git a/roles/deploy_ufm_etcd/tasks/redhat_7.yml b/roles/deploy_ufm_etcd/tasks/redhat_7.yml index a9da4539..3eec13c1 100644 --- a/roles/deploy_ufm_etcd/tasks/redhat_7.yml +++ b/roles/deploy_ufm_etcd/tasks/redhat_7.yml @@ -30,11 +30,11 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Install Required Packages (yum) - yum: + ansible.builtin.yum: name: - fping - python-pip diff --git a/roles/deploy_ufm_etcd/tasks/redhat_8.yml b/roles/deploy_ufm_etcd/tasks/redhat_8.yml index 1f6d3122..f4a01cb2 100644 --- a/roles/deploy_ufm_etcd/tasks/redhat_8.yml +++ b/roles/deploy_ufm_etcd/tasks/redhat_8.yml @@ -30,11 +30,11 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Install Required Packages (yum) - yum: + ansible.builtin.yum: name: - fping - python2-pip @@ -44,7 +44,7 @@ become: true - name: Install etcd from URL - yum: + ansible.builtin.yum: name: "{{ ufm_etcd_rpm_url }}" state: present disable_gpg_check: true diff --git a/roles/deploy_utils/tasks/main.yml b/roles/deploy_utils/tasks/main.yml index c971fc4b..e48b795f 100644 --- a/roles/deploy_utils/tasks/main.yml +++ b/roles/deploy_utils/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Install epel-release repo - include_role: + ansible.builtin.include_role: name: deploy_epel - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Install utils - yum: + ansible.builtin.yum: name: "{{ utils_list }}" become: true diff --git a/roles/format_blobfs/tasks/format_blobfs.yml b/roles/format_blobfs/tasks/format_blobfs.yml index 05866e53..21e5a04e 100644 --- a/roles/format_blobfs/tasks/format_blobfs.yml +++ b/roles/format_blobfs/tasks/format_blobfs.yml @@ -30,17 +30,17 @@ --- - name: Stat XRT script - stat: + ansible.builtin.stat: path: "{{ xrt_setenv }}" register: xrt_setenv_script - name: Assert XRT script exists - assert: + ansible.builtin.assert: that: xrt_setenv_script.stat.exists when: hpos - name: Create format_disks.sh script - template: + ansible.builtin.template: src: format_disks.sh.j2 dest: "{{ target_bin_dir }}/format_disks.sh" mode: 0751 @@ -48,18 +48,18 @@ become: true - name: Check presence of existing format_disks.sh output - stat: + ansible.builtin.stat: path: "{{ target_bin_dir }}/format_disks.out" register: format_disks_out_file - name: Check output of existing format_disks.sh - command: "cat {{ target_bin_dir }}/format_disks.out" + ansible.builtin.command: "cat {{ target_bin_dir }}/format_disks.out" changed_when: false when: format_disks_out_file.stat.exists register: pre_format_disks - name: Execute format_disks.sh script - shell: ./format_disks.sh > format_disks.out 2>&1 + ansible.builtin.shell: ./format_disks.sh > format_disks.out 2>&1 register: execute_format_disks args: chdir: "{{ target_bin_dir }}" @@ -81,13 +81,13 @@ become: true - name: Read output of format_disks.sh - command: "cat {{ target_bin_dir }}/format_disks.out" + ansible.builtin.command: "cat {{ target_bin_dir }}/format_disks.out" changed_when: false when: execute_format_disks is not skipped register: format_disks - name: Assert filesystem initialized successfully - assert: + ansible.builtin.assert: that: format_disks.stdout is not search(item) fail_msg: | *ERROR* {{ item }} diff --git a/roles/format_blobfs/tasks/main.yml b/roles/format_blobfs/tasks/main.yml index 680000d9..a9b8d2ce 100644 --- a/roles/format_blobfs/tasks/main.yml +++ b/roles/format_blobfs/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get spdk status - command: ./setup.sh status + ansible.builtin.command: ./setup.sh status changed_when: false args: chdir: "{{ target_dir }}/scripts" @@ -38,31 +38,31 @@ become: true - name: Assert disks in SPDK mode - assert: + ansible.builtin.assert: that: > spdk_status.stdout is search('uio_pci_generic') or spdk_status.stdout is search('vfio-pci') msg: Cannot format BlobFS. Disks are not in SPDK mode. Start DSS software first. - name: Stat nvmf.in.conf - stat: + ansible.builtin.stat: path: "{{ target_conf_file }}" register: nvmf_in_conf - name: Assert nvmf.in.conf found - assert: + ansible.builtin.assert: that: nvmf_in_conf.stat.exists msg: nvmf.in.conf not found. Start DSS software first. - name: Find NVMe PCIe addresses in nvmf.in.conf - command: > + ansible.builtin.command: > grep 'TransportID "trtype:PCIe traddr' {{ target_conf_file }} register: pcie_addrs changed_when: false failed_when: false - name: Assert PCIe addresses found - assert: + ansible.builtin.assert: that: pcie_addrs.stdout_lines | length > 0 msg: | Disk serial numbers not found in blobfs.mkfs.in.conf for firmware {{ target_fw_version }}. @@ -71,7 +71,7 @@ Then verify desired SSD firmware version. - name: Create blobfs scripts for each device - template: + ansible.builtin.template: src: blobfs.mkfs.in.conf.j2 dest: "{{ target_conf_dir }}/blobfs.mkfs.in.{{ ansible_loop.index0 }}.conf" mode: 0644 @@ -82,5 +82,5 @@ become: true - name: Create BlobFS filesystem for KV-Block - include_tasks: format_blobfs.yml + ansible.builtin.include_tasks: format_blobfs.yml when: dss_target_mode is search('kv_block') diff --git a/roles/format_disks/tasks/main.yml b/roles/format_disks/tasks/main.yml index ddb29b75..286d4552 100644 --- a/roles/format_disks/tasks/main.yml +++ b/roles/format_disks/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Remove BlobFS Files - include_role: + ansible.builtin.include_role: name: remove_blobfs_files when: dss_target_mode is search('kv_block') - name: Format KVSSD - include_role: + ansible.builtin.include_role: name: "{{ item }}" loop: - reset_spdk diff --git a/roles/format_kvssds/tasks/check_async.yml b/roles/format_kvssds/tasks/check_async.yml index 49c90952..f65ed132 100644 --- a/roles/format_kvssds/tasks/check_async.yml +++ b/roles/format_kvssds/tasks/check_async.yml @@ -30,7 +30,7 @@ --- - name: Check async {{ async_name }} - async_status: + ansible.builtin.async_status: jid: "{{ async_task.ansible_job_id }}" register: async_results until: async_results.finished @@ -43,7 +43,7 @@ become: true - name: Assert async {{ async_name }} completion - assert: + ansible.builtin.assert: that: async_result.finished != 0 fail_msg: "{{ async_name }} did not complete in time" quiet: true diff --git a/roles/format_kvssds/tasks/main.yml b/roles/format_kvssds/tasks/main.yml index 6dca83e4..bf7c95b9 100644 --- a/roles/format_kvssds/tasks/main.yml +++ b/roles/format_kvssds/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Identify kvssd firmware - include_role: + ansible.builtin.include_role: name: identify_kvssd_firmware when: target_fw_version is not defined - name: Query list of NVMe devices - command: nvme list -o json + ansible.builtin.command: nvme list -o json environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false @@ -43,7 +43,7 @@ become: true - name: Set kvssd_format_list variable - set_fact: + ansible.builtin.set_fact: kvssd_format_list: "{{ kvssd_format_list | default([]) + [ kvssd.DevicePath ] }}" loop: "{{ (nvme_list.stdout | from_json).Devices }}" loop_control: @@ -54,7 +54,7 @@ - kvssd.Firmware == target_fw_version - name: Format kvssd devices - command: "nvme format {{ kvssd_device_path }} -s0 -n1" + ansible.builtin.command: "nvme format {{ kvssd_device_path }} -s0 -n1" environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" register: kvssd_format @@ -71,7 +71,7 @@ become: true - name: Check async nvme reset - include_tasks: check_async.yml + ansible.builtin.include_tasks: check_async.yml vars: async_name: "format kvssd" async_tasks: "{{ kvssd_format.results }}" diff --git a/roles/get_clusters/tasks/collect_cluster_mountpoints.yml b/roles/get_clusters/tasks/collect_cluster_mountpoints.yml index 84f2cd3c..8db5f6f3 100644 --- a/roles/get_clusters/tasks/collect_cluster_mountpoints.yml +++ b/roles/get_clusters/tasks/collect_cluster_mountpoints.yml @@ -30,11 +30,11 @@ --- - name: Get Mountpoints - include_role: + ansible.builtin.include_role: name: get_mountpoints - name: Append mountpoints to cluster_mountpoints - set_fact: + ansible.builtin.set_fact: cluster_mountpoints: "{{ cluster_mountpoints }} + [ { diff --git a/roles/get_clusters/tasks/main.yml b/roles/get_clusters/tasks/main.yml index 840b30ad..7c5016a6 100644 --- a/roles/get_clusters/tasks/main.yml +++ b/roles/get_clusters/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Set target/host group vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" cluster_num_list: [] - name: Set cluster_num_list var - set_fact: + ansible.builtin.set_fact: cluster_num_list: "{{ cluster_num_list }} + [ {% for host in ansible_play_hosts %} @@ -46,35 +46,35 @@ run_once: true - name: Get all RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Initialize cluster_mountpoints var - set_fact: + ansible.builtin.set_fact: cluster_mountpoints: [] - name: Collect mountpoints for each cluster - include_tasks: collect_cluster_mountpoints.yml + ansible.builtin.include_tasks: collect_cluster_mountpoints.yml loop: "{{ cluster_num_list | unique }}" loop_control: loop_var: current_cluster_num when: current_cluster_num | string == cluster_num | string - name: Initialize vars for cluster map - set_fact: + ansible.builtin.set_fact: clusters: [] cluster_index: 0 - name: Set clusters array - include_tasks: set_clusters.yml + ansible.builtin.include_tasks: set_clusters.yml loop: "{{ range(0, cluster_mountpoints | length) | list }}" loop_control: loop_var: current_cluster_count diff --git a/roles/get_clusters/tasks/set_clusters.yml b/roles/get_clusters/tasks/set_clusters.yml index 072c68b4..5e40fb29 100644 --- a/roles/get_clusters/tasks/set_clusters.yml +++ b/roles/get_clusters/tasks/set_clusters.yml @@ -1,11 +1,11 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: included_hosts: [] - name: Set included_hosts var - set_fact: + ansible.builtin.set_fact: included_hosts: "{{ included_hosts | default([]) + [ host ] }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -16,7 +16,7 @@ run_once: true - name: Set endpoints for each min_subsystem_list - include_tasks: set_endpoints.yml + ansible.builtin.include_tasks: set_endpoints.yml loop: "{{ current_cluster.min_subsystem_list | unique }}" loop_control: loop_var: unique_subsystem diff --git a/roles/get_clusters/tasks/set_endpoints.yml b/roles/get_clusters/tasks/set_endpoints.yml index a3896be5..4341db9d 100644 --- a/roles/get_clusters/tasks/set_endpoints.yml +++ b/roles/get_clusters/tasks/set_endpoints.yml @@ -1,12 +1,12 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: endpoints: [] combined_endpoints: [] - name: Set endpoints var - set_fact: + ansible.builtin.set_fact: endpoints: "{{ endpoints | d([]) }} + [ { @@ -23,7 +23,7 @@ when: current_cluster.min_subsystem_list[vlan] == unique_subsystem - name: Set combined_endpoints var - set_fact: + ansible.builtin.set_fact: combined_endpoints: "{{ combined_endpoints + hostvars[host].endpoints }}" loop: "{{ included_hosts }}" loop_control: @@ -32,7 +32,7 @@ run_once: true - name: Set clusters var and increment cluster_index - set_fact: + ansible.builtin.set_fact: clusters: "{{ clusters }} + [ { diff --git a/roles/get_combined_vlan_ip_map/tasks/main.yml b/roles/get_combined_vlan_ip_map/tasks/main.yml index bd8264e9..dc7a54b6 100644 --- a/roles/get_combined_vlan_ip_map/tasks/main.yml +++ b/roles/get_combined_vlan_ip_map/tasks/main.yml @@ -30,21 +30,21 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: vlan_ip_map: [] combined_vlan_ip_map: [] included_targets: [] included_hosts: [] - name: Assert current_cluster_num is defined - assert: + ansible.builtin.assert: that: current_cluster_num is defined msg: | current_cluster_num is not defined. This role must be included in groups by cluster_num - name: Set included_targets var - set_fact: + ansible.builtin.set_fact: included_targets: "{{ included_targets | default([]) + [ target ] }}" loop: "{{ target_hostnames }}" loop_control: @@ -53,7 +53,7 @@ run_once: true - name: Set included_hosts var - set_fact: + ansible.builtin.set_fact: included_hosts: "{{ included_hosts | default([]) + [ host ] }}" loop: "{{ host_hostnames }}" loop_control: @@ -62,7 +62,7 @@ run_once: true - name: Set TCP - RoCEv2 IP map - set_fact: + ansible.builtin.set_fact: vlan_ip_map: "{{ vlan_ip_map | default([]) + [{'tcp_alias': tcp_alias, 'rocev2_ip': rocev2_ip }] }}" @@ -76,7 +76,7 @@ rocev2_ip: "{{ item.1 }}" - name: Set combined_vlan_ip_map - set_fact: + ansible.builtin.set_fact: combined_vlan_ip_map: "{{ combined_vlan_ip_map | default([]) }} + [{ 'rocev2': [{% for host in included_targets -%} '{{ hostvars[host].vlan_ip_map[ansible_loop.index0].rocev2_ip }}' @@ -91,7 +91,7 @@ run_once: true - name: NVMe list subsystems - command: nvme list-subsys -o json + ansible.builtin.command: nvme list-subsys -o json environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false diff --git a/roles/get_connectx_mac_list/tasks/main.yml b/roles/get_connectx_mac_list/tasks/main.yml index 79f5604d..3687b548 100644 --- a/roles/get_connectx_mac_list/tasks/main.yml +++ b/roles/get_connectx_mac_list/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Get list of Mellanox ports - include_role: + ansible.builtin.include_role: name: get_mlnx_ports when: mellanox_ports is not defined - name: Get list of MAC addresses - set_fact: + ansible.builtin.set_fact: connectx_mac_address_list: "{{ connectx_mac_address_list | default([]) + [ mac_address ] }}" loop: "{{ mellanox_ports }}" loop_control: @@ -49,7 +49,7 @@ - lookup('vars', vlan_device, default='') != '' - name: Set combined_connectx_mac_list - set_fact: + ansible.builtin.set_fact: combined_connectx_mac_list: "{{ combined_connectx_mac_list | default([]) }} + {{ hostvars[host].connectx_mac_address_list }}" loop: "{{ ansible_play_hosts }}" loop_control: diff --git a/roles/get_ip_numa/tasks/main.yml b/roles/get_ip_numa/tasks/main.yml index b423cba6..4d95f889 100644 --- a/roles/get_ip_numa/tasks/main.yml +++ b/roles/get_ip_numa/tasks/main.yml @@ -30,19 +30,19 @@ --- - name: Get all RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Get NUMA - command: "cat /sys/class/net/{{ interface }}/device/numa_node" + ansible.builtin.command: "cat /sys/class/net/{{ interface }}/device/numa_node" changed_when: false loop: "{{ rocev2_ip_list }}" loop_control: @@ -54,7 +54,7 @@ register: numa_node - name: Set rocev2_numa_prefix_list - set_fact: + ansible.builtin.set_fact: rocev2_numa_prefix_list: >- {{ rocev2_numa_prefix_list | default([]) + [ diff --git a/roles/get_last_octet/tasks/main.yml b/roles/get_last_octet/tasks/main.yml index f6d39560..e8eee844 100644 --- a/roles/get_last_octet/tasks/main.yml +++ b/roles/get_last_octet/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get IP last octet from hostname - set_fact: + ansible.builtin.set_fact: last_octet: "{{ (short_hostname | regex_search(octet_regex,'\\1') | first | int) + last_octet_offset | int }}" vars: short_hostname: "{{ ansible_hostname.split('.').0 }}" @@ -42,7 +42,7 @@ - short_hostname | regex_search(octet_regex,'\\1') | first | int <= 255 - name: Set last_octet_list - set_fact: + ansible.builtin.set_fact: last_octet_list: "{{ last_octet_list | default([]) + [ hostvars[item].last_octet | int ] }}" loop: "{{ ansible_play_hosts }}" run_once: true @@ -50,7 +50,7 @@ - hostvars[item].last_octet is defined - name: Use inventory ID number if hostnames do not contain unique numbers between 1 and 255 - set_fact: + ansible.builtin.set_fact: last_octet: "{{ ansible_loop.index + last_octet_offset | int }}" when: > item == inventory_hostname and @@ -62,7 +62,7 @@ extended: true - name: Set final_last_octet_list - set_fact: + ansible.builtin.set_fact: final_last_octet_list: "{{ final_last_octet_list | default([]) + [ hostvars[item].last_octet | int ] }}" loop: "{{ ansible_play_hosts }}" run_once: true @@ -70,7 +70,7 @@ - hostvars[item].last_octet is defined - name: Assert last_octet is valid - assert: + ansible.builtin.assert: that: - last_octet | int >= 1 - last_octet | int <= 255 diff --git a/roles/get_minio_hostnames/tasks/main.yml b/roles/get_minio_hostnames/tasks/main.yml index 8c9ad265..298dc48b 100644 --- a/roles/get_minio_hostnames/tasks/main.yml +++ b/roles/get_minio_hostnames/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Initialize minio_hostnames var - set_fact: + ansible.builtin.set_fact: minio_hostnames: [] run_once: true - name: Set minio_hostnames var - set_fact: + ansible.builtin.set_fact: minio_hostnames: "{{ minio_hostnames | d([]) + [ item ] }}" loop: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" run_once: true diff --git a/roles/get_mlnx_ports/tasks/main.yml b/roles/get_mlnx_ports/tasks/main.yml index 2371812b..e3ea8a58 100644 --- a/roles/get_mlnx_ports/tasks/main.yml +++ b/roles/get_mlnx_ports/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Query ConnectX Devices (ibdev2netdev) - command: ibdev2netdev -v + ansible.builtin.command: ibdev2netdev -v changed_when: false register: mlx_list become: true diff --git a/roles/get_mountpoints/tasks/main.yml b/roles/get_mountpoints/tasks/main.yml index bf34663f..56994e01 100644 --- a/roles/get_mountpoints/tasks/main.yml +++ b/roles/get_mountpoints/tasks/main.yml @@ -30,21 +30,21 @@ --- - name: Init vars - set_fact: - standalone_minio: "{{ standalone_minio | d(false)}}" + ansible.builtin.set_fact: + standalone_minio: "{{ standalone_minio | d(false) }}" - name: Get Combined VLAN IP map - include_role: + ansible.builtin.include_role: name: get_combined_vlan_ip_map - name: Assert Subsystems mounted - assert: + ansible.builtin.assert: that: (nvme_subsys.stdout | from_json).Subsystems is defined msg: Subsystems are not mounted. Run `start_dss_software` playbook first. when: inventory_hostname in host_hostnames - name: Set flattened_subsystems - set_fact: + ansible.builtin.set_fact: flattened_subsystems: "{{ flattened_subsystems | d([]) }} + [ { @@ -59,18 +59,18 @@ when: inventory_hostname in host_hostnames - name: Set rdma_subsystems var - set_fact: + ansible.builtin.set_fact: rdma_subsystems: "{{ flattened_subsystems | json_query('[?Paths[?Transport==`rdma`]]') }}" when: inventory_hostname in host_hostnames - name: Assert rdma subsystems present - assert: + ansible.builtin.assert: that: rdma_subsystems | length > 0 msg: "No RDMA subsystems are mounted." when: inventory_hostname in host_hostnames - name: Set nvme_mountpoints - set_fact: + ansible.builtin.set_fact: nvme_mountpoints: | [ {% for subsystem in rdma_subsystems %} @@ -92,13 +92,13 @@ when: inventory_hostname in host_hostnames - name: Assert subsystems mounted - assert: + ansible.builtin.assert: that: nvme_mountpoints | length > 0 msg: NVMeOF subsystems not mounted. Please verify DSS software is running (start_dss_software) when: inventory_hostname in host_hostnames - name: Find min/max devmap - set_fact: + ansible.builtin.set_fact: subsys_range: >- {% set dev_range = { 'min': 999, 'max': 0 } -%} {%- for subsys in nvme_mountpoints -%} @@ -118,14 +118,14 @@ when: inventory_hostname in host_hostnames - name: Assert mountpoints found for each VLAN - assert: + ansible.builtin.assert: that: item.min != 999 msg: "NVMe mountpoints not found for all VLANs. Check rocev2_vlans or rocev2_ip_list vars." loop: "{{ subsys_range }}" when: inventory_hostname in host_hostnames - name: Set min_subsystem_list - set_fact: + ansible.builtin.set_fact: min_subsystem_list: | [ {% for vlan in subsys_range %} @@ -135,7 +135,7 @@ when: inventory_hostname in host_hostnames - name: Set standalone_minio var - set_fact: + ansible.builtin.set_fact: standalone_minio: true when: - inventory_hostname in host_hostnames @@ -144,7 +144,7 @@ (nvme_mountpoints | length / tcp_alias_list | length) < 4) - name: Set standalone_minio var if disaggregated - set_fact: + ansible.builtin.set_fact: standalone_minio: true when: - inventory_hostname in groups['hosts'] | d([]) diff --git a/roles/get_ofed_versions/tasks/main.yml b/roles/get_ofed_versions/tasks/main.yml index 8f92795e..6c6bd1d3 100644 --- a/roles/get_ofed_versions/tasks/main.yml +++ b/roles/get_ofed_versions/tasks/main.yml @@ -30,11 +30,11 @@ --- - name: Initialize ofed_files variable - set_fact: + ansible.builtin.set_fact: ofed_files: [] - name: Set list of variables for detected OFED versions - set_fact: + ansible.builtin.set_fact: ofed_files: "{{ ofed_files | default([]) + [{'url': item, 'filename': item | basename, diff --git a/roles/get_onyx_lldp/tasks/main.yml b/roles/get_onyx_lldp/tasks/main.yml index 9a34a862..d769a69f 100644 --- a/roles/get_onyx_lldp/tasks/main.yml +++ b/roles/get_onyx_lldp/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Assert VLAN lists are defined - assert: + ansible.builtin.assert: that: - tcp_vlan_id_list is defined - rocev2_vlan_id_list is defined @@ -38,12 +38,12 @@ fail_msg: "{{ inventory_hostname }} needs 'tcp_vlan_id_list' and 'rocev2_vlan_id_list' variables defined" - name: Query lldp remote - onyx_command: + ansible.builtin.onyx_command: commands: show lldp remote | json-print register: lldp_remote - name: Set lldp_interfaces var - set_fact: + ansible.builtin.set_fact: lldp_interfaces: >- {{ lldp_interfaces | d([]) + [{ diff --git a/roles/get_subsystem_nqns/tasks/main.yml b/roles/get_subsystem_nqns/tasks/main.yml index 712f5bf0..561dd7e7 100644 --- a/roles/get_subsystem_nqns/tasks/main.yml +++ b/roles/get_subsystem_nqns/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get Subsystems NQNs - command: | + ansible.builtin.command: | grep -oP '^ NQN \Knqn\..+' {{ target_conf_file }} register: nqn_list become: true @@ -38,10 +38,10 @@ when: dss_target_mode is search('kv_block') - name: Assert subsystems found - assert: + ansible.builtin.assert: that: nqn_list.stdout_lines | length > 0 msg: Subsystems not found. - name: Set subsystem_nqns var - set_fact: + ansible.builtin.set_fact: subsystem_nqns: "{{ nqn_list.stdout_lines }}" diff --git a/roles/get_tcp_numa/tasks/get_tcp_numa.yml b/roles/get_tcp_numa/tasks/get_tcp_numa.yml index 950fd82b..2c19772e 100644 --- a/roles/get_tcp_numa/tasks/get_tcp_numa.yml +++ b/roles/get_tcp_numa/tasks/get_tcp_numa.yml @@ -30,29 +30,29 @@ --- - name: Assert tcp_alias_list is defined - assert: + ansible.builtin.assert: that: tcp_alias_list is defined msg: | tcp_alias_list is not defined. get_tcp_vlan_ip_list role must be included. - name: Get num. NUMA nodes - shell: | + ansible.builtin.shell: | lscpu | grep -oP 'NUMA node\(s\): +\K.+' changed_when: false register: lscpu_num_numa - name: Set num_numa var - set_fact: + ansible.builtin.set_fact: num_numa: "{{ lscpu_num_numa.stdout | int }}" - name: Get numa / socket allocation - shell: "lscpu --parse=NODE,SOCKET | sort -u | grep -v '#'" + ansible.builtin.shell: "lscpu --parse=NODE,SOCKET | sort -u | grep -v '#'" register: lscpu_numa_socket changed_when: false - name: Set numa_socket var - set_fact: + ansible.builtin.set_fact: numa_socket: "{{ numa_socket | default([]) + [{ 'numa': item | regex_search(numa_socket_re, '\\1') | first | int, @@ -64,12 +64,12 @@ numa_socket_re: '([^,]+),(.+)' - name: Set can_interleave var - set_fact: + ansible.builtin.set_fact: can_interleave: true when: (num_numa | int) / (tcp_alias_list | length) >= 2 - name: Assert more than one NUMA node - assert: + ansible.builtin.assert: that: num_numa | int > 1 msg: | NUMA Nodes: {{ num_numa }} @@ -81,7 +81,7 @@ ignore_errors: true - name: Set adjacent_numa_list var - set_fact: + ansible.builtin.set_fact: adjacent_numa_list: >- {{ adjacent_numa_list | default([]) }} + [ @@ -118,7 +118,7 @@ max_socket_numa: "{{ numa_socket | selectattr('socket', 'equalto', socket_num | int) | map(attribute='numa') | list | last }}" - name: Assert all adapters are on separate NUMA nodes - assert: + ansible.builtin.assert: that: num_adapters == num_adapters_with_unique_numa msg: | One or more adapters on the same NUMA node: @@ -133,7 +133,7 @@ ignore_errors: true - name: Assert optimal interleaved NUMA configuration - assert: + ansible.builtin.assert: that: numa != adjacent_numa msg: Network adapters are not in a optimal NUMA configuration. loop: "{{ adjacent_numa_list }}" @@ -146,7 +146,7 @@ ignore_errors: true - name: Assert NUMA belongs to only one socket - assert: + ansible.builtin.assert: that: numa_socket | selectattr('numa', 'equalto', numa) | map(attribute='socket') | list | length == 1 msg: NUMA belongs to more than one socket. NUMA configuration is not optimal. loop: "{{ tcp_alias_list | map(attribute='numa') | list }}" diff --git a/roles/get_tcp_numa/tasks/main.yml b/roles/get_tcp_numa/tasks/main.yml index 15f3e74a..d3c47b00 100644 --- a/roles/get_tcp_numa/tasks/main.yml +++ b/roles/get_tcp_numa/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Get TCP Numa only if adjacent_numa_list is not defined - include_tasks: get_tcp_numa.yml + ansible.builtin.include_tasks: get_tcp_numa.yml when: adjacent_numa_list is not defined diff --git a/roles/get_tcp_vlan_ip_list/tasks/main.yml b/roles/get_tcp_vlan_ip_list/tasks/main.yml index 3465ac65..b7037d5b 100644 --- a/roles/get_tcp_vlan_ip_list/tasks/main.yml +++ b/roles/get_tcp_vlan_ip_list/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Get all TCP IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ tcp_vlans }}" @@ -38,11 +38,11 @@ - tcp_ip_list is not defined - name: Set tcp_ip_list var - set_fact: + ansible.builtin.set_fact: tcp_ip_list: "{{ vlan_ip_list }}" when: - tcp_ip_list is not defined - name: Set TCP aliases - include_role: + ansible.builtin.include_role: name: configure_tcp_aliases diff --git a/roles/get_vlan_devices/tasks/main.yml b/roles/get_vlan_devices/tasks/main.yml index a2f93238..9a12706b 100644 --- a/roles/get_vlan_devices/tasks/main.yml +++ b/roles/get_vlan_devices/tasks/main.yml @@ -30,15 +30,15 @@ --- - name: Get list of Mellanox ports - include_role: + ansible.builtin.include_role: name: get_mlnx_ports - name: Initialize vlan_device_list variable - set_fact: + ansible.builtin.set_fact: vlan_device_list: [] - name: Append device to vlan_device_list - set_fact: + ansible.builtin.set_fact: vlan_device_list: "{{ vlan_device_list | default([]) + [ device ] }}" with_nested: - "{{ vlan_list }}" diff --git a/roles/get_vlan_ips/tasks/main.yml b/roles/get_vlan_ips/tasks/main.yml index 1304019d..51e7de32 100644 --- a/roles/get_vlan_ips/tasks/main.yml +++ b/roles/get_vlan_ips/tasks/main.yml @@ -30,16 +30,16 @@ --- - name: Get list of Mellanox ports - include_role: + ansible.builtin.include_role: name: get_mlnx_ports when: mellanox_ports is not defined - name: Initialize vlan_ip_list variable - set_fact: + ansible.builtin.set_fact: vlan_ip_list: [] - name: Set vlan_ip_list var - set_fact: + ansible.builtin.set_fact: vlan_ip_list: "{{ vlan_ip_list | default([]) }} {% for mellanox_device in mellanox_ports %} {% for vlan in vlan_list %} diff --git a/roles/get_vlan_map/tasks/main.yml b/roles/get_vlan_map/tasks/main.yml index 573e0ba9..ea5a8206 100644 --- a/roles/get_vlan_map/tasks/main.yml +++ b/roles/get_vlan_map/tasks/main.yml @@ -30,19 +30,19 @@ --- - name: Assert onyx group is defined - assert: + ansible.builtin.assert: that: "'onyx' in groups" msg: No hosts defined in onyx group. Cannot automatically configure VLANs. - name: Assert VLAN ID lists are defined - assert: + ansible.builtin.assert: that: - tcp_vlan_id_list is defined - rocev2_vlan_id_list is defined msg: "VLAN ID list var is not defined" - name: Set interface_switch_map_no_numa var - set_fact: + ansible.builtin.set_fact: interface_switch_map_no_numa: >- {{ interface_switch_map_no_numa | default([]) }} {%- for switch in groups['onyx'] -%} @@ -66,12 +66,12 @@ {%- endfor -%} - name: Assert links found - assert: + ansible.builtin.assert: that: interface_switch_map_no_numa | length > 0 msg: No links found for host on any switch. Check that NICs are connected to switch and that LLDPD is running. - name: Get NUMA - command: "cat /sys/class/net/{{ item.local_interface }}/device/numa_node" + ansible.builtin.command: "cat /sys/class/net/{{ item.local_interface }}/device/numa_node" changed_when: false loop: "{{ interface_switch_map_no_numa }}" loop_control: @@ -79,7 +79,7 @@ register: numa_node - name: Set interface_switch_map with NUMA - set_fact: + ansible.builtin.set_fact: interface_switch_map: "{{ interface_switch_map | default([]) }} + [ { @@ -95,7 +95,7 @@ label: "{{ item.item.local_interface }}" - name: Assert number of links is greater than or equal to number of VLANs on switch - assert: + ansible.builtin.assert: that: (num_links | int) * (num_vlans_per_port | int) >= num_vlans | int fail_msg: > Number of links ({{ num_links }}) times num_vlans_per_port ({{ num_vlans_per_port }}): {{ (num_links | int) * (num_vlans_per_port | int) }} @@ -114,7 +114,7 @@ num_links: "{{ interface_switch_map | selectattr('switch_name', 'equalto', switch) | list | count }}" - name: Set interface_switch_vlan_map - set_fact: + ansible.builtin.set_fact: interface_switch_vlan_map: | {{ interface_switch_vlan_map | default([]) }} {%- for switch in groups['onyx'] -%} @@ -152,7 +152,7 @@ {%- endfor -%} - name: Set NUMA-sorted combined_interface_switch_vlan_map - set_fact: + ansible.builtin.set_fact: combined_interface_switch_vlan_map: "{{ combined_interface_switch_vlan_map | default([]) }} + {{ hostvars[host].interface_switch_vlan_map }}" loop: "{{ ansible_play_hosts }}" loop_control: diff --git a/roles/identify_kvssd_firmware/tasks/main.yml b/roles/identify_kvssd_firmware/tasks/main.yml index 42dd5fcd..16606d00 100644 --- a/roles/identify_kvssd_firmware/tasks/main.yml +++ b/roles/identify_kvssd_firmware/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Identify kvssd firmware - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: '*.bin' delegate_to: localhost @@ -38,11 +38,11 @@ register: firmware_bin - name: Assert kvssd firmware found - assert: + ansible.builtin.assert: that: firmware_bin.files | count == 1 fail_msg: "Expected 1 but found {{ firmware_bin.files | count }} firmware files. Please download firmware bin to {{ artifacts_dir }}" success_msg: "Found {{ firmware_bin.files[0].path | basename }}" - name: Set target firmware version - set_fact: + ansible.builtin.set_fact: target_fw_version: "{{ (firmware_bin.files[0].path | basename ).split('_') | first }}" diff --git a/roles/load_mlnx_drivers/tasks/main.yml b/roles/load_mlnx_drivers/tasks/main.yml index 81e7bf72..df46f588 100644 --- a/roles/load_mlnx_drivers/tasks/main.yml +++ b/roles/load_mlnx_drivers/tasks/main.yml @@ -30,14 +30,14 @@ --- - name: Load Mellanox modules - modprobe: + ansible.builtin.modprobe: name: "{{ item }}" state: present become: true loop: "{{ load_mlnx_drivers_modules }}" - name: Create modules-load.d template - template: + ansible.builtin.template: src: dss_mlnx.conf.j2 dest: "{{ load_mlnx_drivers_path }}/{{ load_mlnx_drivers_script_name }}" mode: 0644 diff --git a/roles/remove_blobfs_files/tasks/main.yml b/roles/remove_blobfs_files/tasks/main.yml index 4e560358..496160a1 100644 --- a/roles/remove_blobfs_files/tasks/main.yml +++ b/roles/remove_blobfs_files/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Find BlobFS config files - find: + ansible.builtin.find: paths: "{{ target_conf_dir }}" patterns: blobfs.mkfs.in*.conf register: blobfs_conf_files - name: Remove BlobFS config files - file: + ansible.builtin.file: path: "{{ item.path }}" state: absent loop: "{{ blobfs_conf_files.files }}" @@ -45,7 +45,7 @@ become: true - name: Remove format_disks.sh files - file: + ansible.builtin.file: path: "{{ target_dir }}/bin/{{ item }}" state: absent loop: diff --git a/roles/remove_datamover_index/tasks/main.yml b/roles/remove_datamover_index/tasks/main.yml index 9dca60c5..eadff18a 100644 --- a/roles/remove_datamover_index/tasks/main.yml +++ b/roles/remove_datamover_index/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Remove datamover index file - file: + ansible.builtin.file: path: "{{ datamover_index_file }}" state: absent become: true diff --git a/roles/remove_dss_agent/tasks/main.yml b/roles/remove_dss_agent/tasks/main.yml index 4efe8f09..31ba6866 100644 --- a/roles/remove_dss_agent/tasks/main.yml +++ b/roles/remove_dss_agent/tasks/main.yml @@ -30,16 +30,15 @@ --- - name: Remove agent related packages - become: true - package: + ansible.builtin.package: name: "{{ item }}" state: absent loop: - nkvagent + become: true - name: Delete log files and config directories - become: true - file: + ansible.builtin.file: path: "{{ item }}" state: absent loop: @@ -47,3 +46,4 @@ - "{{ nkv_agent_conf_dir }}" - "{{ nkv_agent_tmp_dir }}" - "{{ dss_log_dir }}/subsystem_store.log" + become: true diff --git a/roles/remove_dss_diamond/tasks/main.yml b/roles/remove_dss_diamond/tasks/main.yml index d4451465..064508ca 100644 --- a/roles/remove_dss_diamond/tasks/main.yml +++ b/roles/remove_dss_diamond/tasks/main.yml @@ -30,10 +30,10 @@ --- - name: Gather service facts - service_facts: + ansible.builtin.service_facts: - name: Stop diamond service - systemd: + ansible.builtin.systemd_service: name: diamond state: stopped enabled: false @@ -41,7 +41,7 @@ become: true - name: Remove diamond configuration file and service script - file: + ansible.builtin.file: path: "{{ item }}" state: absent loop: @@ -50,6 +50,6 @@ become: true - name: Update systemd configuration - systemd: + ansible.builtin.systemd: daemon-reload: true become: true diff --git a/roles/remove_dss_software/tasks/main.yml b/roles/remove_dss_software/tasks/main.yml index f37196a5..a94fc8d4 100644 --- a/roles/remove_dss_software/tasks/main.yml +++ b/roles/remove_dss_software/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Remove DSS Software - file: + ansible.builtin.file: path: "{{ dss_path }}" state: absent loop: "{{ remove_dss_software_dir_list }}" diff --git a/roles/remove_etcd_gateway/tasks/main.yml b/roles/remove_etcd_gateway/tasks/main.yml index 0f88be9e..361c7114 100644 --- a/roles/remove_etcd_gateway/tasks/main.yml +++ b/roles/remove_etcd_gateway/tasks/main.yml @@ -31,11 +31,11 @@ - name: Remove etcd-gateway systemd unit become: true - file: + ansible.builtin.file: path: /etc/systemd/system/etcd-gateway.service state: absent -- name: systemctl daemon-reload +- name: Run systemctl daemon-reload become: true - systemd: + ansible.builtin.systemd: daemon_reload: true diff --git a/roles/remove_host_vlans/handlers/main.yml b/roles/remove_host_vlans/handlers/main.yml index 7a66c067..e43ecd6e 100644 --- a/roles/remove_host_vlans/handlers/main.yml +++ b/roles/remove_host_vlans/handlers/main.yml @@ -30,13 +30,13 @@ --- - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Restart network service - service: + ansible.builtin.service: name: "{{ network_service }}" state: restarted become: true - name: Reload facts - setup: + ansible.builtin.setup: diff --git a/roles/remove_host_vlans/tasks/main.yml b/roles/remove_host_vlans/tasks/main.yml index 4463bc5e..3226cc67 100644 --- a/roles/remove_host_vlans/tasks/main.yml +++ b/roles/remove_host_vlans/tasks/main.yml @@ -30,15 +30,15 @@ --- - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Get VLAN map - include_role: + ansible.builtin.include_role: name: get_vlan_map when: interface_switch_vlan_map is not defined - name: Remove existing VLAN configurations - file: + ansible.builtin.file: path: "/etc/sysconfig/network-scripts/ifcfg-{{ item }}" state: absent loop: "{{ ansible_interfaces }}" @@ -54,4 +54,4 @@ become: true - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers diff --git a/roles/remove_onyx_allowed_vlans/tasks/main.yml b/roles/remove_onyx_allowed_vlans/tasks/main.yml index a843f6ee..5939a371 100644 --- a/roles/remove_onyx_allowed_vlans/tasks/main.yml +++ b/roles/remove_onyx_allowed_vlans/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Find a host that has a defined combined_interface_switch_vlan_map - set_fact: + ansible.builtin.set_fact: combined_interface_switch_vlan_map: "{{ hostvars[host]['combined_interface_switch_vlan_map'] }}" loop: "{{ (groups['clients'] | d([]) + groups['servers'] | d([]) + groups['targets'] | d([]) + groups['hosts'] | d([])) | unique }}" loop_control: @@ -40,13 +40,13 @@ - combined_interface_switch_vlan_map is not defined - name: Assert combined_interface_switch_vlan_map is defined - assert: + ansible.builtin.assert: that: combined_interface_switch_vlan_map is defined fail_msg: Unable to obtain a list of MAC addresses from hosts. Check for playbook failures. quiet: true - name: Set switchport mode access - onyx_config: + ansible.builtin.onyx_config: lines: - "interface ethernet {{ link.switch_port }} switchport mode access" save: true diff --git a/roles/remove_ufm/tasks/main.yml b/roles/remove_ufm/tasks/main.yml index 0ad9fed4..bc9c4b64 100644 --- a/roles/remove_ufm/tasks/main.yml +++ b/roles/remove_ufm/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Stop and disable ufm service - systemd: + ansible.builtin.systemd: name: "{{ ufm_service_file | basename }}" state: stopped daemon_reload: true @@ -42,13 +42,13 @@ become: true - name: List stuck Fabric Manager processes - command: pgrep -f '[f]abricmanager.py' + ansible.builtin.command: pgrep -f '[f]abricmanager.py' changed_when: false failed_when: false register: fm_proc - name: Kill stuck Fabric Manager processes - command: "kill -9 {{ item }}" + ansible.builtin.command: "kill -9 {{ item }}" loop: "{{ fm_proc.stdout_lines }}" when: fm_proc.stdout_lines become: true diff --git a/roles/remove_ufm_etcd/tasks/main.yml b/roles/remove_ufm_etcd/tasks/main.yml index 45dcaae2..c02a9960 100644 --- a/roles/remove_ufm_etcd/tasks/main.yml +++ b/roles/remove_ufm_etcd/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Remove UFM yum Repository - yum_repository: + ansible.builtin.yum_repository: name: ufm state: absent become: true - name: Remove UFM Packages (yum) - yum: + ansible.builtin.yum: name: "{{ ufm_install_packages }}" state: absent disable_gpg_check: true diff --git a/roles/reset_spdk/tasks/main.yml b/roles/reset_spdk/tasks/main.yml index 5bbf3671..c0af7a43 100644 --- a/roles/reset_spdk/tasks/main.yml +++ b/roles/reset_spdk/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Stat DSS Target path - stat: + ansible.builtin.stat: path: "{{ target_bin_dir }}" register: dss_target_path - name: Move disks back to kernel mode (spdk reset) - command: /usr/bin/python2 ./dss_target.py reset + ansible.builtin.command: /usr/bin/python2 ./dss_target.py reset args: chdir: "{{ target_bin_dir }}" register: target_reset diff --git a/roles/start_compaction/tasks/main.yml b/roles/start_compaction/tasks/main.yml index b633556f..12a83eb5 100644 --- a/roles/start_compaction/tasks/main.yml +++ b/roles/start_compaction/tasks/main.yml @@ -30,17 +30,17 @@ --- - name: Get Subsystems NQNs - include_role: + ansible.builtin.include_role: name: get_subsystem_nqns - name: Start compaction - command: "{{ target_script_dir }}/dss_rpc.py -s /var/run/spdk.sock rdb_compact -n {{ item }}" + ansible.builtin.command: "{{ target_script_dir }}/dss_rpc.py -s /var/run/spdk.sock rdb_compact -n {{ item }}" loop: "{{ subsystem_nqns }}" become: true when: dss_target_mode is search('kv_block') and not hpos - name: Check compaction status - command: "{{ target_script_dir }}/dss_rpc.py -s /var/run/spdk.sock rdb_compact --get_status -n {{ item }}" + ansible.builtin.command: "{{ target_script_dir }}/dss_rpc.py -s /var/run/spdk.sock rdb_compact --get_status -n {{ item }}" register: compaction_status loop: "{{ subsystem_nqns }}" until: > diff --git a/roles/start_datamover/tasks/datamover_DEL.yml b/roles/start_datamover/tasks/datamover_DEL.yml index ce083a1f..bad82083 100644 --- a/roles/start_datamover/tasks/datamover_DEL.yml +++ b/roles/start_datamover/tasks/datamover_DEL.yml @@ -30,7 +30,7 @@ --- - name: Delete data with datamover - shell: > + ansible.builtin.shell: > source {{ gcc_setenv }} && python3 {{ datamover_dir }}/master_application.py {{ datamover_operation }} diff --git a/roles/start_datamover/tasks/datamover_GET.yml b/roles/start_datamover/tasks/datamover_GET.yml index 2d67175e..d658b24f 100644 --- a/roles/start_datamover/tasks/datamover_GET.yml +++ b/roles/start_datamover/tasks/datamover_GET.yml @@ -30,7 +30,7 @@ --- - name: Get data with datamover - shell: > + ansible.builtin.shell: > source {{ gcc_setenv }} && python3 {{ datamover_dir }}/master_application.py {{ datamover_operation }} diff --git a/roles/start_datamover/tasks/datamover_LIST.yml b/roles/start_datamover/tasks/datamover_LIST.yml index 27b04ae7..67817517 100644 --- a/roles/start_datamover/tasks/datamover_LIST.yml +++ b/roles/start_datamover/tasks/datamover_LIST.yml @@ -30,7 +30,7 @@ --- - name: List data with datamover - shell: > + ansible.builtin.shell: > source {{ gcc_setenv }} && python3 {{ datamover_dir }}/master_application.py {{ datamover_operation }} diff --git a/roles/start_datamover/tasks/datamover_PUT.yml b/roles/start_datamover/tasks/datamover_PUT.yml index 6b28e893..3257cd3f 100644 --- a/roles/start_datamover/tasks/datamover_PUT.yml +++ b/roles/start_datamover/tasks/datamover_PUT.yml @@ -30,7 +30,7 @@ --- - name: Upload NFS data with datamover - shell: > + ansible.builtin.shell: > source {{ gcc_setenv }} && python3 {{ datamover_dir }}/master_application.py {{ datamover_operation }} diff --git a/roles/start_datamover/tasks/datamover_TEST.yml b/roles/start_datamover/tasks/datamover_TEST.yml index c97336fe..98d20d48 100644 --- a/roles/start_datamover/tasks/datamover_TEST.yml +++ b/roles/start_datamover/tasks/datamover_TEST.yml @@ -30,7 +30,7 @@ --- - name: Test Datamover Data Integrity - shell: > + ansible.builtin.shell: > source {{ gcc_setenv }} && python3 {{ datamover_dir }}/master_application.py {{ datamover_operation }} diff --git a/roles/start_datamover/tasks/main.yml b/roles/start_datamover/tasks/main.yml index 21ead6cc..8736ff77 100644 --- a/roles/start_datamover/tasks/main.yml +++ b/roles/start_datamover/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Assert datamover_operation is valid - assert: + ansible.builtin.assert: that: datamover_operation in valid_operations msg: datamover_operation var must be one of {{ valid_operations }} vars: @@ -43,11 +43,11 @@ run_once: true - name: Create datamover config file - include_role: + ansible.builtin.include_role: name: create_datamover_conf - name: Set datamover vars - set_fact: + ansible.builtin.set_fact: dryrun_string: "{% if datamover_dryrun | bool %}--dryrun{% else %}{% endif %}" compaction_string: "{% if datamover_compaction | bool and dss_target_mode is search('kv_block') and not hpos %}--compaction yes{% else %}{% endif %}" data_integrity_string: "{% if datamover_data_integrity | bool %}--data_integrity{% else %}{% endif %}" @@ -55,11 +55,11 @@ prefix_string: "{% if datamover_prefix != '' %}--prefix={{ datamover_prefix }}{% else %}{% endif %}" - name: Cleanup Datamover - include_role: + ansible.builtin.include_role: name: cleanup_datamover - name: While you wait ... - debug: + ansible.builtin.debug: msg: | Datamover is about to execute. This could take a very long time, depending on the size of your dataset. @@ -74,16 +74,16 @@ label: '' - name: "Execute datamover - {{ datamover_operation }}" - include_tasks: "datamover_{{ datamover_operation }}.yml" + ansible.builtin.include_tasks: "datamover_{{ datamover_operation }}.yml" run_once: true - name: Print master_application.log - debug: + ansible.builtin.debug: msg: "{{ master_application.stdout }}" run_once: true - name: Assert no errors in master_application.log - assert: + ansible.builtin.assert: that: "item not in master_application.stdout" msg: Errors found in Datamover run_once: true diff --git a/roles/start_dss_agent/tasks/check_dss_agent.yml b/roles/start_dss_agent/tasks/check_dss_agent.yml index e9f720d9..8510a710 100644 --- a/roles/start_dss_agent/tasks/check_dss_agent.yml +++ b/roles/start_dss_agent/tasks/check_dss_agent.yml @@ -30,7 +30,7 @@ --- - name: Identify agent RPM - find: + ansible.builtin.find: path: "{{ artifacts_dir }}" patterns: 'nkvagent-*.rpm' delegate_to: localhost @@ -38,12 +38,12 @@ register: dss_agent_rpm - name: Identify newest version of agent RPM - set_fact: + ansible.builtin.set_fact: agent_rpm_file: "{{ (dss_agent_rpm.files | sort(attribute='mtime', reverse=true) | first).path }}" run_once: true - name: Check if agent RPM is installed - shell: "rpm -qa | grep {{ agent_rpm_file | basename | splitext | first }}" + ansible.builtin.shell: "rpm -qa | grep {{ agent_rpm_file | basename | splitext | first }}" args: warn: false register: agent_rpm_qa @@ -51,10 +51,10 @@ failed_when: false - name: Set agent_rpms_missing var - set_fact: + ansible.builtin.set_fact: agent_rpms_missing: true when: agent_rpm_qa.rc != 0 - name: Install agent - include_tasks: install_dss_agent.yml + ansible.builtin.include_tasks: install_dss_agent.yml when: agent_rpms_missing is defined diff --git a/roles/start_dss_agent/tasks/install_dss_agent.yml b/roles/start_dss_agent/tasks/install_dss_agent.yml index 7c614e57..8d4df940 100644 --- a/roles/start_dss_agent/tasks/install_dss_agent.yml +++ b/roles/start_dss_agent/tasks/install_dss_agent.yml @@ -30,7 +30,7 @@ --- - name: Install DSS Agent runtime dependencies - package: + ansible.builtin.package: name: "{{ item }}" state: present loop: @@ -43,7 +43,7 @@ become: true - name: Remove existing staging directory - file: + ansible.builtin.file: name: "{{ item }}" state: absent loop: @@ -51,7 +51,7 @@ become: true - name: Create RPM staging directory - file: + ansible.builtin.file: state: directory path: "{{ item }}" mode: 0755 @@ -59,13 +59,13 @@ - "{{ nkv_agent_tmp_dir }}" - name: Copy DSS Agent RPM - copy: + ansible.builtin.copy: src: "{{ agent_rpm_file }}" dest: "{{ nkv_agent_tmp_dir }}" mode: 0755 - name: Install DSS Agent RPM - yum: + ansible.builtin.yum: name: "{{ nkv_agent_tmp_dir }}/{{ agent_rpm_file | basename }}" allow_downgrade: true disable_gpg_check: true @@ -76,7 +76,7 @@ become: true - name: Check that target services are running - service: + ansible.builtin.service: name: "{{ item }}" register: service_status failed_when: service_status.status.ActiveState != "active" @@ -85,7 +85,7 @@ - kv_cli - name: Copy python script to remote location - template: + ansible.builtin.template: src: subsystem_store.py dest: "{{ dss_subsystem_script_temp_file }}" mode: 0755 @@ -93,11 +93,11 @@ - name: Wait for agent to gather all data on Target # May need to tune this - wait_for: timeout=70 + ansible.builtin.wait_for: timeout=70 when: agent_rpm_status.changed - name: Creating subsystem based on CONFIG file. - command: "python {{ dss_subsystem_script_temp_file }}" + ansible.builtin.command: "python {{ dss_subsystem_script_temp_file }}" register: subsys_store failed_when: false no_log: true @@ -105,7 +105,7 @@ become: true - name: Check status of subsystem configure script - fail: + ansible.builtin.fail: msg: "Error in configuring subsystem. Check {{ start_dss_agent_subsystem_log }}" when: - subsys_store is not skipped diff --git a/roles/start_dss_agent/tasks/main.yml b/roles/start_dss_agent/tasks/main.yml index f4d09130..8004ebf9 100644 --- a/roles/start_dss_agent/tasks/main.yml +++ b/roles/start_dss_agent/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Start DSS Agent if ufm_hosts group exists, and there are hosts in the group - include_tasks: check_dss_agent.yml + ansible.builtin.include_tasks: check_dss_agent.yml when: - groups['ufm_hosts'] is defined - groups['ufm_hosts'] | length > 0 -- name: start dss agent kv_cli systemd unit - systemd: +- name: Start dss agent kv_cli systemd unit + ansible.builtin.systemd: enabled: false state: started name: kv_cli diff --git a/roles/start_dss_host/tasks/configure_driver.yml b/roles/start_dss_host/tasks/configure_driver.yml index 3be4ba7e..bad9f966 100644 --- a/roles/start_dss_host/tasks/configure_driver.yml +++ b/roles/start_dss_host/tasks/configure_driver.yml @@ -33,12 +33,12 @@ block: - name: "Initialize subsystems_found var #{{ config_num }}" - set_fact: + ansible.builtin.set_fact: subsystems_found: [] post_subsystems_found: [] - name: "NVMe list subsystems - pre config_driver #{{ config_num }}" - command: nvme list-subsys + ansible.builtin.command: nvme list-subsys environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false @@ -46,20 +46,20 @@ become: true - name: "Check number of mounted subsystems #{{ config_num }}" - set_fact: + ansible.builtin.set_fact: subsystems_found: "{{ nvme_subsys.stdout | regex_findall(nvme_re) | length }}" vars: nvme_re: 'traddr=[^\s]+\strsvcid=[^\s]+\slive' - name: "Configure Driver #{{ config_num }}" - command: sh ./dss_host_config_host.sh + ansible.builtin.command: sh ./dss_host_config_host.sh args: chdir: "{{ nkv_sdk_bin_dir }}" when: subsystems_found != combined_expected_num_subsystems become: true - name: "NVMe list subsystems - post config_driver #{{ config_num }}" - command: nvme list-subsys + ansible.builtin.command: nvme list-subsys environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false @@ -67,13 +67,13 @@ become: true - name: "Post-Check subsystems are mounted #{{ config_num }}" - set_fact: + ansible.builtin.set_fact: post_subsystems_found: "{{ post_nvme_subsys.stdout | regex_findall(nvme_re) | length }}" vars: nvme_re: 'traddr=[^\s]+\strsvcid=[^\s]+\slive' - name: "Check all subsystems are mounted #{{ config_num }}" - set_fact: + ansible.builtin.set_fact: all_subsystems_mounted: true when: post_subsystems_found == combined_expected_num_subsystems when: all_subsystems_mounted is not defined diff --git a/roles/start_dss_host/tasks/main.yml b/roles/start_dss_host/tasks/main.yml index 8c7c72de..9cd3462a 100644 --- a/roles/start_dss_host/tasks/main.yml +++ b/roles/start_dss_host/tasks/main.yml @@ -30,24 +30,24 @@ --- - name: Set target/host group vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" - name: Stat DSS Host path - stat: + ansible.builtin.stat: path: "{{ nkv_sdk_dir }}" register: dss_host_path when: inventory_hostname in host_hostnames - name: Assert DSS Host path exists - assert: + ansible.builtin.assert: that: dss_host_path.stat.exists fail_msg: DSS Host is not installed. Execute 'deploy_dss_software.yml' playbook first. when: inventory_hostname in host_hostnames - name: Stat KV kernel drivers - stat: + ansible.builtin.stat: path: "{{ nkv_sdk_dir }}/openmpdk_driver/kernel_v5.1_nvmf/{{ item }}" register: kv_kernel_drivers loop: @@ -60,7 +60,7 @@ when: inventory_hostname in host_hostnames - name: Check for missing KV kernel drivers - set_fact: + ansible.builtin.set_fact: missing_drivers: true when: - inventory_hostname in host_hostnames @@ -70,7 +70,7 @@ label: "{{ item.item }}" - name: Configure Driver - command: /usr/bin/python2 ./dss_host.py config_driver + ansible.builtin.command: /usr/bin/python2 ./dss_host.py config_driver args: chdir: "{{ nkv_sdk_bin_dir }}" when: @@ -79,7 +79,7 @@ become: true - name: Set cluster_num_list var - set_fact: + ansible.builtin.set_fact: cluster_num_list: "{{ cluster_num_list | default([]) }} + [ {% for host in ansible_play_hosts %} @@ -90,7 +90,7 @@ run_once: true - name: Setup hosts by cluster - include_tasks: setup_host_clusters.yml + ansible.builtin.include_tasks: setup_host_clusters.yml loop: "{{ cluster_num_list | unique }}" loop_control: loop_var: current_cluster_num diff --git a/roles/start_dss_host/tasks/setup_host_clusters.yml b/roles/start_dss_host/tasks/setup_host_clusters.yml index 384a478c..b7583138 100644 --- a/roles/start_dss_host/tasks/setup_host_clusters.yml +++ b/roles/start_dss_host/tasks/setup_host_clusters.yml @@ -30,13 +30,13 @@ --- - name: Init vars - set_fact: + ansible.builtin.set_fact: included_targets: [] first_vlan_ip_list: [] combined_expected_num_subsystems: 0 - name: Set included_targets var - set_fact: + ansible.builtin.set_fact: included_targets: "{{ included_targets + [ target ] }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -47,25 +47,25 @@ run_once: true - name: Get RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list and first_rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" first_rocev2_ip_list: "{{ vlan_ip_list | first }}" when: rocev2_ip_list is not defined - name: Set first_rocev2_ip_list var if IP's user-defined - set_fact: + ansible.builtin.set_fact: first_rocev2_ip_list: "{{ rocev2_ip_list | first }}" when: rocev2_ip_list is defined - name: Assert that at least one RoCEv2 IP is present - assert: + ansible.builtin.assert: that: - first_rocev2_ip_list is defined - first_rocev2_ip_list | length > 0 @@ -73,7 +73,7 @@ success_msg: "RoCEv2 IP(s) detected." - name: Set first_vlan_ip_list var - set_fact: + ansible.builtin.set_fact: first_vlan_ip_list: "{{ first_vlan_ip_list + [hostvars[host].first_rocev2_ip_list] }}" loop: "{{ included_targets }}" loop_control: @@ -81,19 +81,19 @@ run_once: true - name: Check number of listeners in nvmf.in.conf - shell: | + ansible.builtin.shell: | grep '^ Listen RDMA' {{ target_conf_file }} | wc -l changed_when: false register: num_listeners when: inventory_hostname in included_targets - name: Set expected_num_subsystems var - set_fact: + ansible.builtin.set_fact: expected_num_subsystems: "{{ num_listeners.stdout }}" when: inventory_hostname in included_targets - name: Set combined_expected_num_subsystems var - set_fact: + ansible.builtin.set_fact: combined_expected_num_subsystems: "{{ combined_expected_num_subsystems | int + hostvars[host].expected_num_subsystems | int }}" loop: "{{ included_targets }}" loop_control: @@ -101,11 +101,11 @@ run_once: true - name: Get Combined VLAN IP map - include_role: + ansible.builtin.include_role: name: get_combined_vlan_ip_map - name: Create dss_host_config_host.sh script - copy: + ansible.builtin.copy: content: > /usr/bin/python2 ./dss_host.py config_host -a {% for ip in first_vlan_ip_list %}{{ ip }}{% if not loop.last %} {% endif %}{% endfor %} @@ -127,14 +127,14 @@ become: true - name: Configure Driver - include_tasks: configure_driver.yml + ansible.builtin.include_tasks: configure_driver.yml loop: "{{ range(1,4) | list }}" loop_control: loop_var: config_num when: inventory_hostname in host_hostnames - name: Assert all subsystems are mounted - assert: + ansible.builtin.assert: that: - all_subsystems_mounted is defined - all_subsystems_mounted == true @@ -145,7 +145,7 @@ when: inventory_hostname in host_hostnames - name: Execute dss_host_config_host.sh script - command: sh ./dss_host_config_host.sh + ansible.builtin.command: sh ./dss_host_config_host.sh args: chdir: "{{ nkv_sdk_bin_dir }}" when: diff --git a/roles/start_dss_minio/tasks/generate_scripts.yml b/roles/start_dss_minio/tasks/generate_scripts.yml index f7b264c7..60d3d814 100644 --- a/roles/start_dss_minio/tasks/generate_scripts.yml +++ b/roles/start_dss_minio/tasks/generate_scripts.yml @@ -30,23 +30,23 @@ --- - name: Get TCP IP lists and NUMA - include_role: + ansible.builtin.include_role: name: get_tcp_numa - name: Assert distributed minio minimum mountpoints - assert: + ansible.builtin.assert: that: (nvme_mountpoints | length / tcp_alias_list | length) >= 4 msg: Minimum of 4 subsystems per distributed minio required. when: not standalone_minio - name: Assert standalone minio minimum mountpoints - assert: + ansible.builtin.assert: that: nvme_mountpoints | length >= 4 msg: Minimum of 4 subsystems required for standalone minio. when: standalone_minio - name: Create minio scripts - template: + ansible.builtin.template: src: minio_startup.sh.j2 dest: "{{ nkv_sdk_bin_dir }}/minio_startup_{{ tcp_alias }}.sh" mode: 0751 @@ -64,13 +64,13 @@ my_range: "{{ subsys_range[ansible_loop.index0] }}" - name: Stat nkv_config scripts - stat: + ansible.builtin.stat: path: "{{ nkv_sdk_conf_dir }}/nkv_config_{{ item }}.json" loop: "{{ rocev2_ip_list }}" register: nkv_config_scripts - name: Assert nkv_config scripts exist - assert: + ansible.builtin.assert: that: "{{ nkv_config_scripts.results[item].stat.exists }}" msg: | nkv_config script does not exist: diff --git a/roles/start_dss_minio/tasks/main.yml b/roles/start_dss_minio/tasks/main.yml index 592b4b4e..673c6bb1 100644 --- a/roles/start_dss_minio/tasks/main.yml +++ b/roles/start_dss_minio/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Start MinIO - include_tasks: start_minio.yml + ansible.builtin.include_tasks: start_minio.yml when: not no_minio | d(false) diff --git a/roles/start_dss_minio/tasks/start_minio.yml b/roles/start_dss_minio/tasks/start_minio.yml index 2713d86a..460d5fb1 100644 --- a/roles/start_dss_minio/tasks/start_minio.yml +++ b/roles/start_dss_minio/tasks/start_minio.yml @@ -30,12 +30,12 @@ --- - name: Set target/host group vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" - name: Assert collocated deployment - assert: + ansible.builtin.assert: that: (groups['hosts'] | d([])) | length == 0 msg: | Choose either collocated or disaggregated deployment. @@ -44,7 +44,7 @@ when: inventory_hostname in (groups['servers'] | d([])) - name: Assert disaggregated deployment - assert: + ansible.builtin.assert: that: (groups['servers'] | d([])) | length == 0 msg: | Choose either collocated or disaggregated deployment. @@ -53,31 +53,31 @@ when: inventory_hostname in (groups['hosts'] | d([])) - name: Stat DSS Minio path - stat: + ansible.builtin.stat: path: "{{ minio_dir }}" register: dss_minio_path when: inventory_hostname in host_hostnames - name: Assert DSS Minio path exists - assert: + ansible.builtin.assert: that: dss_minio_path.stat.exists fail_msg: DSS Minio is not installed. Execute 'deploy_dss_software.yml' playbook first. when: inventory_hostname in host_hostnames - name: Stat DSS Host path - stat: + ansible.builtin.stat: path: "{{ nkv_sdk_bin_dir }}" register: dss_host_path when: inventory_hostname in host_hostnames - name: Assert DSS Host path exists - assert: + ansible.builtin.assert: that: dss_host_path.stat.exists fail_msg: DSS Host is not installed. Execute 'deploy_dss_software.yml' playbook first. when: inventory_hostname in host_hostnames - name: Set cluster_num_list var - set_fact: + ansible.builtin.set_fact: cluster_num_list: "{{ cluster_num_list | default([]) }} + [ {% for host in ansible_play_hosts %} @@ -88,19 +88,19 @@ run_once: true - name: Get all RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Start minio by cluster - include_tasks: start_minio_clusters.yml + ansible.builtin.include_tasks: start_minio_clusters.yml loop: "{{ cluster_num_list | unique }}" loop_control: loop_var: current_cluster_num diff --git a/roles/start_dss_minio/tasks/start_minio_clusters.yml b/roles/start_dss_minio/tasks/start_minio_clusters.yml index f8a1411a..24939358 100644 --- a/roles/start_dss_minio/tasks/start_minio_clusters.yml +++ b/roles/start_dss_minio/tasks/start_minio_clusters.yml @@ -30,22 +30,22 @@ --- - name: Get Mountpoints - include_role: + ansible.builtin.include_role: name: get_mountpoints - name: Generate minio startup scripts - include_tasks: generate_scripts.yml + ansible.builtin.include_tasks: generate_scripts.yml when: inventory_hostname in host_hostnames - name: Check for running minio instances - command: "pgrep -ax minio" + ansible.builtin.command: "pgrep -ax minio" register: minio_ps changed_when: false failed_when: false when: inventory_hostname in host_hostnames - name: Start minio instances - shell: > + ansible.builtin.shell: > sleep 1 && nohup ./minio_startup_{{ tcp_alias }}.sh > {{ dss_log_dir }}/nkv-minio_{{ tcp_alias }}.log 2>&1 & @@ -64,14 +64,14 @@ become: true - name: Check for running minio instances post-start - command: "pgrep -ax minio" + ansible.builtin.command: "pgrep -ax minio" register: post_minio_ps changed_when: false failed_when: false when: inventory_hostname in host_hostnames - name: Assert minio instances running - assert: + ansible.builtin.assert: that: server_string in post_minio_ps.stdout fail_msg: Minio instance not running quiet: true @@ -84,7 +84,7 @@ when: inventory_hostname in host_hostnames - name: Assert minio instances online - command: "cat {{ dss_log_dir }}/nkv-minio_{{ tcp_alias }}.log" + ansible.builtin.command: "cat {{ dss_log_dir }}/nkv-minio_{{ tcp_alias }}.log" loop: "{{ tcp_alias_list }}" changed_when: false loop_control: diff --git a/roles/start_dss_target/handlers/main.yml b/roles/start_dss_target/handlers/main.yml index 0fbcc812..9efa6460 100644 --- a/roles/start_dss_target/handlers/main.yml +++ b/roles/start_dss_target/handlers/main.yml @@ -30,12 +30,12 @@ --- - name: Identify UEFI boot for hugepages - stat: + ansible.builtin.stat: path: /sys/firmware/efi register: uefi - name: Execute grub2-mkconfig for hugepages - command: "grub2-mkconfig -o {{ grubpath }}" + ansible.builtin.command: "grub2-mkconfig -o {{ grubpath }}" become: true vars: grubpath: "/boot/{% if uefi.stat.exists %}efi/EFI/centos{% else %}grub2{% endif %}/grub.cfg" diff --git a/roles/start_dss_target/tasks/check_hugepages.yml b/roles/start_dss_target/tasks/check_hugepages.yml index f1c107d8..48f35364 100644 --- a/roles/start_dss_target/tasks/check_hugepages.yml +++ b/roles/start_dss_target/tasks/check_hugepages.yml @@ -30,17 +30,17 @@ --- - name: Check 2MB hugepages - command: cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + ansible.builtin.command: cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages changed_when: false register: current_2mb_hugepages - name: Check 1GB hugepages - command: cat /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages + ansible.builtin.command: cat /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages changed_when: false register: current_1gb_hugepages - name: Assert hugepages are set - assert: + ansible.builtin.assert: that: - current_2mb_hugepages.stdout | int == num_2mb_hugepages - current_1gb_hugepages.stdout | int == num_1gb_hugepages diff --git a/roles/start_dss_target/tasks/dss_target.yml b/roles/start_dss_target/tasks/dss_target.yml index 6ffae753..0ccac06d 100644 --- a/roles/start_dss_target/tasks/dss_target.yml +++ b/roles/start_dss_target/tasks/dss_target.yml @@ -30,27 +30,27 @@ --- - name: Set hugepages - include_tasks: set_num_hugepages.yml + ansible.builtin.include_tasks: set_num_hugepages.yml - name: Identify kvssd firmware - include_role: + ansible.builtin.include_role: name: identify_kvssd_firmware when: target_fw_version is not defined - name: Get RoCEv2 IP Address - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Assert that at least one RoCEv2 IP is present - assert: + ansible.builtin.assert: that: - rocev2_ip_list is defined - rocev2_ip_list | length > 0 @@ -58,7 +58,7 @@ success_msg: "RoCEv2 IP(s) detected." - name: Create dss_target_config.sh script - copy: + ansible.builtin.copy: content: | export PCI_BLACKLIST="{{ pci_blacklist | d('') }}" /usr/bin/python2 ./dss_target.py configure \ @@ -82,14 +82,14 @@ become: true - name: Reset SPDK - include_role: + ansible.builtin.include_role: name: reset_spdk when: - dss_target_config_script.changed - spdk_status.stdout is search('uio_pci_generic') - name: Configure target with dss_target_config.sh script - command: sh ./dss_target_config.sh + ansible.builtin.command: sh ./dss_target_config.sh args: chdir: "{{ target_dir }}/bin" register: dss_target_configure @@ -101,7 +101,7 @@ (spdk_status.stdout is not search('uio_pci_generic')) and (spdk_status.stdout is not search('vfio-pci')) - name: Assert dss_target.py success - assert: + ansible.builtin.assert: that: - "'drive setup to system is done' in dss_target_configure.stdout" - "'hugepage setup is done' in dss_target_configure.stdout" @@ -118,7 +118,7 @@ when: dss_target_configure.changed - name: Save output of dss_target.py - copy: + ansible.builtin.copy: content: "{{ dss_target_configure.stdout }}" dest: "{{ target_dir }}/bin/dss_target.out" mode: 0644 @@ -126,5 +126,5 @@ when: dss_target_configure.changed - name: Check hugepages - include_tasks: check_hugepages.yml + ansible.builtin.include_tasks: check_hugepages.yml when: dss_target_configure.changed diff --git a/roles/start_dss_target/tasks/main.yml b/roles/start_dss_target/tasks/main.yml index 87f1473e..fc1949c4 100644 --- a/roles/start_dss_target/tasks/main.yml +++ b/roles/start_dss_target/tasks/main.yml @@ -30,27 +30,27 @@ --- - name: Stat DSS Target path - stat: + ansible.builtin.stat: path: "{{ target_dir }}" register: dss_target_path - name: Assert DSS Target path exists - assert: + ansible.builtin.assert: that: dss_target_path.stat.exists fail_msg: DSS Target is not installed. Execute 'deploy_dss_software.yml' playbook first. - name: Stat nvmf.in.conf - stat: + ansible.builtin.stat: path: "{{ target_conf_file }}" register: nvmf_in_conf - name: Stat dss_target.out - stat: + ansible.builtin.stat: path: "{{ target_dir }}/bin/dss_target.out" register: dss_target_out - name: Get spdk status - command: ./setup.sh status + ansible.builtin.command: ./setup.sh status changed_when: false args: chdir: "{{ target_dir }}/scripts" @@ -58,47 +58,47 @@ become: true - name: Run dss_target.py script - include_tasks: dss_target.yml + ansible.builtin.include_tasks: dss_target.yml - name: Find NVMe PCIe addresses in nvmf.in.conf - command: > + ansible.builtin.command: > grep 'TransportID "trtype:PCIe traddr' {{ target_conf_file }} register: pcie_addrs changed_when: false failed_when: false - name: Assert PCIe addresses found - assert: + ansible.builtin.assert: that: pcie_addrs.stdout_lines | length > 0 msg: | Disk serial numbers not found in nvmf.in.conf for firmware {{ target_fw_version }} Please verify that 'target_fw_version' var matches desired firmware. - name: Format BlobFS - include_role: + ansible.builtin.include_role: name: format_blobfs when: dss_target_mode is search('kv_block') - name: Read dss_target.out - command: "cat {{ target_dir }}/bin/dss_target.out" + ansible.builtin.command: "cat {{ target_dir }}/bin/dss_target.out" become: true changed_when: false register: dss_target_out - name: Get nvmf_tgt command from dss_target.py script - set_fact: + ansible.builtin.set_fact: nvmf_tgt_cmd: "{{ dss_target_out.stdout | regex_search(nvmf_tgt_re, '\\1') | first }}" vars: nvmf_tgt_re: 'Execute the following command to start the target application: (.+)' - name: Insert nohup into nvmf_tgt_cmd var - set_fact: + ansible.builtin.set_fact: nvmf_tgt_cmd: "{{ nvmf_tgt_cmd | regex_replace(nvmf_tgt_re, 'nohup \\1') }}" vars: nvmf_tgt_re: '(\/[^ ]+nvmf_tgt)' - name: Set nvmf_tgt command if custom_coremask is defined - set_fact: + ansible.builtin.set_fact: nvmf_tgt_cmd: >- nohup {{ target_dir }}/bin/nvmf_tgt @@ -108,23 +108,23 @@ when: custom_coremask is defined - name: Find running target process - command: "pgrep reactor_" + ansible.builtin.command: "pgrep reactor_" register: nvmf_ps changed_when: false failed_when: false - name: Stat XRT script - stat: + ansible.builtin.stat: path: "{{ xrt_setenv }}" register: xrt_setenv_script - name: Assert XRT script exists - assert: + ansible.builtin.assert: that: xrt_setenv_script.stat.exists when: hpos - name: Start DSS target process - shell: > + ansible.builtin.shell: > {% if xrt_setenv_script.stat.exists %} source {{ xrt_setenv }} && {% endif %} @@ -136,7 +136,7 @@ become: true - name: Wait for subsystems to initialize - command: "cat {{ dss_log_dir }}/nkv-target.log" + ansible.builtin.command: "cat {{ dss_log_dir }}/nkv-target.log" changed_when: false failed_when: false register: subsystem_initialized @@ -150,7 +150,7 @@ delay: 5 - name: Assert subsystems initialized - assert: + ansible.builtin.assert: that: not subsystem_initialized.failed fail_msg: | One or more subsystems failed to initialize. diff --git a/roles/start_dss_target/tasks/set_num_hugepages.yml b/roles/start_dss_target/tasks/set_num_hugepages.yml index 681fa9d1..17e34082 100644 --- a/roles/start_dss_target/tasks/set_num_hugepages.yml +++ b/roles/start_dss_target/tasks/set_num_hugepages.yml @@ -30,7 +30,7 @@ --- - name: Set Hugepages vars for VMs - set_fact: + ansible.builtin.set_fact: num_2mb_hugepages: 12288 num_1gb_hugepages: 0 when: @@ -39,7 +39,7 @@ - num_1gb_hugepages is not defined - name: Set Hugepages vars for physical hosts - set_fact: + ansible.builtin.set_fact: num_2mb_hugepages: 12288 num_1gb_hugepages: 200 when: @@ -48,17 +48,17 @@ - num_1gb_hugepages is not defined - name: Check 2MB hugepages - command: cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + ansible.builtin.command: cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages changed_when: false register: current_2mb_hugepages - name: Check 1GB hugepages - command: cat /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages + ansible.builtin.command: cat /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages changed_when: false register: current_1gb_hugepages - name: Assert host has sufficient memory to allocate hugepages - assert: + ansible.builtin.assert: that: free_memory_plus_current_hugepages | int > (num_2mb_hugepages | int * 2) + (num_1gb_hugepages | int * 1024) fail_msg: | Currently allocated hugepages: {{ current_total_hugepages_mb }} MB @@ -75,21 +75,21 @@ free_memory_plus_current_hugepages: "{{ ansible_memory_mb.nocache.free | int + current_total_hugepages_mb | int }}" - name: Zero 2MB hugepages - shell: echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + ansible.builtin.shell: echo 0 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages when: - current_2mb_hugepages.stdout | int != num_2mb_hugepages - current_2mb_hugepages.stdout | int != 0 become: true - name: Zero 1GB hugepages - shell: echo 0 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages + ansible.builtin.shell: echo 0 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages when: - current_1gb_hugepages.stdout | int != num_1gb_hugepages - current_1gb_hugepages.stdout | int != 0 become: true - name: Set GRUB_CMDLINE_LINUX hugepages options - lineinfile: + ansible.builtin.lineinfile: path: /etc/default/grub state: present backrefs: true @@ -109,4 +109,4 @@ become: true - name: Flush handlers - meta: flush_handlers + ansible.builtin.meta: flush_handlers diff --git a/roles/start_etcd_gateway/tasks/main.yml b/roles/start_etcd_gateway/tasks/main.yml index d4a6e674..0b3cab11 100644 --- a/roles/start_etcd_gateway/tasks/main.yml +++ b/roles/start_etcd_gateway/tasks/main.yml @@ -30,11 +30,11 @@ --- - name: Gather service facts - service_facts: + ansible.builtin.service_facts: - name: Start etcd-gateway systemd unit become: true - systemd: + ansible.builtin.systemd: enabled: true state: started name: etcd-gateway diff --git a/roles/start_ufm_etcd/tasks/add_cluster.yml b/roles/start_ufm_etcd/tasks/add_cluster.yml index e67fdd9f..23599c0e 100644 --- a/roles/start_ufm_etcd/tasks/add_cluster.yml +++ b/roles/start_ufm_etcd/tasks/add_cluster.yml @@ -30,40 +30,40 @@ --- - name: Check Cluster ID - command: etcdctl get /cluster/id --print-value-only + ansible.builtin.command: etcdctl get /cluster/id --print-value-only environment: ETCDCTL_API: 3 changed_when: false register: cluster_id - name: Check Cluster time_created - command: etcdctl get /cluster/time_created --print-value-only + ansible.builtin.command: etcdctl get /cluster/time_created --print-value-only environment: ETCDCTL_API: 3 changed_when: false register: cluster_time_created - name: Add Cluster ID - etcd3: + ansible.builtin.etcd3: key: /cluster/id value: "{{ ansible_date_time.iso8601_micro | to_uuid }}" state: present when: cluster_id.stdout | length == 0 - name: Add Cluster Name - etcd3: + ansible.builtin.etcd3: key: /cluster/name value: "{{ ufm_etcd_token }}" state: present - name: Add Cluster IP address - etcd3: + ansible.builtin.etcd3: key: /cluster/ip_address value: "{{ hostvars[groups[group_names[0]][0]].tcp_alias_list[0].tcp_ip | ipwrap }}" state: present - name: Add Cluster time_created - etcd3: + ansible.builtin.etcd3: key: /cluster/time_created value: "{{ ansible_date_time.epoch }}" state: present diff --git a/roles/start_ufm_etcd/tasks/add_cm_node.yml b/roles/start_ufm_etcd/tasks/add_cm_node.yml index d7aea3a2..92a288ff 100644 --- a/roles/start_ufm_etcd/tasks/add_cm_node.yml +++ b/roles/start_ufm_etcd/tasks/add_cm_node.yml @@ -30,35 +30,35 @@ --- - name: Check CM Node id - command: "etcdctl get /cluster/{{ ansible_hostname | lower }}/id --print-value-only" + ansible.builtin.command: "etcdctl get /cluster/{{ ansible_hostname | lower }}/id --print-value-only" environment: ETCDCTL_API: 3 changed_when: false register: cm_id - name: Check CM Node time_created - command: "etcdctl get /cluster/{{ ansible_hostname | lower }}/time_created --print-value-only" + ansible.builtin.command: "etcdctl get /cluster/{{ ansible_hostname | lower }}/time_created --print-value-only" environment: ETCDCTL_API: 3 changed_when: false register: cm_time_created - name: Add CM Node ID - etcd3: + ansible.builtin.etcd3: key: "/cluster/{{ ansible_hostname | lower }}/id" value: "{{ ansible_date_time.iso8601_micro | to_uuid }}" state: present when: cm_id.stdout | length == 0 - name: Add CM Node time_created - etcd3: + ansible.builtin.etcd3: key: "/cluster/{{ ansible_hostname | lower }}/time_created" value: "{{ ansible_date_time.epoch }}" state: present when: cm_time_created.stdout | length == 0 - name: Add CM Node ip_address - etcd3: + ansible.builtin.etcd3: key: "/cluster/{{ ansible_hostname | lower }}/ip_address" value: "{{ tcp_alias_list[0].alias }}" state: present diff --git a/roles/start_ufm_etcd/tasks/main.yml b/roles/start_ufm_etcd/tasks/main.yml index 19fe2793..05c965da 100644 --- a/roles/start_ufm_etcd/tasks/main.yml +++ b/roles/start_ufm_etcd/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Generate service file for the etcd cluster - template: + ansible.builtin.template: src: ufm_etcd.service.j2 dest: "{{ ufm_etcd_service_file }}" mode: 0644 @@ -38,7 +38,7 @@ become: true - name: Restart ufm_etcd service if service file changed - systemd: + ansible.builtin.systemd_service: name: "{{ ufm_etcd_service_file | basename }}" state: restarted enabled: true @@ -46,8 +46,8 @@ when: service_file.changed become: true -- name: ufm_etcd service is started and enabled - systemd: +- name: Start and enable ufm_etcd service + ansible.builtin.systemd_service: name: "{{ ufm_etcd_service_file | basename }}" state: started enabled: true @@ -55,8 +55,8 @@ become: true - name: Add etcd Cluster - import_tasks: add_cluster.yml + ansible.builtin.import_tasks: add_cluster.yml run_once: true - name: Add etcd CM Node - import_tasks: add_cm_node.yml + ansible.builtin.import_tasks: add_cm_node.yml diff --git a/roles/stop_dss_agent/tasks/main.yml b/roles/stop_dss_agent/tasks/main.yml index 9ede7e4b..bb204dbb 100644 --- a/roles/stop_dss_agent/tasks/main.yml +++ b/roles/stop_dss_agent/tasks/main.yml @@ -30,10 +30,10 @@ --- - name: Gather service facts - service_facts: + ansible.builtin.service_facts: -- name: stop dss agent kv_cli systemd unit - systemd: +- name: Stop dss agent kv_cli systemd unit + ansible.builtin.systemd: enabled: false state: stopped name: kv_cli diff --git a/roles/stop_dss_host/tasks/main.yml b/roles/stop_dss_host/tasks/main.yml index 9e45ae61..0307af11 100644 --- a/roles/stop_dss_host/tasks/main.yml +++ b/roles/stop_dss_host/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Stat DSS Host bin path - stat: + ansible.builtin.stat: path: "{{ nkv_sdk_bin_dir }}" register: dss_host_path - name: Execute dss_host.py remove script - command: /usr/bin/python2 ./dss_host.py remove + ansible.builtin.command: /usr/bin/python2 ./dss_host.py remove args: chdir: "{{ nkv_sdk_bin_dir }}" when: dss_host_path.stat.exists diff --git a/roles/stop_dss_minio/tasks/main.yml b/roles/stop_dss_minio/tasks/main.yml index 13739e8e..d929db50 100644 --- a/roles/stop_dss_minio/tasks/main.yml +++ b/roles/stop_dss_minio/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Check for running minio instances - command: "pgrep -x minio" + ansible.builtin.command: "pgrep -x minio" register: minio_ps changed_when: false failed_when: false - name: Kill -2 minio processes - command: "kill -2 {{ pid }}" + ansible.builtin.command: "kill -2 {{ pid }}" register: kill_minio changed_when: kill_minio.stdout is not search('No such process') failed_when: false @@ -46,7 +46,7 @@ become: true - name: Wait for minio processes to stop - command: "pgrep -x minio" + ansible.builtin.command: "pgrep -x minio" register: postminio_ps until: postminio_ps.rc != 0 retries: 12 @@ -55,7 +55,7 @@ failed_when: false - name: Kill -9 stuck minio processes - command: "kill -9 {{ pid }}" + ansible.builtin.command: "kill -9 {{ pid }}" register: kill9_minio changed_when: kill9_minio.stdout is not search('No such process') failed_when: false @@ -66,7 +66,7 @@ become: true - name: Wait for minio process to stop after kill -9 - command: "pgrep -x minio" + ansible.builtin.command: "pgrep -x minio" register: postminio_ps9 until: postminio_ps9.rc != 0 retries: 12 diff --git a/roles/stop_dss_target/tasks/main.yml b/roles/stop_dss_target/tasks/main.yml index e0b008c2..d59e738a 100644 --- a/roles/stop_dss_target/tasks/main.yml +++ b/roles/stop_dss_target/tasks/main.yml @@ -30,13 +30,13 @@ --- - name: Find running target process - command: "pgrep reactor_" + ansible.builtin.command: "pgrep reactor_" register: nvmf_ps changed_when: false failed_when: false - name: Kill -2 target processes - command: "kill -2 {{ pid }}" + ansible.builtin.command: "kill -2 {{ pid }}" register: kill_nvmf changed_when: kill_nvmf.stdout is not search('No such process') failed_when: false @@ -46,7 +46,7 @@ become: true - name: Wait for nvmf_tgt process to stop - command: "pgrep reactor_" + ansible.builtin.command: "pgrep reactor_" register: postnvmf_ps until: postnvmf_ps.rc != 0 retries: 120 @@ -55,7 +55,7 @@ failed_when: false - name: Kill -9 stuck target processes - command: "kill -9 {{ pid }}" + ansible.builtin.command: "kill -9 {{ pid }}" register: kill9_nvmf changed_when: kill9_nvmf.stdout is not search('No such process') failed_when: false @@ -66,7 +66,7 @@ become: true - name: Wait for nvmf_tgt process to stop after kill -9 - command: "pgrep reactor_" + ansible.builtin.command: "pgrep reactor_" register: postnvmf_ps9 until: postnvmf_ps9.rc != 0 retries: 120 diff --git a/roles/stop_etcd_gateway/tasks/main.yml b/roles/stop_etcd_gateway/tasks/main.yml index a691929c..e93752fc 100644 --- a/roles/stop_etcd_gateway/tasks/main.yml +++ b/roles/stop_etcd_gateway/tasks/main.yml @@ -30,11 +30,11 @@ --- - name: Get service facts - service_facts: + ansible.builtin.service_facts: when: ansible_facts.services is not defined - name: Stop etcd-gateway systemd unit - systemd: + ansible.builtin.systemd: enabled: false state: stopped name: etcd-gateway diff --git a/roles/stop_ufm_etcd/tasks/main.yml b/roles/stop_ufm_etcd/tasks/main.yml index 097168c8..1225d090 100644 --- a/roles/stop_ufm_etcd/tasks/main.yml +++ b/roles/stop_ufm_etcd/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Stop and disable ufm_etcd service - systemd: + ansible.builtin.systemd: name: "{{ ufm_etcd_service_file | basename }}" state: stopped daemon_reload: true @@ -42,7 +42,7 @@ become: true - name: Remove UFM files and directories - file: + ansible.builtin.file: path: "{{ item }}" state: absent loop: "{{ ufm_reset_dirs + [ ufm_etcd_service_file ] }}" diff --git a/roles/support_bundle/tasks/collect_ansible_facts.yml b/roles/support_bundle/tasks/collect_ansible_facts.yml index 93473d36..e54d6aad 100644 --- a/roles/support_bundle/tasks/collect_ansible_facts.yml +++ b/roles/support_bundle/tasks/collect_ansible_facts.yml @@ -30,7 +30,7 @@ --- - name: Fetch ansible facts - copy: + ansible.builtin.copy: dest: "{{ local_coredump_dir }}/{{ inventory_hostname }}/ansible_facts.json" content: "{{ ansible_facts | to_nice_json }}" mode: 0755 diff --git a/roles/support_bundle/tasks/collect_ansible_log.yml b/roles/support_bundle/tasks/collect_ansible_log.yml index d8dd1b71..4126f169 100644 --- a/roles/support_bundle/tasks/collect_ansible_log.yml +++ b/roles/support_bundle/tasks/collect_ansible_log.yml @@ -30,7 +30,7 @@ --- - name: Fetch dmesg - copy: + ansible.builtin.copy: src: "{{ ansible_log_path }}" dest: "{{ local_coredump_dir }}/ansible.log" mode: 0755 diff --git a/roles/support_bundle/tasks/collect_binaries.yml b/roles/support_bundle/tasks/collect_binaries.yml index 90648535..c3d66d37 100644 --- a/roles/support_bundle/tasks/collect_binaries.yml +++ b/roles/support_bundle/tasks/collect_binaries.yml @@ -30,11 +30,11 @@ --- - name: Fetch nvmf_tgt binary - fetch: + ansible.builtin.fetch: src: "{{ target_bin_dir }}/nvmf_tgt" dest: "{{ local_coredump_dir }}" - name: Fetch minio binary - fetch: + ansible.builtin.fetch: src: "{{ minio_dir }}/minio" dest: "{{ local_coredump_dir }}" diff --git a/roles/support_bundle/tasks/collect_coredumps.yml b/roles/support_bundle/tasks/collect_coredumps.yml index bfef16de..8d488c3a 100644 --- a/roles/support_bundle/tasks/collect_coredumps.yml +++ b/roles/support_bundle/tasks/collect_coredumps.yml @@ -30,7 +30,7 @@ --- - name: Fetch coredumps - fetch: + ansible.builtin.fetch: src: "{{ item.path }}" dest: "{{ local_coredump_dir }}" loop: "{{ coredumps.files }}" diff --git a/roles/support_bundle/tasks/collect_dmesg.yml b/roles/support_bundle/tasks/collect_dmesg.yml index df39b62f..586c5f19 100644 --- a/roles/support_bundle/tasks/collect_dmesg.yml +++ b/roles/support_bundle/tasks/collect_dmesg.yml @@ -30,12 +30,12 @@ --- - name: Collect dmesg - command: dmesg -T + ansible.builtin.command: dmesg -T register: dmesg changed_when: false - name: Fetch dmesg - copy: + ansible.builtin.copy: dest: "{{ local_coredump_dir }}/{{ inventory_hostname }}/dmesg" content: "{{ dmesg.stdout }}" mode: 0755 diff --git a/roles/support_bundle/tasks/collect_dss_config.yml b/roles/support_bundle/tasks/collect_dss_config.yml index c220c945..39764a1e 100644 --- a/roles/support_bundle/tasks/collect_dss_config.yml +++ b/roles/support_bundle/tasks/collect_dss_config.yml @@ -30,13 +30,13 @@ --- - name: Find DSS config files - find: + ansible.builtin.find: paths: "{{ target_conf_dir }}" recurse: true register: dss_config - name: Fetch DSS config files - fetch: + ansible.builtin.fetch: src: "{{ item.path }}" dest: "{{ local_coredump_dir }}" loop: "{{ dss_config.files }}" diff --git a/roles/support_bundle/tasks/collect_dss_logs.yml b/roles/support_bundle/tasks/collect_dss_logs.yml index b2bfc182..8569e404 100644 --- a/roles/support_bundle/tasks/collect_dss_logs.yml +++ b/roles/support_bundle/tasks/collect_dss_logs.yml @@ -30,13 +30,13 @@ --- - name: Find DSS logs - find: + ansible.builtin.find: paths: "{{ dss_log_dir }}" recurse: true register: dss_logs - name: Fetch DSS logs - fetch: + ansible.builtin.fetch: src: "{{ item.path }}" dest: "{{ local_coredump_dir }}" loop: "{{ dss_logs.files }}" diff --git a/roles/support_bundle/tasks/collect_etc_hosts.yml b/roles/support_bundle/tasks/collect_etc_hosts.yml index 2f1c6dc0..0ba4ece8 100644 --- a/roles/support_bundle/tasks/collect_etc_hosts.yml +++ b/roles/support_bundle/tasks/collect_etc_hosts.yml @@ -30,6 +30,6 @@ --- - name: Fetch /etc/hosts - fetch: + ansible.builtin.fetch: src: /etc/hosts dest: "{{ local_coredump_dir }}" diff --git a/roles/support_bundle/tasks/collect_host_scripts.yml b/roles/support_bundle/tasks/collect_host_scripts.yml index 69edb324..52b9914e 100644 --- a/roles/support_bundle/tasks/collect_host_scripts.yml +++ b/roles/support_bundle/tasks/collect_host_scripts.yml @@ -30,14 +30,14 @@ --- - name: Find host config script and MinIO startup scripts - find: + ansible.builtin.find: paths: "{{ nkv_sdk_bin_dir }}" patterns: 'minio_startup_*.sh,dss_host_config_host.sh' recurse: false register: minio_startup_scripts - name: Fetch host config script and MinIO startup scripts - fetch: + ansible.builtin.fetch: src: "{{ item.path }}" dest: "{{ local_coredump_dir }}" loop: "{{ minio_startup_scripts.files }}" diff --git a/roles/support_bundle/tasks/collect_nkv_config.yml b/roles/support_bundle/tasks/collect_nkv_config.yml index 2b9e061f..cc1f67a3 100644 --- a/roles/support_bundle/tasks/collect_nkv_config.yml +++ b/roles/support_bundle/tasks/collect_nkv_config.yml @@ -30,14 +30,14 @@ --- - name: Find nkv config json files - find: + ansible.builtin.find: paths: "{{ nkv_sdk_conf_dir }}" patterns: 'nkv_config_*.json' recurse: false register: nkv_config_files - name: Fetch nkv config json files - fetch: + ansible.builtin.fetch: src: "{{ item.path }}" dest: "{{ local_coredump_dir }}" loop: "{{ nkv_config_files.files }}" diff --git a/roles/support_bundle/tasks/collect_numactl.yml b/roles/support_bundle/tasks/collect_numactl.yml index 7ee3b5f0..ab9c5944 100644 --- a/roles/support_bundle/tasks/collect_numactl.yml +++ b/roles/support_bundle/tasks/collect_numactl.yml @@ -30,13 +30,13 @@ --- - name: Collect numactl - command: numactl -H + ansible.builtin.command: numactl -H register: numactl changed_when: false failed_when: false - name: Fetch numactl - copy: + ansible.builtin.copy: dest: "{{ local_coredump_dir }}/{{ inventory_hostname }}/numactl" content: "{{ numactl.stdout }}" mode: 0755 diff --git a/roles/support_bundle/tasks/collect_spdk_status.yml b/roles/support_bundle/tasks/collect_spdk_status.yml index ebcdfb00..7a12c044 100644 --- a/roles/support_bundle/tasks/collect_spdk_status.yml +++ b/roles/support_bundle/tasks/collect_spdk_status.yml @@ -30,13 +30,13 @@ --- - name: Collect spdk status - command: "{{ spdk_setup_script }} status" + ansible.builtin.command: "{{ spdk_setup_script }} status" register: spdk_status changed_when: false failed_when: false - name: Fetch spdk status - copy: + ansible.builtin.copy: dest: "{{ local_coredump_dir }}/{{ inventory_hostname }}/spdk_status" content: "{{ spdk_status.stdout }}" mode: 0755 diff --git a/roles/support_bundle/tasks/collect_target_scripts.yml b/roles/support_bundle/tasks/collect_target_scripts.yml index 42a88388..f11349c1 100644 --- a/roles/support_bundle/tasks/collect_target_scripts.yml +++ b/roles/support_bundle/tasks/collect_target_scripts.yml @@ -30,14 +30,14 @@ --- - name: Find target setup script, dss_target.py output, and mkfs_blobfs output - find: + ansible.builtin.find: paths: "{{ target_bin_dir }}" patterns: 'dss_target_config.sh,dss_target.out,format_disks.sh,format_disks.out' recurse: false register: target_setup_logs - name: Fetch target setup script, dss_target.py output, and mkfs_blobfs output - fetch: + ansible.builtin.fetch: src: "{{ item.path }}" dest: "{{ local_coredump_dir }}" loop: "{{ target_setup_logs.files }}" diff --git a/roles/support_bundle/tasks/generate_bundle.yml b/roles/support_bundle/tasks/generate_bundle.yml index 007f8c2d..bd9e6452 100644 --- a/roles/support_bundle/tasks/generate_bundle.yml +++ b/roles/support_bundle/tasks/generate_bundle.yml @@ -30,62 +30,62 @@ --- - name: Collect ansible_facts - include_tasks: collect_ansible_facts.yml + ansible.builtin.include_tasks: collect_ansible_facts.yml - name: Collect dmesg - include_tasks: collect_dmesg.yml + ansible.builtin.include_tasks: collect_dmesg.yml - name: Collect SPDK status - include_tasks: collect_spdk_status.yml + ansible.builtin.include_tasks: collect_spdk_status.yml when: inventory_hostname in target_hostnames - name: Collect DSS logs dir - include_tasks: collect_dss_logs.yml + ansible.builtin.include_tasks: collect_dss_logs.yml - name: Collect DSS config dir - include_tasks: collect_dss_config.yml + ansible.builtin.include_tasks: collect_dss_config.yml - name: Collect nkv_config json files - include_tasks: collect_nkv_config.yml + ansible.builtin.include_tasks: collect_nkv_config.yml - name: Collect host config script and MinIO startup scripts - include_tasks: collect_host_scripts.yml + ansible.builtin.include_tasks: collect_host_scripts.yml - name: Collect target setup script, dss_target.py output, and mkfs_blobfs output - include_tasks: collect_target_scripts.yml + ansible.builtin.include_tasks: collect_target_scripts.yml - name: Collect coredumps - include_tasks: collect_coredumps.yml + ansible.builtin.include_tasks: collect_coredumps.yml when: collect_coredumps | bool - name: Collect /etc/hosts - include_tasks: collect_etc_hosts.yml + ansible.builtin.include_tasks: collect_etc_hosts.yml - name: Collect numactl - include_tasks: collect_numactl.yml + ansible.builtin.include_tasks: collect_numactl.yml - name: Collect ansible log - include_tasks: collect_ansible_log.yml + ansible.builtin.include_tasks: collect_ansible_log.yml - name: Collect binaries - include_tasks: collect_binaries.yml + ansible.builtin.include_tasks: collect_binaries.yml when: collect_binaries | bool - name: Create support bundle tarball - archive: + ansible.builtin.archive: path: "{{ local_coredump_dir }}/{{ inventory_hostname }}" dest: "{{ local_coredump_dir }}/{{ ansible_date_time.epoch }}-{{ inventory_hostname_short }}-{{ coredump_suffix_name }}.tgz" mode: 0755 delegate_to: localhost - name: Remove support bundle temp files - file: + ansible.builtin.file: path: "{{ local_coredump_dir }}/{{ inventory_hostname }}" state: absent delegate_to: localhost - name: Remove coredumps - file: + ansible.builtin.file: path: "{{ item.path }}" state: absent loop: "{{ coredumps.files }}" diff --git a/roles/support_bundle/tasks/main.yml b/roles/support_bundle/tasks/main.yml index 1af995dc..6ad251bb 100644 --- a/roles/support_bundle/tasks/main.yml +++ b/roles/support_bundle/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Set target_hostnames and host_hostnames vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" - name: Create local coredump dir - file: + ansible.builtin.file: path: "{{ local_coredump_dir }}" state: directory mode: 0755 @@ -43,7 +43,7 @@ run_once: true - name: Create host dirs if coredump_only is false - file: + ansible.builtin.file: path: "{{ local_coredump_dir }}/{{ inventory_hostname }}" state: directory mode: 0755 @@ -51,11 +51,11 @@ when: not coredump_only - name: Check for coredumps - find: + ansible.builtin.find: path: "{{ coredump_dir }}" patterns: 'core-reactor_*.gz' register: coredumps - name: Generate support bundle - include_tasks: generate_bundle.yml + ansible.builtin.include_tasks: generate_bundle.yml when: coredumps.matched > 0 or not coredump_only diff --git a/roles/test_ib_read_bw/tasks/ib_read_bw.yml b/roles/test_ib_read_bw/tasks/ib_read_bw.yml index 761411b0..8aa43848 100644 --- a/roles/test_ib_read_bw/tasks/ib_read_bw.yml +++ b/roles/test_ib_read_bw/tasks/ib_read_bw.yml @@ -30,7 +30,7 @@ --- - name: Set ib_read_bw_port and cumulative_bw vars - set_fact: + ansible.builtin.set_fact: cumulative_bw: 0 ib_read_bw_port: |- {%- for host in ansible_play_hosts -%} @@ -40,7 +40,7 @@ {%- endfor -%} - name: Set server linkspeed - set_fact: + ansible.builtin.set_fact: server_linkspeed: "{{ lookup('vars', server_ans_netdev).speed }}" vars: server_ans_netdev: "ansible_{{ server_netdev | replace('-', '_') }}" @@ -48,11 +48,11 @@ run_once: true - name: Set client_ib_device var - set_fact: + ansible.builtin.set_fact: client_ib_device: "{{ ib_devices | selectattr('vlan_index', 'equalto', server_vlan_index) | list | first }}" - name: Set ib_read_bw_server_command and ib_read_bw_client_command vars - set_fact: + ansible.builtin.set_fact: ib_read_bw_server_command: >- ib_read_bw --ib-dev={{ server_ibdev }} @@ -76,18 +76,18 @@ when: inventory_hostname != server_hostname - name: Print ib_read_bw server command - debug: + ansible.builtin.debug: var: ib_read_bw_server_command delegate_to: "{{ server_hostname }}" when: inventory_hostname != server_hostname -- name: print ib_read_bw client command - debug: +- name: Print ib_read_bw client command + ansible.builtin.debug: var: ib_read_bw_client_command when: inventory_hostname != server_hostname -- name: ib_read_bw server from {{ server_hostname }} - {{ server_ip_address }} - command: "{{ ib_read_bw_server_command }}" +- name: Execute ib_read_bw server from {{ server_hostname }} - {{ server_ip_address }} + ansible.builtin.command: "{{ ib_read_bw_server_command }}" changed_when: false async: "{{ ib_read_bw_duration | int + 10 }}" poll: 0 @@ -95,15 +95,15 @@ delegate_to: "{{ server_hostname }}" when: inventory_hostname != server_hostname -- name: ib_read_bw client to {{ server_hostname }} - {{ server_ip_address }}, {{ ib_read_bw_duration }} seconds - command: "{{ ib_read_bw_client_command }}" +- name: Execute ib_read_bw client to {{ server_hostname }} - {{ server_ip_address }}, {{ ib_read_bw_duration }} seconds + ansible.builtin.command: "{{ ib_read_bw_client_command }}" changed_when: false register: ib_results become: true when: inventory_hostname != server_hostname - name: Set cumulative_bw var - set_fact: + ansible.builtin.set_fact: cumulative_bw: "{{ (cumulative_bw | float) + (bw_avg | float) }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -115,7 +115,7 @@ when: client_hostname != server_hostname - name: Collect ib_read_bw results for server {{ server_hostname }} - {{ server_ip_address }} - set_fact: + ansible.builtin.set_fact: combined_ib_results: "{{ combined_ib_results | default([]) + [{'bw_avg': '%0.2f' % cumulative_bw | float, 'server_hostname': server_hostname, diff --git a/roles/test_ib_read_bw/tasks/main.yml b/roles/test_ib_read_bw/tasks/main.yml index ac750d27..7a8d6dd8 100644 --- a/roles/test_ib_read_bw/tasks/main.yml +++ b/roles/test_ib_read_bw/tasks/main.yml @@ -30,29 +30,29 @@ --- - name: Assert more than one host - assert: + ansible.builtin.assert: that: ansible_play_hosts | length > 1 msg: Can only test ib_read_bw with more than 1 target - name: Get ib_read_bw versions - command: ib_read_bw --version + ansible.builtin.command: ib_read_bw --version changed_when: false failed_when: false register: ib_read_bw_version - name: Assert ib_read_bw installed - assert: + ansible.builtin.assert: that: ib_read_bw_version.stdout is defined msg: ib_read_bw is not installed. Install 'perftest' RPM. - name: Set ib_read_bw_ver_list var - set_fact: + ansible.builtin.set_fact: ib_read_bw_ver_list: "{{ ib_read_bw_ver_list | d([]) + [ hostvars[item].ib_read_bw_version.stdout ] }}" loop: "{{ ansible_play_hosts }}" run_once: true - name: Assert ib_read_bw versions match - assert: + ansible.builtin.assert: that: ib_read_bw_ver_list | unique | length == 1 msg: | Mixed versions of ib_read_bw detected. @@ -60,33 +60,33 @@ {{ ib_read_bw_version.stdout }} - name: Get RoCEv2 IP Address - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Assert that IP's are defined - assert: + ansible.builtin.assert: that: rocev2_ip_list | length > 0 fail_msg: | No IPs configured on any Mellanox adapter. Please configure at least one IP to test ping. - name: Copy show_gids script - copy: + ansible.builtin.copy: src: show_gids.sh dest: /usr/local/bin/show_gids mode: 0755 become: true - name: Query show_gids - command: show_gids + ansible.builtin.command: show_gids environment: PATH: "{{ ansible_env.PATH }}:/usr/local/bin:/usr/sbin" changed_when: false @@ -95,7 +95,7 @@ become: true - name: Set ib_devices var - set_fact: + ansible.builtin.set_fact: ib_devices: "{{ ib_devices | default([]) + [{ 'ibdev': ibdev, 'gid_index': gid_index, @@ -116,7 +116,7 @@ when: gids_list.stdout is regex(gid_regex) - name: Set combined_ib_devices var - set_fact: + ansible.builtin.set_fact: combined_ib_devices: "{{ combined_ib_devices | default([]) }} + {{ hostvars[host].ib_devices }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -124,7 +124,7 @@ run_once: true - name: Iterate ib_read_bw permutations - include_tasks: ib_read_bw.yml + ansible.builtin.include_tasks: ib_read_bw.yml vars: server_vlan_index: "{{ server_ib_device.vlan_index }}" server_ibdev: "{{ server_ib_device.ibdev }}" @@ -137,7 +137,7 @@ loop_var: server_ib_device - name: Assert ib_read_bw bw_avg is > 90% of link speed - assert: + ansible.builtin.assert: that: ib_result.bw_avg | float >= min_linkspeed | float fail_msg: "Expected bw: {{ min_linkspeed }}. Actual bw: {{ ib_result.bw_avg }}" quiet: true diff --git a/roles/test_iperf/tasks/iperf.yml b/roles/test_iperf/tasks/iperf.yml index 36f01a15..4942ed40 100644 --- a/roles/test_iperf/tasks/iperf.yml +++ b/roles/test_iperf/tasks/iperf.yml @@ -30,7 +30,7 @@ --- - name: Set iperf_port and cumulative_tp vars - set_fact: + ansible.builtin.set_fact: cumulative_tp: 0 iperf_port: |- {%- for host in ansible_play_hosts -%} @@ -40,7 +40,7 @@ {%- endfor -%} - name: Set iperf_server_command and iperf_client_command vars - set_fact: + ansible.builtin.set_fact: iperf_server_command: >- {{ iperf_binary }} --server @@ -57,18 +57,18 @@ when: inventory_hostname != server_hostname - name: Print iperf server command - debug: + ansible.builtin.debug: var: iperf_server_command delegate_to: "{{ server_hostname }}" when: inventory_hostname != server_hostname - name: Print iperf client command - debug: + ansible.builtin.debug: var: iperf_client_command when: inventory_hostname != server_hostname -- name: iperf server from {{ server_hostname }} - {{ server_ip_address }} - command: "{{ iperf_server_command }}" +- name: Execute iperf server from {{ server_hostname }} - {{ server_ip_address }} + ansible.builtin.command: "{{ iperf_server_command }}" changed_when: false async: "{{ iperf_duration | int + 10 }}" poll: 0 @@ -76,15 +76,15 @@ delegate_to: "{{ server_hostname }}" when: inventory_hostname != server_hostname -- name: iperf client to {{ server_hostname }} - {{ server_ip_address }}, {{ iperf_duration }} seconds - command: "{{ iperf_client_command }}" +- name: Execute iperf client to {{ server_hostname }} - {{ server_ip_address }}, {{ iperf_duration }} seconds + ansible.builtin.command: "{{ iperf_client_command }}" changed_when: false register: iperf_results become: true when: inventory_hostname != server_hostname - name: Set cumulative_tp var - set_fact: + ansible.builtin.set_fact: cumulative_tp: "{{ (cumulative_tp | float) + (throughput | float) }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -97,7 +97,7 @@ when: client_hostname != server_hostname - name: Collect iperf results for server {{ server_hostname }} - {{ server_ip_address }} - set_fact: + ansible.builtin.set_fact: combined_iperf_results: "{{ combined_iperf_results | default([]) + [{'throughput': '%0.2f' % cumulative_tp | float, 'server_hostname': server_hostname, diff --git a/roles/test_iperf/tasks/main.yml b/roles/test_iperf/tasks/main.yml index 168b2541..410b2159 100644 --- a/roles/test_iperf/tasks/main.yml +++ b/roles/test_iperf/tasks/main.yml @@ -30,45 +30,45 @@ --- - name: Assert more than one host - assert: + ansible.builtin.assert: that: ansible_play_hosts | length > 1 msg: Can only test iperf with more than 1 target - name: Include vars - include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" + ansible.builtin.include_vars: "{{ ansible_distribution_file_variety | lower }}_{{ ansible_distribution_major_version }}.yml" - name: Get iperf versions - command: "{{ iperf_binary }} --version" + ansible.builtin.command: "{{ iperf_binary }} --version" changed_when: false failed_when: false register: iperf_version - name: Assert iperf installed - assert: + ansible.builtin.assert: that: iperf_version.stdout is defined msg: "iperf is not installed. Install '{{ iperf_binary }}' RPM." - name: Get RoCEv2 IP Address - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Assert that IP's are defined - assert: + ansible.builtin.assert: that: rocev2_ip_list | length > 0 fail_msg: | No IPs configured on any Mellanox adapter. Please configure at least one IP to test ping. - name: Set net_devices var - set_fact: + ansible.builtin.set_fact: net_devices: "{{ net_devices | default([]) + [{'ip_address': ip_address, 'linkspeed': linkspeed, @@ -84,7 +84,7 @@ linkspeed: "{{ ansible_facts | dict2items | json_query(speed_query) }}" - name: Set combined_net_devices var - set_fact: + ansible.builtin.set_fact: combined_net_devices: "{{ combined_net_devices | default([]) }} + {{ hostvars[host].net_devices }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -92,7 +92,7 @@ run_once: true - name: Iterate iperf permutations - include_tasks: iperf.yml + ansible.builtin.include_tasks: iperf.yml vars: server_vlan_index: "{{ server_net_device.vlan_index }}" server_hostname: "{{ server_net_device.hostname }}" @@ -103,7 +103,7 @@ loop_var: server_net_device - name: Assert iperf throughput is > 90% of link speed - assert: + ansible.builtin.assert: that: iperf_result.throughput | float >= min_linkspeed | float fail_msg: "Expected bandwidth: {{ min_linkspeed }}. Actual throughput: {{ iperf_result.throughput }}" quiet: true diff --git a/roles/test_nkv_test_cli/tasks/get_ip_numa.yml b/roles/test_nkv_test_cli/tasks/get_ip_numa.yml index ae90b737..38f7275f 100644 --- a/roles/test_nkv_test_cli/tasks/get_ip_numa.yml +++ b/roles/test_nkv_test_cli/tasks/get_ip_numa.yml @@ -30,26 +30,26 @@ --- - name: Get all RoCEv2 IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ rocev2_vlans }}" when: rocev2_ip_list is not defined - name: Set rocev2_ip_list var if IP's auto-discovered - set_fact: + ansible.builtin.set_fact: rocev2_ip_list: "{{ vlan_ip_list }}" when: rocev2_ip_list is not defined - name: Get ip route - command: ip route show + ansible.builtin.command: ip route show environment: PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin" changed_when: false register: ip_route - name: Set rocev2_dev - set_fact: + ansible.builtin.set_fact: rocev2_dev_list: "{{ rocev2_dev_list | default([]) + [{ 'ipv4_prefix': ipv4_prefix, 'dev': device, @@ -63,7 +63,7 @@ when: ip_route.stdout is regex(item) - name: Get NUMA - command: "cat /sys/class/net/{{ item.dev.split('.')[0] }}/device/numa_node" + ansible.builtin.command: "cat /sys/class/net/{{ item.dev.split('.')[0] }}/device/numa_node" changed_when: false loop: "{{ rocev2_dev_list }}" loop_control: @@ -71,7 +71,7 @@ register: numa_node - name: Set rocev2_numa_prefix_list - set_fact: + ansible.builtin.set_fact: rocev2_numa_prefix_list: "{{ rocev2_numa_prefix_list | default([]) + [{ 'ipv4_prefix': vlan.item.ipv4_prefix, 'ip': vlan.item.ip, diff --git a/roles/test_nkv_test_cli/tasks/main.yml b/roles/test_nkv_test_cli/tasks/main.yml index 801e7492..f83f1994 100644 --- a/roles/test_nkv_test_cli/tasks/main.yml +++ b/roles/test_nkv_test_cli/tasks/main.yml @@ -30,58 +30,58 @@ --- - name: Set target/host group vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" - name: Get RoCEv2 IP lists and NUMA - include_tasks: get_ip_numa.yml + ansible.builtin.include_tasks: get_ip_numa.yml when: inventory_hostname in host_hostnames - name: Execute nkv_test_cli put - include_tasks: nkv_test_cli.yml + ansible.builtin.include_tasks: nkv_test_cli.yml vars: operation: "{{ test_nkv_test_cli_put }}" when: inventory_hostname in host_hostnames - name: Set put_throughput - set_fact: + ansible.builtin.set_fact: put_throughput: "{{ combined_throughput }}" when: inventory_hostname in host_hostnames - name: Start Compaction - include_role: + ansible.builtin.include_role: name: start_compaction when: - inventory_hostname in target_hostnames - dss_target_mode is search('kv_block') - name: Execute nkv_test_cli get - include_tasks: nkv_test_cli.yml + ansible.builtin.include_tasks: nkv_test_cli.yml vars: operation: "{{ test_nkv_test_cli_get }}" when: inventory_hostname in host_hostnames - name: Set get_throughput - set_fact: + ansible.builtin.set_fact: get_throughput: "{{ combined_throughput }}" when: inventory_hostname in host_hostnames - name: Execute nkv_test_cli delete - include_tasks: nkv_test_cli.yml + ansible.builtin.include_tasks: nkv_test_cli.yml vars: operation: "{{ test_nkv_test_cli_delete }}" when: inventory_hostname in host_hostnames - name: Start Compaction - include_role: + ansible.builtin.include_role: name: start_compaction when: - inventory_hostname in target_hostnames - dss_target_mode is search('kv_block') - name: Print throughput - debug: + ansible.builtin.debug: msg: | Put throughput: {{ '%0.2f' | format(put_throughput | float) }} GB/s Get throughput: {{ '%0.2f' | format(get_throughput | float) }} GB/s diff --git a/roles/test_nkv_test_cli/tasks/nkv_test_cli.yml b/roles/test_nkv_test_cli/tasks/nkv_test_cli.yml index 1f9ba833..8b799d91 100644 --- a/roles/test_nkv_test_cli/tasks/nkv_test_cli.yml +++ b/roles/test_nkv_test_cli/tasks/nkv_test_cli.yml @@ -30,7 +30,7 @@ --- - name: Execute nkv_test_cli command - command: "{{ nkv_test_cli_command }}" + ansible.builtin.command: "{{ nkv_test_cli_command }}" args: chdir: "{{ nkv_sdk_bin_dir }}" loop: "{{ rocev2_numa_prefix_list }}" @@ -61,7 +61,7 @@ become: true - name: Check async nkv_test_cli command - async_status: + ansible.builtin.async_status: jid: "{{ async_task.ansible_job_id }}" register: async_results until: async_results.finished @@ -74,7 +74,7 @@ become: true - name: Assert async nkv_test_cli completion - assert: + ansible.builtin.assert: that: async_result.finished != 0 fail_msg: "nkv_test_cli did not complete in time" quiet: true @@ -84,12 +84,12 @@ label: "{{ async_result.cmd | join(' ') }}" - name: Initialize throughput vars - set_fact: + ansible.builtin.set_fact: throughput: 0 combined_throughput: 0 - name: Set throughput - set_fact: + ansible.builtin.set_fact: throughput: "{{ (throughput | float) + (async_result.stdout | regex_search(nkv_re, '\\1') | first | float) }}" vars: nkv_re: >- @@ -100,7 +100,7 @@ label: "{{ async_result.cmd | join(' ') }}" - name: Set combined_throughput - set_fact: + ansible.builtin.set_fact: combined_throughput: "{{ (combined_throughput | float) + (hostvars[host].throughput | float) }}" loop: "{{ host_hostnames }}" loop_control: diff --git a/roles/test_ping/tasks/main.yml b/roles/test_ping/tasks/main.yml index f9432fd8..e5337317 100644 --- a/roles/test_ping/tasks/main.yml +++ b/roles/test_ping/tasks/main.yml @@ -30,23 +30,23 @@ --- - name: Assert test_vlans defined - assert: + ansible.builtin.assert: that: - test_vlans is defined - (test_vlans == "tcp") or (test_vlans == "rocev2") - name: Set selected_vlans var for rocev2 - set_fact: + ansible.builtin.set_fact: selected_vlans: "{{ rocev2_vlans }}" when: test_vlans == "rocev2" - name: Set selected_vlans var for tcp - set_fact: + ansible.builtin.set_fact: selected_vlans: "{{ tcp_vlans }}" when: test_vlans == "tcp" - name: Get IP Addresses - include_role: + ansible.builtin.include_role: name: get_vlan_ips vars: vlan_list: "{{ selected_vlans }}" @@ -55,33 +55,33 @@ - rocev2_ip_list is not defined - name: Set vlan_ip_list for rocev2 if user-defined - set_fact: + ansible.builtin.set_fact: vlan_ip_list: "{{ rocev2_ip_list }}" when: - rocev2_ip_list is defined - test_vlans == "rocev2" - name: Set vlan_ip_list for tcp if user-defined - set_fact: + ansible.builtin.set_fact: vlan_ip_list: "{{ tcp_ip_list }}" when: - tcp_ip_list is defined - test_vlans == "tcp" - name: Assert that IP's are defined - assert: + ansible.builtin.assert: that: vlan_ip_list | length > 0 fail_msg: | No IPs configured on any Mellanox adapter. Please configure at least one IP to test ping. - name: Initialized combined_vlan_ip_list - set_fact: + ansible.builtin.set_fact: combined_vlan_ip_list: [] run_once: true - name: Set combined_vlan_ip_list - set_fact: + ansible.builtin.set_fact: combined_vlan_ip_list: "{{ combined_vlan_ip_list | default([]) }} + {{ hostvars[host].vlan_ip_list }}" loop: "{{ ansible_play_hosts }}" loop_control: @@ -89,13 +89,13 @@ run_once: true - name: Query IPs (getent) - shell: "getent ahosts {{ item }} | awk '{ print $1 }' | grep -v '^::1' | head -n 1" + ansible.builtin.shell: "getent ahosts {{ item }} | awk '{ print $1 }' | grep -v '^::1' | head -n 1" loop: "{{ combined_vlan_ip_list }}" changed_when: false register: getent - name: Assert getent contains routable hostnames or IPs - assert: + ansible.builtin.assert: that: "{{ item.stdout | ipaddr != false }}" msg: "{{ item.item }} is not routable on this host" quiet: true @@ -104,7 +104,7 @@ label: "{{ item.item }}" - name: Ping all endpoints - command: "ping {% if item.stdout | ipv6 %}-6 {% endif %}-c 1 {{ item.stdout }}" + ansible.builtin.command: "ping {% if item.stdout | ipv6 %}-6 {% endif %}-c 1 {{ item.stdout }}" changed_when: false loop: "{{ getent.results }}" loop_control: diff --git a/roles/test_s3_benchmark/tasks/main.yml b/roles/test_s3_benchmark/tasks/main.yml index 333b2606..950ac76f 100644 --- a/roles/test_s3_benchmark/tasks/main.yml +++ b/roles/test_s3_benchmark/tasks/main.yml @@ -30,43 +30,43 @@ --- - name: Set target/host group vars - set_fact: + ansible.builtin.set_fact: target_hostnames: "{{ (groups['servers'] | d([]) + groups['targets'] | d([])) | unique }}" host_hostnames: "{{ (groups['servers'] | d([]) + groups['hosts'] | d([])) | unique }}" - name: Install numactl - yum: + ansible.builtin.yum: name: numactl become: true - name: Stat DSS Client path - stat: + ansible.builtin.stat: path: "{{ client_library_dir }}" register: dss_client_path when: inventory_hostname in host_hostnames - name: Assert DSS Minio path exists - assert: + ansible.builtin.assert: that: dss_client_path.stat.exists fail_msg: DSS Minio is not installed. Execute 'deploy_dss_software.yml' playbook first. when: inventory_hostname in host_hostnames - name: Get TCP IP lists and NUMA - include_role: + ansible.builtin.include_role: name: get_tcp_numa when: > inventory_hostname in host_hostnames or inventory_hostname in groups['clients'] - name: Get clusters - include_role: + ansible.builtin.include_role: name: get_clusters when: >- inventory_hostname in host_hostnames or inventory_hostname in target_hostnames - name: Set minio_endpoints var - set_fact: + ansible.builtin.set_fact: minio_endpoints: >- [ {% for cluster in clusters %} @@ -88,7 +88,7 @@ run_once: true - name: Set all_assigned_endpoints var - set_fact: + ansible.builtin.set_fact: all_assigned_endpoints: >- {%- set assigned_endpoints = [] -%} {%- for minio_endpoint in minio_endpoints | shuffle -%} @@ -139,62 +139,62 @@ run_once: true - name: Set assigned_endpoints var - set_fact: + ansible.builtin.set_fact: assigned_endpoints: "{{ all_assigned_endpoints | selectattr('client', 'equalto', inventory_hostname) | list }}" when: inventory_hostname in groups['clients'] - name: Set num_s3_endpoints var - set_fact: + ansible.builtin.set_fact: num_s3_endpoints: "{{ num_s3_endpoints | d(0) | int + (hostvars[client].assigned_endpoints | length) }}" loop: "{{ groups['clients'] }}" loop_control: loop_var: client run_once: true -- name: s3-benchmark PUT - include_tasks: s3_benchmark.yml +- name: Execute s3-benchmark PUT + ansible.builtin.include_tasks: s3_benchmark.yml vars: operation: PUT when: inventory_hostname in groups['clients'] - name: Start Compaction - include_role: + ansible.builtin.include_role: name: start_compaction when: - inventory_hostname in target_hostnames - dss_target_mode is search('kv_block') - name: Set s3_put_speed var - set_fact: + ansible.builtin.set_fact: s3_put_speed: "{{ s3_speed }}" run_once: true -- name: s3-benchmark GET - include_tasks: s3_benchmark.yml +- name: Execute s3-benchmark GET + ansible.builtin.include_tasks: s3_benchmark.yml vars: operation: GET when: inventory_hostname in groups['clients'] - name: Set s3_get_speed var - set_fact: + ansible.builtin.set_fact: s3_get_speed: "{{ s3_speed }}" run_once: true -- name: s3-benchmark DEL - include_tasks: s3_benchmark.yml +- name: Execute s3-benchmark DEL + ansible.builtin.include_tasks: s3_benchmark.yml vars: operation: DEL when: inventory_hostname in groups['clients'] - name: Start Compaction - include_role: + ansible.builtin.include_role: name: start_compaction when: - inventory_hostname in target_hostnames - dss_target_mode is search('kv_block') - name: Print combined s3_benchmark PUT and GET throughput - debug: + ansible.builtin.debug: msg: | Num. MinIO Hosts: {{ host_hostnames | length }} Num. MinIO Endpoints: {{ minio_endpoints | length }} diff --git a/roles/test_s3_benchmark/tasks/s3_benchmark.yml b/roles/test_s3_benchmark/tasks/s3_benchmark.yml index 0327113a..a75eae51 100644 --- a/roles/test_s3_benchmark/tasks/s3_benchmark.yml +++ b/roles/test_s3_benchmark/tasks/s3_benchmark.yml @@ -139,7 +139,7 @@ run_once: true when: operation != 'DEL' -- name: set s3_speed var +- name: Set s3_speed var ansible.builtin.set_fact: s3_speed: >- {%- set total_objects = {'value': 0} -%} diff --git a/roles/upgrade_connectx_firmware/tasks/main.yml b/roles/upgrade_connectx_firmware/tasks/main.yml index 029433d5..2649d7de 100644 --- a/roles/upgrade_connectx_firmware/tasks/main.yml +++ b/roles/upgrade_connectx_firmware/tasks/main.yml @@ -30,12 +30,12 @@ --- - name: Get list of Mellanox ports - include_role: + ansible.builtin.include_role: name: get_mlnx_ports when: mellanox_ports is not defined - name: Query ConnectX-6 adapters for firmware upgrade - include_tasks: query_connectx6.yml + ansible.builtin.include_tasks: query_connectx6.yml vars: pre_upgrade_fw: "{{ item.fw }}" mlx_ibdev: "{{ item.ibdev }}" @@ -45,6 +45,6 @@ when: item.ConnectX == 6 - name: Delete ConnectX-6 firmware staging directory - file: + ansible.builtin.file: path: "{{ connectx6_staging_dir }}" state: absent diff --git a/roles/upgrade_connectx_firmware/tasks/query_connectx6.yml b/roles/upgrade_connectx_firmware/tasks/query_connectx6.yml index 3615d992..63e7445d 100644 --- a/roles/upgrade_connectx_firmware/tasks/query_connectx6.yml +++ b/roles/upgrade_connectx_firmware/tasks/query_connectx6.yml @@ -30,13 +30,13 @@ --- - name: Query ConnectX-6 adapter {{ mlx_ibdev }} - command: "flint -d {{ mlx_ibdev }} query" + ansible.builtin.command: "flint -d {{ mlx_ibdev }} query" changed_when: false register: flint_query become: true - name: Assert ConnectX-6 adapter is supported {{ mlx_ibdev }} - assert: + ansible.builtin.assert: that: connectx6_fw[psid] is defined fail_msg: "Adapter {{ mlx_ibdev }} PSID: {{ psid }} is unsupported" success_msg: "Found firmware URL for adapter {{ mlx_ibdev }} PSID: {{ psid }}" @@ -44,7 +44,7 @@ psid: "{{ flint_query.stdout | regex_search('PSID: +(.+)','\\1') | first }}" - name: Upgrade ConnectX-6 adapter {{ mlx_ibdev }} - include_tasks: upgrade_connectx6.yml + ansible.builtin.include_tasks: upgrade_connectx6.yml vars: psid: "{{ flint_query.stdout | regex_search('PSID: +(.+)','\\1') | first }}" fw_url: "{{ connectx6_fw[psid] }}" diff --git a/roles/upgrade_connectx_firmware/tasks/upgrade_connectx6.yml b/roles/upgrade_connectx_firmware/tasks/upgrade_connectx6.yml index 3966e5b1..08516cab 100644 --- a/roles/upgrade_connectx_firmware/tasks/upgrade_connectx6.yml +++ b/roles/upgrade_connectx_firmware/tasks/upgrade_connectx6.yml @@ -30,25 +30,25 @@ --- - name: Install unzip - yum: + ansible.builtin.yum: name: unzip become: true - name: Create ConnectX-6 firmware staging directory - file: + ansible.builtin.file: path: "{{ connectx6_staging_dir }}" state: directory mode: 0755 - name: Download ConnectX-6 firmware for adapter {{ mlx_ibdev }} - unarchive: + ansible.builtin.unarchive: src: "{{ fw_url }}" dest: "{{ connectx6_staging_dir }}" mode: 0644 remote_src: true - name: Upgrade ConnectX-6 firmware for adapter {{ mlx_ibdev }} - command: "flint -d {{ mlx_ibdev }} -i {{ fw_file }} -y b" + ansible.builtin.command: "flint -d {{ mlx_ibdev }} -i {{ fw_file }} -y b" args: chdir: "{{ connectx6_staging_dir }}" register: fw_upgrade @@ -61,17 +61,17 @@ - "'The firmware image was already updated on flash' not in fw_upgrade.stdout" - name: Reset ConnectX-6 adapter {{ mlx_ibdev }} - command: "mlxfwreset -d {{ mlx_ibdev }} reset -y" + ansible.builtin.command: "mlxfwreset -d {{ mlx_ibdev }} reset -y" become: true - name: Get post-upgrade Firmware version for adapter {{ mlx_ibdev }} - command: "flint -d {{ mlx_ibdev }} query" + ansible.builtin.command: "flint -d {{ mlx_ibdev }} query" changed_when: false register: post_upgrade_flint become: true - name: Assert firmware upgrade success for adapter {{ mlx_ibdev }} - assert: + ansible.builtin.assert: that: post_upgrade_fw is version(target_fw, '==') fail_msg: "Expected firmware {{ target_fw }} but found {{ post_upgrade_fw }}" success_msg: "Found firmware version {{ post_upgrade_fw }}" diff --git a/roles/validate_ansible/tasks/main.yml b/roles/validate_ansible/tasks/main.yml index 3b9555e2..e92df604 100644 --- a/roles/validate_ansible/tasks/main.yml +++ b/roles/validate_ansible/tasks/main.yml @@ -30,5 +30,5 @@ --- - name: Validate Ansible - include_tasks: validate_ansible.yml + ansible.builtin.include_tasks: validate_ansible.yml when: not ansible_validated | d(false) diff --git a/roles/validate_ansible/tasks/validate_ansible.yml b/roles/validate_ansible/tasks/validate_ansible.yml index 9deecbf2..fd5a3959 100644 --- a/roles/validate_ansible/tasks/validate_ansible.yml +++ b/roles/validate_ansible/tasks/validate_ansible.yml @@ -30,12 +30,12 @@ --- - name: Check Ansible's python version - shell: 'ansible --version | grep -oP "python version = \K[^ ]+"' + ansible.builtin.shell: 'ansible --version | grep -oP "python version = \K[^ ]+"' register: local_python_version changed_when: false - name: Validate Ansible python version - assert: + ansible.builtin.assert: that: local_python_version.stdout is version(min_python_version, '>=') msg: | Ansible must be installed under python {{ min_python_version }} or newer. @@ -47,7 +47,7 @@ python3 -m pip install "ansible>={{ min_ansible_version }},<{{ max_ansible_version }}" - name: Validate Ansible version - assert: + ansible.builtin.assert: that: - ansible_version.full is version(min_ansible_version, '>=') - ansible_version.full is version(max_ansible_version, '<') @@ -58,7 +58,7 @@ python3 -m pip install ansible>={{ min_ansible_version }},<{{ max_ansible_version }} - name: Validate python modules - include_tasks: validate_python_modules.yml + ansible.builtin.include_tasks: validate_python_modules.yml loop: "{{ required_python_modules }}" vars: python_module: "{{ item.name }}" diff --git a/roles/validate_ansible/tasks/validate_python_modules.yml b/roles/validate_ansible/tasks/validate_python_modules.yml index 6394481e..91671ee3 100644 --- a/roles/validate_ansible/tasks/validate_python_modules.yml +++ b/roles/validate_ansible/tasks/validate_python_modules.yml @@ -30,20 +30,20 @@ --- - name: Check {{ python_module }} python module version - command: 'python3 -c "import {{ python_module }}; print({{ python_module }}.__version__)"' + ansible.builtin.command: 'python3 -c "import {{ python_module }}; print({{ python_module }}.__version__)"' register: detected_module_version changed_when: false failed_when: false - name: Assert {{ python_module }} python module installed - assert: + ansible.builtin.assert: that: detected_module_version.rc == 0 msg: | {{ python_module }} python module is not installed on the ansible controller. Install from your local console with: 'python3 -m pip install {{ python_module }}' - name: Assert {{ python_module }} python module version - assert: + ansible.builtin.assert: that: detected_module_version.stdout is version(python_module_version, '>=') msg: | {{ python_module }} python module must be >= {{ python_module_version }} on the ansible controller. diff --git a/roles/validate_centos/tasks/main.yml b/roles/validate_centos/tasks/main.yml index b3682ce1..35753ca8 100644 --- a/roles/validate_centos/tasks/main.yml +++ b/roles/validate_centos/tasks/main.yml @@ -30,7 +30,7 @@ --- - name: Validate CentOS Version - assert: + ansible.builtin.assert: that: - ansible_distribution in supported_distributions - ansible_distribution_major_version in supported_major_versions