summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/powerflex/roles/powerflex_config
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_config
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_config')
-rw-r--r--ansible_collections/dellemc/powerflex/roles/powerflex_config/tasks/main.yml29
1 files changed, 27 insertions, 2 deletions
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 }}"