diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:35 +0000 |
commit | 7fec0b69a082aaeec72fee0612766aa42f6b1b4d (patch) | |
tree | efb569b86ca4da888717f5433e757145fa322e08 /ansible_collections/dellemc/powerflex/roles/powerflex_common | |
parent | Releasing progress-linux version 7.7.0+dfsg-3~progress7.99u1. (diff) | |
download | ansible-7fec0b69a082aaeec72fee0612766aa42f6b1b4d.tar.xz ansible-7fec0b69a082aaeec72fee0612766aa42f6b1b4d.zip |
Merging upstream version 9.4.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/dellemc/powerflex/roles/powerflex_common')
24 files changed, 394 insertions, 0 deletions
diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/README.md b/ansible_collections/dellemc/powerflex/roles/powerflex_common/README.md new file mode 100644 index 000000000..f681f6ac4 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/README.md @@ -0,0 +1,3 @@ +# powerflex_common + +Role to manage the common operations of Powerflex. diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/defaults/main.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/defaults/main.yml new file mode 100644 index 000000000..b0ea37ec6 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/defaults/main.yml @@ -0,0 +1,4 @@ +--- +powerflex_common_file_install_location: "/var/tmp" +powerflex_common_esxi_files_location: "/tmp/" +powerflex_common_win_package_location: "C:\\Windows\\Temp" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/meta/main.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/meta/main.yml new file mode 100644 index 000000000..bbe74f9e0 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/meta/main.yml @@ -0,0 +1,41 @@ +--- +galaxy_info: + author: Jennifer John + description: The role helps to manage the common functions of PowerFlex. + company: Dell Technologies + role_name: powerflex_common + namespace: dellemc + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: GPL-3.0-only + + min_ansible_version: "2.14.0" + platforms: + - name: EL + versions: + - "9" + - "8" + - name: Ubuntu + versions: + - jammy + - name: SLES + versions: + - "15SP3" + - "15SP4" + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_CentOS.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_CentOS.yml new file mode 100644 index 000000000..33922039b --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_CentOS.yml @@ -0,0 +1,5 @@ +--- +- name: Install pre-requisite java + ansible.builtin.package: + name: "java-1.8.0-openjdk-devel" + state: "present" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_RedHat.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_RedHat.yml new file mode 100644 index 000000000..33922039b --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_RedHat.yml @@ -0,0 +1,5 @@ +--- +- name: Install pre-requisite java + ansible.builtin.package: + name: "java-1.8.0-openjdk-devel" + state: "present" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_Rocky.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_Rocky.yml new file mode 100644 index 000000000..33922039b --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_Rocky.yml @@ -0,0 +1,5 @@ +--- +- name: Install pre-requisite java + ansible.builtin.package: + name: "java-1.8.0-openjdk-devel" + state: "present" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_SLES.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_SLES.yml new file mode 100644 index 000000000..484286982 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_SLES.yml @@ -0,0 +1,5 @@ +--- +- name: Install pre-requisite java + ansible.builtin.package: + name: "java-11-openjdk-headless" + state: "present" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_Ubuntu.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_Ubuntu.yml new file mode 100644 index 000000000..97de45222 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_java_Ubuntu.yml @@ -0,0 +1,10 @@ +--- +- name: Install pre-requisite binutils + ansible.builtin.package: + name: "binutils" + state: "present" + +- name: Install pre-requisite java + ansible.builtin.package: + name: "openjdk-8-jdk" + state: "present" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_CentOS.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_CentOS.yml new file mode 100644 index 000000000..35d08f875 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_CentOS.yml @@ -0,0 +1,36 @@ +--- +- name: Copy files + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/tmp/" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the rpm file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.rpm" + +- name: List the rpm gpg file + register: powerflex_common_package_gpg + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "{{ file_gpg_name }}*" + +- name: Import gpg key + ansible.builtin.rpm_key: + state: present + key: "{{ powerflex_common_package_gpg.files[0].path }}" + when: powerflex_common_package_gpg.files | length > 0 + +- name: Install package + register: powerflex_common_install_package_output + environment: "{{ powerflex_role_environment }}" + ansible.builtin.package: + name: "{{ powerflex_common_package_file.files[0].path }}" + state: "present" + disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_RedHat.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_RedHat.yml new file mode 100644 index 000000000..380c9e81d --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_RedHat.yml @@ -0,0 +1,36 @@ +--- +- name: Copy files + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/tmp/" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.rpm" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the rpm file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.rpm" + +- name: List the rpm gpg file + register: powerflex_common_package_gpg + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "{{ file_gpg_name }}*" + +- name: Import gpg key + ansible.builtin.rpm_key: + state: present + key: "{{ powerflex_common_package_gpg.files[0].path }}" + when: powerflex_common_package_gpg.files | length > 0 + +- name: Install package + register: powerflex_common_install_package_output + environment: "{{ powerflex_role_environment }}" + ansible.builtin.package: + name: "{{ powerflex_common_package_file.files[0].path }}" + state: "present" + disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_Rocky.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_Rocky.yml new file mode 100644 index 000000000..35d08f875 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_Rocky.yml @@ -0,0 +1,36 @@ +--- +- name: Copy files + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/tmp/" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the rpm file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.rpm" + +- name: List the rpm gpg file + register: powerflex_common_package_gpg + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "{{ file_gpg_name }}*" + +- name: Import gpg key + ansible.builtin.rpm_key: + state: present + key: "{{ powerflex_common_package_gpg.files[0].path }}" + when: powerflex_common_package_gpg.files | length > 0 + +- name: Install package + register: powerflex_common_install_package_output + environment: "{{ powerflex_role_environment }}" + ansible.builtin.package: + name: "{{ powerflex_common_package_file.files[0].path }}" + state: "present" + disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_SLES.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_SLES.yml new file mode 100644 index 000000000..380c9e81d --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_SLES.yml @@ -0,0 +1,36 @@ +--- +- name: Copy files + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/tmp/" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.rpm" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the rpm file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.rpm" + +- name: List the rpm gpg file + register: powerflex_common_package_gpg + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "{{ file_gpg_name }}*" + +- name: Import gpg key + ansible.builtin.rpm_key: + state: present + key: "{{ powerflex_common_package_gpg.files[0].path }}" + when: powerflex_common_package_gpg.files | length > 0 + +- name: Install package + register: powerflex_common_install_package_output + environment: "{{ powerflex_role_environment }}" + ansible.builtin.package: + name: "{{ powerflex_common_package_file.files[0].path }}" + state: "present" + disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_Ubuntu.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_Ubuntu.yml new file mode 100644 index 000000000..77f794572 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_Ubuntu.yml @@ -0,0 +1,51 @@ +--- +- name: Copy files + ansible.builtin.unarchive: + src: "{{ item }}" + dest: "/var/tmp/" + mode: "0644" + register: powerflex_common_ubuntu_tar_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.tar" + +- name: Get powerflex_common_siob_file # noqa: no-handler + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.siob" + register: powerflex_common_siob_file + when: powerflex_common_ubuntu_tar_file.changed + +- name: Execute chmod siob_extract # noqa: no-handler + ansible.builtin.file: + path: "/var/tmp/siob_extract" + mode: "0755" + when: powerflex_common_ubuntu_tar_file.changed + +- name: Execute the siob_extract # noqa: no-handler + ansible.builtin.command: /var/tmp/siob_extract "{{ powerflex_common_siob_file.files[0].path }}" chdir="/var/tmp" + when: powerflex_common_ubuntu_tar_file.changed + register: powerflex_common_siob_extract_output + changed_when: powerflex_common_siob_extract_output.rc == 0 + +- name: Copy deb file + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/tmp" + mode: "0644" + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.deb" + when: powerflex_common_ubuntu_tar_file.skipped + +- name: List the deb file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.deb" + +- name: Install package + register: powerflex_common_install_package_output + environment: "{{ powerflex_role_environment }}" + ansible.builtin.package: + deb: "{{ powerflex_common_package_file.files[0].path }}" + state: "present" + disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_VMkernel.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_VMkernel.yml new file mode 100644 index 000000000..3291fe8f6 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_VMkernel.yml @@ -0,0 +1,50 @@ +--- +- name: Get the acceptance level of the ESXi node + register: powerflex_common_get_acceptance_output + ansible.builtin.shell: > + esxcli software acceptance get + changed_when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' + +- name: Set the acceptance level to PartnerSupported + register: powerflex_common_set_acceptance_output + ansible.builtin.shell: > + esxcli software acceptance set --level=PartnerSupported + when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' + changed_when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' + +- name: Copy Esxi component and rpm files + ansible.builtin.copy: + src: "{{ item }}" + dest: "{{ powerflex_common_esxi_files_location }}" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the zip file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "{{ powerflex_common_esxi_files_location }}" + patterns: "*{{ file_glob_name }}*.zip" + +- name: Install SDC package for ESXi + register: powerflex_common_install_package_output + ansible.builtin.shell: > + esxcli software vib install -d {{ powerflex_common_package_file.files[0].path }} --no-sig-check + ignore_errors: true + changed_when: "'Reboot Required: true' in powerflex_common_install_package_output.stdout" + +- name: Reboot ESXi host + register: powerflex_common_reboot_output + ansible.builtin.reboot: + reboot_timeout: 500 + msg: "Rebooting the ESXi host." + when: "'Reboot Required: true' in powerflex_common_install_package_output.stdout" + changed_when: powerflex_common_reboot_output.rebooted + +- name: Ensure the driver is loaded for SDC after reboot + register: powerflex_common_loaded_driver_output + ansible.builtin.shell: > + set -o pipefail && esxcli software vib list | grep sdc + changed_when: powerflex_common_loaded_driver_output.stdout_lines | length == 0 diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_WindowsOS.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_WindowsOS.yml new file mode 100644 index 000000000..6b8e4b8e8 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_packages_WindowsOS.yml @@ -0,0 +1,20 @@ +--- +- name: Copy files + ansible.windows.win_copy: + src: "{{ item }}" + dest: "{{ powerflex_common_win_package_location }}" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.msi" + +- name: List the msi file + ansible.windows.win_find: + paths: "{{ powerflex_common_win_package_location }}" + patterns: "*{{ file_glob_name }}*.msi" + register: powerflex_common_package_file + +- name: Install package + register: powerflex_common_install_package_output + ansible.windows.win_command: > + msiexec.exe /i "{{ powerflex_common_package_file.files[0].path }}" MDM_IP="{{ powerflex_role_environment.MDM_IP }}" /q + ignore_errors: true diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_powerflex.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_powerflex.yml new file mode 100644 index 000000000..98ae4b0c9 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/install_powerflex.yml @@ -0,0 +1,8 @@ +--- +- name: Set fact # noqa var-naming[no-role-prefix] + ansible.builtin.set_fact: + ansible_distribution: "WindowsOS" + when: " 'Windows' in ansible_distribution" + +- name: Include installation file based on distribution + ansible.builtin.include_tasks: "install_packages_{{ ansible_distribution }}.yml" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/main.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/main.yml new file mode 100644 index 000000000..b83b1c148 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: Set fact # noqa var-naming[no-role-prefix] + ansible.builtin.set_fact: + ansible_distribution: "WindowsOS" + when: " 'Windows' in ansible_distribution" + +- name: Include vars + ansible.builtin.include_vars: "../vars/{{ ansible_distribution }}.yml" + +- name: Install required packages # noqa package-latest + ansible.builtin.package: + name: "{{ item }}" + state: latest + with_items: "{{ powerflex_common_packages }}" diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/CentOS.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/CentOS.yml new file mode 100644 index 000000000..cadab0571 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/CentOS.yml @@ -0,0 +1,4 @@ +--- +powerflex_common_packages: + - numactl + - libaio diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/RedHat.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/RedHat.yml new file mode 100644 index 000000000..03cedf354 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/RedHat.yml @@ -0,0 +1,6 @@ +--- +powerflex_common_packages: + - numactl + - libaio + - python3 + - binutils diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/Rocky.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/Rocky.yml new file mode 100644 index 000000000..03cedf354 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/Rocky.yml @@ -0,0 +1,6 @@ +--- +powerflex_common_packages: + - numactl + - libaio + - python3 + - binutils diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/SLES.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/SLES.yml new file mode 100644 index 000000000..0f15a62a6 --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/SLES.yml @@ -0,0 +1,4 @@ +--- +powerflex_common_packages: + - python3 + - libapr1 diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/Ubuntu.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/Ubuntu.yml new file mode 100644 index 000000000..6c5f371ec --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/Ubuntu.yml @@ -0,0 +1,5 @@ +--- +powerflex_common_packages: + - numactl + - libaio1 + - ldap-utils diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/VMkernel.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/VMkernel.yml new file mode 100644 index 000000000..3cc003a2a --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/VMkernel.yml @@ -0,0 +1,2 @@ +--- +powerflex_common_packages: [] diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/WindowsOS.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/WindowsOS.yml new file mode 100644 index 000000000..3cc003a2a --- /dev/null +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_common/vars/WindowsOS.yml @@ -0,0 +1,2 @@ +--- +powerflex_common_packages: [] |