From b643c52cf29ce5bbab738b43290af3556efa1ca9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 5 Jun 2024 18:18:41 +0200 Subject: Merging upstream version 10.0.0+dfsg. Signed-off-by: Daniel Baumann --- .../roles/powerflex_config/tasks/main.yml | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'ansible_collections/dellemc/powerflex/roles/powerflex_config') diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_config/tasks/main.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_config/tasks/main.yml index f9340f0fd..67bad8013 100644 --- a/ansible_collections/dellemc/powerflex/roles/powerflex_config/tasks/main.yml +++ b/ansible_collections/dellemc/powerflex/roles/powerflex_config/tasks/main.yml @@ -4,6 +4,7 @@ hostname: "{{ hostname }}" username: "{{ username }}" password: "{{ password }}" + port: "{{ port }}" validate_certs: "{{ validate_certs }}" state: "present" register: powerflex_config_mdm_ip_result @@ -13,6 +14,7 @@ ansible.builtin.set_fact: powerflex_config_array_version: "{{ powerflex_config_mdm_ip_result.mdm_cluster_details.master.versionInfo[1] }}" powerflex_config_mdm_primary_hostname: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" + powerflex_config_mdm_primary_ip: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }}" - name: Login to primary MDM of PowerFlex 3.6 ansible.builtin.command: scli --login --username {{ username }} --password "{{ password }}" @@ -22,8 +24,30 @@ delegate_to: "{{ powerflex_config_mdm_primary_hostname }}" when: powerflex_config_array_version == '3' -- name: Login to primary MDM of PowerFlex 4.5 - ansible.builtin.command: scli --login --username {{ username }} --management_system_ip {{ hostname }} --password "{{ password }}" +- name: Generate login certificate for PowerFlex version 4.x + block: + - name: Generate login certificate using management_system_ip + ansible.builtin.command: > + scli --generate_login_certificate --management_system_ip {{ hostname }} --username {{ username }} --password {{ password }} + --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ password }} --insecure + run_once: true + register: powerflex_config_generate_login_certificate + changed_when: powerflex_config_generate_login_certificate.rc == 0 + delegate_to: "{{ powerflex_config_mdm_primary_hostname }}" + when: powerflex_config_array_version == '4' + rescue: + - name: Generate login certificate using primary_mdm_ip + ansible.builtin.command: > + scli --generate_login_certificate --management_system_ip {{ powerflex_config_mdm_primary_ip }} --username {{ username }} + --password {{ password }} --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ password }} --insecure + run_once: true + register: powerflex_config_generate_login_certificate_mdm_ip + changed_when: powerflex_config_generate_login_certificate_mdm_ip.rc == 0 + delegate_to: "{{ powerflex_config_mdm_primary_hostname }}" + when: powerflex_config_array_version == '4' + +- name: Login to MDM for PowerFlex version 4.x + ansible.builtin.command: scli --login --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ password }} run_once: true register: powerflex_config_login_output changed_when: powerflex_config_login_output.rc == 0 @@ -61,6 +85,7 @@ hostname: "{{ hostname }}" username: "{{ username }}" password: "{{ password }}" + port: "{{ port }}" validate_certs: "{{ validate_certs }}" storage_pool_name: "{{ powerflex_storage_pool_name }}" protection_domain_name: "{{ powerflex_protection_domain_name }}" -- cgit v1.2.3