summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/powerflex/roles/powerflex_sdr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:18:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:18:41 +0000
commitb643c52cf29ce5bbab738b43290af3556efa1ca9 (patch)
tree21d5c53d7a9b696627a255777cefdf6f78968824 /ansible_collections/dellemc/powerflex/roles/powerflex_sdr
parentReleasing progress-linux version 9.5.1+dfsg-1~progress7.99u1. (diff)
downloadansible-b643c52cf29ce5bbab738b43290af3556efa1ca9.tar.xz
ansible-b643c52cf29ce5bbab738b43290af3556efa1ca9.zip
Merging upstream version 10.0.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/dellemc/powerflex/roles/powerflex_sdr')
-rw-r--r--ansible_collections/dellemc/powerflex/roles/powerflex_sdr/tasks/add_sdr.yml36
1 files changed, 27 insertions, 9 deletions
diff --git a/ansible_collections/dellemc/powerflex/roles/powerflex_sdr/tasks/add_sdr.yml b/ansible_collections/dellemc/powerflex/roles/powerflex_sdr/tasks/add_sdr.yml
index 1af345276..f7cbfa378 100644
--- a/ansible_collections/dellemc/powerflex/roles/powerflex_sdr/tasks/add_sdr.yml
+++ b/ansible_collections/dellemc/powerflex/roles/powerflex_sdr/tasks/add_sdr.yml
@@ -4,6 +4,7 @@
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
+ port: "{{ port }}"
validate_certs: "{{ validate_certs }}"
state: "present"
register: powerflex_sdr_mdm_ip_result
@@ -39,17 +40,34 @@
no_log: true
when: powerflex_sdr_array_version == "3"
-- name: Login to mdm for PowerFlex version 4.x
- ansible.builtin.command: >
- scli --login --management_system_ip {{ hostname }}
- --username admin
- --password "{{ password }}"
- --approve_certificate
+- 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_sdr_generate_login_certificate
+ changed_when: powerflex_sdr_generate_login_certificate.rc == 0
+ delegate_to: "{{ powerflex_sdr_mdm_primary_hostname }}"
+ when: powerflex_sdr_array_version != "3"
+ rescue:
+ - name: Generate login certificate using primary_mdm_ip
+ ansible.builtin.command: >
+ scli --generate_login_certificate --management_system_ip {{ powerflex_sdr_primary_mdm_ip }} --username {{ username }}
+ --password {{ password }} --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ password }} --insecure
+ run_once: true
+ register: powerflex_sdr_generate_login_certificate_mdm_ip
+ changed_when: powerflex_sdr_generate_login_certificate_mdm_ip.rc == 0
+ delegate_to: "{{ powerflex_sdr_mdm_primary_hostname }}"
+ when: powerflex_sdr_array_version != "3"
+
+- 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_initial_login
+ register: powerflex_sdr_login_output
+ changed_when: powerflex_sdr_login_output.rc == 0
delegate_to: "{{ powerflex_sdr_mdm_primary_hostname }}"
- changed_when: powerflex_initial_login.rc == 0
- no_log: true
when: powerflex_sdr_array_version != "3"
- name: Output msg of previous task login to mdm