├── .ansible-lint ├── .ansible-lint-ignore ├── .github ├── CODEOWNERS ├── Contributers_guide.md ├── ISSUE_TEMPLATE │ ├── ask-a-question.md │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md ├── pull_request_template.md └── workflows │ └── ansible-test.yml ├── .gitignore ├── CHANGELOG.rst ├── LICENSE ├── README.md ├── catalog-info.yaml ├── changelogs ├── .plugin-cache.yaml ├── changelog.yaml └── config.yaml ├── codecov.yml ├── docs ├── ADOPTERS.md ├── BRANCHING.md ├── CODE_OF_CONDUCT.md ├── COMMITTER_GUIDE.md ├── CONTRIBUTING.md ├── INSTALLATION.md ├── ISSUE_TRIAGE.md ├── MAINTAINERS.md ├── MAINTAINER_GUIDE.md ├── Release Notes.md ├── SECURITY.md ├── SUPPORT.md └── modules │ ├── device.rst │ ├── fault_set.rst │ ├── info.rst │ ├── mdm_cluster.rst │ ├── nvme_host.rst │ ├── protection_domain.rst │ ├── replication_consistency_group.rst │ ├── replication_pair.rst │ ├── resource_group.rst │ ├── sdc.rst │ ├── sds.rst │ ├── sdt.rst │ ├── snapshot.rst │ ├── snapshot_policy.rst │ ├── storagepool.rst │ └── volume.rst ├── galaxy.yml ├── meta ├── execution-environment.yml └── runtime.yml ├── playbooks ├── modules │ ├── device.yml │ ├── fault_set.yml │ ├── info.yml │ ├── mdm_cluster.yml │ ├── nvme_host.yml │ ├── protection_domain.yml │ ├── replication_consistency_group.yml │ ├── replication_pair.yml │ ├── resource_group.yml │ ├── sdc.yml │ ├── sds.yml │ ├── sdt.yml │ ├── snapshot.yml │ ├── snapshot_policy.yml │ ├── storagepool.yml │ └── volume.yml └── roles │ ├── group_vars │ └── all │ ├── host_vars │ ├── node2 │ ├── sdt1 │ └── sdt2 │ ├── inventory │ ├── site.yml │ ├── site_powerflex45.yml │ ├── uninstall_powerflex.yml │ ├── uninstall_powerflex45.yml │ └── vars_files │ └── connection.yml ├── plugins ├── doc_fragments │ └── powerflex.py ├── module_utils │ └── storage │ │ └── dell │ │ ├── __init__.py │ │ ├── libraries │ │ ├── __init__.py │ │ ├── configuration.py │ │ └── powerflex_base.py │ │ ├── logging_handler.py │ │ └── utils.py └── modules │ ├── device.py │ ├── fault_set.py │ ├── info.py │ ├── mdm_cluster.py │ ├── nvme_host.py │ ├── protection_domain.py │ ├── replication_consistency_group.py │ ├── replication_pair.py │ ├── resource_group.py │ ├── sdc.py │ ├── sds.py │ ├── sdt.py │ ├── snapshot.py │ ├── snapshot_policy.py │ ├── storagepool.py │ └── volume.py ├── requirements.txt ├── requirements.yml ├── roles ├── README.md ├── molecule.yml ├── powerflex_activemq │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_specs.yml │ │ └── main.yml │ ├── molecule │ │ ├── activemq_install │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── activemq_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ ├── tasks │ │ ├── install_activemq.yml │ │ ├── main.yml │ │ └── uninstall_activemq.yml │ └── vars │ │ └── main.yml ├── powerflex_common │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ └── main.yml │ ├── tasks │ │ ├── install_java_CentOS.yml │ │ ├── install_java_RedHat.yml │ │ ├── install_java_Rocky.yml │ │ ├── install_java_SLES.yml │ │ ├── install_java_Ubuntu.yml │ │ ├── install_packages_CentOS.yml │ │ ├── install_packages_RedHat.yml │ │ ├── install_packages_Rocky.yml │ │ ├── install_packages_SLES.yml │ │ ├── install_packages_Ubuntu.yml │ │ ├── install_packages_VMkernel.yml │ │ ├── install_packages_WindowsOS.yml │ │ ├── install_powerflex.yml │ │ └── main.yml │ └── vars │ │ ├── CentOS.yml │ │ ├── RedHat.yml │ │ ├── Rocky.yml │ │ ├── SLES.yml │ │ ├── Ubuntu.yml │ │ ├── VMkernel.yml │ │ └── WindowsOS.yml ├── powerflex_config │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_specs.yml │ │ └── main.yml │ ├── molecule │ │ └── configure_protection_domain │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ ├── tasks │ │ └── main.yml │ └── vars │ │ └── main.yml ├── powerflex_gateway │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── handlers │ │ └── main.yml │ ├── meta │ │ ├── argument_specs.yml │ │ └── main.yml │ ├── molecule │ │ ├── gateway_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── gateway_installation_invalid_path_rpm │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── gateway_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ ├── tasks │ │ ├── install_gateway.yml │ │ ├── install_keepalived.yml │ │ ├── main.yml │ │ └── uninstall_gateway.yml │ ├── templates │ │ └── keepalived.conf.j2 │ └── vars │ │ ├── CentOS.yml │ │ ├── RedHat.yml │ │ ├── SLES.yml │ │ ├── Ubuntu.yml │ │ └── main.yml ├── powerflex_lia │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ └── main.yml │ ├── molecule │ │ ├── lia_install │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── lia_installation_invalid_path_rpm │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── lia_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ ├── tasks │ │ ├── install_lia.yml │ │ ├── main.yml │ │ └── uninstall_lia.yml │ └── vars │ │ └── main.yml ├── powerflex_mdm │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_spec.yml │ │ └── main.yml │ ├── molecule │ │ ├── mdm_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── mdm_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ ├── tasks │ │ ├── add_certs.yml │ │ ├── install_mdm.yml │ │ ├── install_powerflex3x_mdm.yml │ │ ├── install_powerflex4x_mdm.yml │ │ ├── main.yml │ │ ├── mdm_set_facts.yml │ │ ├── remove_mdm.yml │ │ └── uninstall_mdm.yml │ └── vars │ │ ├── CentOS.yml │ │ ├── RedHat.yml │ │ ├── SLES.yml │ │ ├── Ubuntu.yml │ │ └── main.yml ├── powerflex_sdc │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── handlers │ │ └── main.yml │ ├── meta │ │ └── main.yml │ ├── molecule │ │ ├── sdc_install_map_volume_uninstall_negative │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sdc_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sdc_installation_invalid_path_rpm │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sdc_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── var_values.yml │ │ ├── wrong_sdc_credentials │ │ │ ├── converge.yml │ │ │ ├── inventory │ │ │ └── molecule.yml │ │ └── wrong_sdc_ip │ │ │ ├── converge.yml │ │ │ ├── inventory │ │ │ └── molecule.yml │ ├── tasks │ │ ├── configure_sdc.yml │ │ ├── install_sdc.yml │ │ ├── main.yml │ │ ├── register_esxi_sdc.yml │ │ ├── remove_sdc.yml │ │ ├── uninstall_esxi_sdc.yml │ │ └── uninstall_sdc.yml │ ├── templates │ │ └── driver_sync.conf.j2 │ └── vars │ │ └── main.yml ├── powerflex_sdr │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_specs.yml │ │ └── main.yml │ ├── molecule │ │ ├── sdr_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sdr_installation_invalid_path_rpm │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sdr_installation_invalid_pd │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sdr_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── var_values.yml │ ├── tasks │ │ ├── add_sdr.yml │ │ ├── main.yml │ │ ├── remove_sdr.yml │ │ └── sdr_set_facts.yml │ └── vars │ │ └── main.yml ├── powerflex_sds │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_spec.yml │ │ └── main.yml │ ├── molecule │ │ ├── sds_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── sds_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── var_values.yml │ ├── tasks │ │ ├── install_sds.yml │ │ ├── main.yml │ │ └── uninstall_sds.yml │ └── vars │ │ └── main.yml ├── powerflex_sdt │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_spec.yml │ │ └── main.yml │ ├── molecule │ │ ├── sdt_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ └── sdt_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ ├── tasks │ │ ├── install_sdt.yml │ │ ├── main.yml │ │ └── uninstall_sdt.yml │ └── vars │ │ └── main.yml ├── powerflex_tb │ ├── README.md │ ├── defaults │ │ └── main.yml │ ├── meta │ │ ├── argument_spec.yml │ │ ├── argument_specs.yml │ │ └── main.yml │ ├── molecule │ │ ├── tb_installation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── tb_uninstallation │ │ │ ├── converge.yml │ │ │ └── molecule.yml │ │ ├── var_values.yml │ │ └── wrong_tb_credentials │ │ │ ├── converge.yml │ │ │ ├── inventory │ │ │ └── molecule.yml │ ├── tasks │ │ ├── connect_mdm_cluster.yml │ │ ├── install_tb.yml │ │ ├── install_tb3x.yml │ │ ├── install_tb4x.yml │ │ ├── main.yml │ │ ├── set_tb_ips.yml │ │ └── uninstall_tb.yml │ └── vars │ │ └── main.yml └── powerflex_webui │ ├── README.md │ ├── defaults │ └── main.yml │ ├── meta │ ├── argument_specs.yml │ └── main.yml │ ├── molecule │ ├── webui_installation │ │ ├── converge.yml │ │ └── molecule.yml │ ├── webui_installation_invalid_path_rpm │ │ ├── converge.yml │ │ └── molecule.yml │ └── webui_uninstallation │ │ ├── converge.yml │ │ └── molecule.yml │ ├── tasks │ ├── install_webui.yml │ ├── main.yml │ └── uninstall_webui.yml │ └── vars │ └── main.yml └── tests ├── config.yml └── unit ├── __init__.py ├── plugins ├── __init__.py ├── module_utils │ ├── libraries │ │ ├── __init__.py │ │ ├── fail_json.py │ │ ├── initial_mock.py │ │ └── powerflex_unit_base.py │ ├── mock_api_exception.py │ ├── mock_device_api.py │ ├── mock_fail_json.py │ ├── mock_fault_set_api.py │ ├── mock_info_api.py │ ├── mock_mdm_cluster_api.py │ ├── mock_nvme_host_api.py │ ├── mock_protection_domain_api.py │ ├── mock_replication_consistency_group_api.py │ ├── mock_replication_pair_api.py │ ├── mock_resource_group_api.py │ ├── mock_sdc_api.py │ ├── mock_sdk_response.py │ ├── mock_sds_api.py │ ├── mock_sdt_api.py │ ├── mock_snapshot_policy_api.py │ ├── mock_storagepool_api.py │ └── mock_volume_api.py └── modules │ ├── __init__.py │ ├── test_device.py │ ├── test_fault_set.py │ ├── test_info.py │ ├── test_mdm_cluster.py │ ├── test_nvme_host.py │ ├── test_protection_domain.py │ ├── test_replication_consistency_group.py │ ├── test_replication_pair.py │ ├── test_resource_group.py │ ├── test_sdc.py │ ├── test_sds.py │ ├── test_sdt.py │ ├── test_snapshot_policy.py │ ├── test_storagepool.py │ └── test_volume.py └── requirements.txt /.ansible-lint: -------------------------------------------------------------------------------- 1 | exclude_paths: 2 | - .github/ 3 | -------------------------------------------------------------------------------- /.ansible-lint-ignore: -------------------------------------------------------------------------------- 1 | roles/powerflex_activemq/defaults/main.yml var-naming[no-role-prefix] 2 | roles/powerflex_config/defaults/main.yml var-naming[no-role-prefix] 3 | roles/powerflex_gateway/defaults/main.yml var-naming[no-role-prefix] 4 | roles/powerflex_gateway/vars/CentOS.yml var-naming[no-role-prefix] 5 | roles/powerflex_gateway/vars/Ubuntu.yml var-naming[no-role-prefix] 6 | roles/powerflex_gateway/vars/RedHat.yml var-naming[no-role-prefix] 7 | roles/powerflex_gateway/vars/SLES.yml var-naming[no-role-prefix] 8 | roles/powerflex_gateway/vars/main.yml var-naming[no-role-prefix] 9 | roles/powerflex_lia/defaults/main.yml var-naming[no-role-prefix] 10 | roles/powerflex_lia/vars/main.yml var-naming[no-role-prefix] 11 | roles/powerflex_mdm/defaults/main.yml var-naming[no-role-prefix] 12 | roles/powerflex_mdm/vars/main.yml var-naming[no-role-prefix] 13 | roles/powerflex_sdc/defaults/main.yml var-naming[no-role-prefix] 14 | roles/powerflex_sdc/vars/main.yml var-naming[no-role-prefix] 15 | roles/powerflex_sdr/defaults/main.yml var-naming[no-role-prefix] 16 | roles/powerflex_sds/defaults/main.yml var-naming[no-role-prefix] 17 | roles/powerflex_sds/vars/main.yml var-naming[no-role-prefix] 18 | roles/powerflex_sdt/vars/main.yml var-naming[no-role-prefix] 19 | roles/powerflex_tb/defaults/main.yml var-naming[no-role-prefix] 20 | roles/powerflex_tb/vars/main.yml var-naming[no-role-prefix] 21 | roles/powerflex_webui/defaults/main.yml var-naming[no-role-prefix] 22 | roles/powerflex_webui/vars/main.yml var-naming[no-role-prefix] 23 | roles/powerflex_gateway/molecule/gateway_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix] 24 | roles/powerflex_lia/molecule/lia_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix] 25 | roles/powerflex_sdc/molecule/sdc_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix] 26 | roles/powerflex_sdr/molecule/sdr_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix] 27 | roles/powerflex_sds/molecule/sds_installation/converge.yml var-naming[no-role-prefix] 28 | roles/powerflex_sdt/molecule/sdt_installation/converge.yml var-naming[no-role-prefix] 29 | roles/powerflex_webui/molecule/webui_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix] 30 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # CODEOWNERS 2 | # 3 | # documentation for this file can be found at: 4 | # https://help.github.com/en/articles/about-code-owners 5 | 6 | # These are the default owners for the code and will 7 | # be requested for review when someone opens a pull request. 8 | # order is alphabetical for easier maintenance. 9 | # 10 | # Ananthu Kuttattu (kuttattz) 11 | # Bhavneet Sharma (Bhavneet-Sharma) 12 | # Jennifer John (Jennifer-John) 13 | # Meenakshi Dembi (meenakshidembi691) 14 | # Pavan Mudunuri (Pavan-Mudunuri) 15 | # Trisha Datta (trisha-dell) 16 | 17 | # for all files: 18 | * @Bhavneet-Sharma @Jennifer-John @meenakshidembi691 @trisha-dell @felixs88 @sachin-apa 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ask-a-question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ask a question 3 | about: Ask a question. 4 | title: "[QUESTION]:" 5 | labels: type/question 6 | assignees: '' 7 | 8 | --- 9 | ### How can the Team help you today? 10 | 11 | **Details: ?** 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]:" 5 | labels: type/bug, needs-triage 6 | assignees: '' 7 | 8 | --- 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 1. Step 1 ... 15 | 2. Step 2 ... 16 | 3. Step 3 ... 17 | ... 18 | n. Step n See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Logs** 27 | If applicable, submit logs or stack traces from the affected services 28 | 29 | **System Information (please complete the following information):** 30 | - OS/Version: [e.g. RHEL 7.6] 31 | - Ansible Version [e.g. 2.12] 32 | - Python Version [e.g. 3.9] 33 | - Additional Information... 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ansible mailing list 4 | alias: ansible.team@dell.com 5 | about: Please ask and answer usage questions and report security issues here. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[FEATURE]:" 5 | labels: type/feature-request, needs-triage 6 | assignees: '' 7 | 8 | --- 9 | **Describe the solution you'd like** 10 | A clear and concise description of what you want to happen. 11 | 12 | **Describe alternatives you've considered** 13 | A clear and concise description of any alternative solutions or features you've considered. 14 | 15 | **Additional context** 16 | Add any other context or screenshots about the feature request here. 17 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | A few sentences describing the overall goals of the pull request's commits. 3 | 4 | # GitHub Issues 5 | List the GitHub issues impacted by this PR: 6 | 7 | | GitHub Issue # | 8 | | -------------- | 9 | | | 10 | 11 | # Checklist: 12 | 13 | - [ ] I have performed a self-review of my own code to ensure there are no formatting, pep8, linting, or security issues 14 | - [ ] I have performed Ansible Sanity test using --docker default 15 | - [ ] I have verified that new and existing unit tests pass locally with my changes 16 | - [ ] I have not allowed coverage numbers to degenerate 17 | - [ ] I have maintained at least 90% code coverage 18 | - [ ] I have commented my code, particularly in hard-to-understand areas 19 | - [ ] I have made corresponding changes to the documentation 20 | - [ ] I have added tests that prove my fix is effective or that my feature works 21 | - [ ] Backward compatibility is not broken 22 | 23 | # How Has This Been Tested? 24 | Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration 25 | 26 | - [ ] Test A 27 | - [ ] Test B 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | __pycache__/ 3 | *.log 4 | -------------------------------------------------------------------------------- /catalog-info.yaml: -------------------------------------------------------------------------------- 1 | # nonk8s 2 | apiVersion: backstage.io/v1alpha1 3 | kind: Component 4 | metadata: 5 | name: dell-ansible-powerflex 6 | description: "Ansible Modules for Dell Technologies PowerFlex" 7 | tags: 8 | - ansible 9 | - devops 10 | - automation 11 | - dell 12 | - infrastructure-as-code 13 | - powerflex 14 | annotations: 15 | backstage.io/techdocs-ref: dir:. 16 | github.com/project-slug: dell/ansible-powerflex 17 | links: 18 | - url: 'https://galaxy.ansible.com/dellemc/powerflex' 19 | title: 'Ansible Galaxy' 20 | icon: 'web' 21 | - url: 'https://console.redhat.com/ansible/automation-hub/repo/published/dellemc/powerflex' 22 | title: 'Automation Hub' 23 | icon: 'web' 24 | - url: 'https://github.com/dell/ansible-powerflex/issues' 25 | title: 'Contact Technical Support' 26 | icon: 'help' 27 | spec: 28 | type: service 29 | lifecycle: production 30 | owner: user:default/sachin_apagundi 31 | visibility: all 32 | -------------------------------------------------------------------------------- /changelogs/config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | changelog_filename_template: ../CHANGELOG.rst 3 | changelog_filename_version_depth: 0 4 | changes_file: changelog.yaml 5 | changes_format: combined 6 | ignore_other_fragment_extensions: true 7 | keep_fragments: false 8 | mention_ancestor: true 9 | new_plugins_after_name: removed_features 10 | notesdir: fragments 11 | prelude_section_name: release_summary 12 | prelude_section_title: Release Summary 13 | sanitize_changelog: true 14 | sections: 15 | - - major_changes 16 | - Major Changes 17 | - - minor_changes 18 | - Minor Changes 19 | - - breaking_changes 20 | - Breaking Changes / Porting Guide 21 | - - deprecated_features 22 | - Deprecated Features 23 | - - removed_features 24 | - Removed Features (previously deprecated) 25 | - - security_fixes 26 | - Security Fixes 27 | - - bugfixes 28 | - Bugfixes 29 | - - known_issues 30 | - Known Issues 31 | title: Dellemc.PowerFlex 32 | trivial_section_name: trivial 33 | use_fqcn: true 34 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - "/ansible_collections/dellemc/powerflex/::" 4 | -------------------------------------------------------------------------------- /docs/ADOPTERS.md: -------------------------------------------------------------------------------- 1 | # List of adopters 2 | -------------------------------------------------------------------------------- /docs/BRANCHING.md: -------------------------------------------------------------------------------- 1 | # Branching strategy 2 | 3 | Ansible modules for Dell PowerFlex follows a scaled trunk branching strategy where short-lived branches are created off of the main branch. When coding is complete, the branch is merged back into main after being approved in a pull request code review. 4 | 5 | ## Branch naming convention 6 | 7 | | Branch Type | Example | Comment | 8 | |--------------|-----------------------------------|-------------------------------------------| 9 | | main | main | | 10 | | Release | release-1.0 | hotfix: release-1.1 patch: release-1.0.1 | 11 | | Feature | feature-9-vol-support | "9" referring to GitHub issue ID | 12 | | Bug Fix | bugfix-110-fix-duplicates-issue | "110" referring to GitHub issue ID | 13 | 14 | 15 | ## Steps for working on a release branch 16 | 17 | 1. Fork the repository. 18 | 2. Create a branch off of the main branch. The branch name should follow [branch naming convention](#branch-naming-convention). 19 | 3. Make your changes and commit them to your branch. 20 | 4. If other code changes have merged into the upstream main branch, perform a rebase of those changes into your branch. 21 | 5. Open a [pull request](https://github.com/dell/ansible-powerflex/pulls) between your branch and the upstream main branch. 22 | 6. Once your pull request has merged, your branch can be deleted. 23 | -------------------------------------------------------------------------------- /docs/COMMITTER_GUIDE.md: -------------------------------------------------------------------------------- 1 | # Committer guidelines 2 | 3 | These are the guidelines for people with commit privileges on the GitHub repository. Committers act as members of the Core Team and not necessarily employees of Dell. 4 | 5 | These guidelines apply to everyone and as Committers you have been given access to commit changes because you exhibit good judgment and have demonstrated your commitment to the vision of the project. We trust that you will use these privileges wisely and not abuse it. 6 | 7 | If these privileges are abused in any way and the quality of the project is compromised, our trust will be diminished and you may be asked to not commit or lose these privileges all together. 8 | 9 | ## General rules 10 | 11 | ### Don't 12 | 13 | * Break the build. 14 | * Commit directly. 15 | * Compromise backward compatibility. 16 | * Disrespect your Community Team members. Help them grow. 17 | * Think it is someone elses job to test your code. Write tests for all the code you produce. 18 | * Forget to keep thing simple. 19 | * Create technical debt. Fix-in-place and make it the highest priority above everything else. 20 | 21 | ### Do 22 | 23 | * Keep it simple. 24 | * Good work, your best every time. 25 | * Keep the design of your software clean and maintainable. 26 | * Squash your commits, avoid merges. 27 | * Be active. Committers that are not active may have their permissions suspended. 28 | * Write tests for all your deliverables. 29 | * Automate everything. 30 | * Maintain a high code coverage. 31 | * Keep an open communication with other Committers. 32 | * Ask questions. 33 | * Document your contributions and remember to keep it simple. 34 | 35 | ## People 36 | 37 | | Name | GitHub ID | Nickname | 38 | |-------|-------------|------------| 39 | | | | | 40 | -------------------------------------------------------------------------------- /docs/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # Maintainers 2 | * Bhavneet Sharma (Bhavneet-Sharma) 3 | * Jennifer John (Jennifer-John) 4 | * Meenakshi Dembi (meenakshidembi691) 5 | * Trisha Datta (trisha-dell) 6 | -------------------------------------------------------------------------------- /docs/MAINTAINER_GUIDE.md: -------------------------------------------------------------------------------- 1 | # Maintainer guidelines 2 | 3 | As a Maintainer of this project you have the responsibility of keeping true to the vision of the project with a high-degree quality. Being part of this group is a privilege that requires dedication and time to attend to the daily activities that are associated with the maintenance of this project. 4 | 5 | ## Becoming a maintainer 6 | 7 | Most Maintainers started as Contributors that have demonstrated their commitment to the success of the project. Contributors wishing to become Maintainers, must demonstrate commitment to the success of the project by contributing code, reviewing others' work, and triaging issues on a regular basis for at least three months. 8 | 9 | The contributions alone don't make you a Maintainer. You need to earn the trust of the current Maintainers and other project Contributors, that your decisions and actions are in the best interest of the project. 10 | 11 | Periodically, the existing Maintainers curate a list of Contributors who have shown regular activity on the project over the prior months. It is from this list that Maintainer candidates are selected. 12 | 13 | After a candidate is selected, the existing Maintainers discuss the candidate over the next 5 business days, provide feedback, and vote. At least 75% of the current Maintainers must vote in the affirmative for a candidate to be moved to the role of Maintainer. 14 | 15 | If a candidate is approved, a Maintainer contacts the candidate to invite them to open a pull request that adds the contributor to the MAINTAINERS file. The candidate becomes a Maintainer once the pull request is merged. 16 | 17 | ## Maintainer policies 18 | 19 | * Lead by example 20 | * Follow the [Code of Conduct](https://github.com/dell/ansible-powerflex/blob/main/CODE_OF_CONDUCT.md) and the guidelines in the [Contributing](https://github.com/dell/ansible-powerflex/blob/main/CONTRIBUTING.md) and [Committer](https://github.com/dell/ansible-powerflex/blob/main/COMMITTER_GUIDE.md) guides 21 | * Promote a friendly and collaborative environment within our community 22 | * Be actively engaged in discussions, answering questions, updating defects, and reviewing pull requests 23 | * Criticize code, not people. Ideally, tell the contributor a better way to do what they need. 24 | * Clearly mark optional suggestions as such. Best practice, start your comment with *At your option: …* 25 | 26 | ## Project decision making 27 | 28 | All project decisions should contribute to successfully executing on the project roadmap. Project milestones are established for each release. -------------------------------------------------------------------------------- /docs/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security policy 2 | 3 | The Ansible modules for Dell PowerFlex repository are inspected for security vulnerabilities via blackduck scans and static code analysis. 4 | 5 | In addition to this, there are various security checks that get executed against a branch when a pull request is created/updated. Please refer to [pull request](https://github.com/dell/ansible-powerflex/blob/main/docs/CONTRIBUTING.md#Pull-requests) for more information. 6 | 7 | ## Reporting a vulnerability 8 | 9 | Have you discovered a security vulnerability in this project? 10 | We ask you to alert the maintainers by sending an email, describing the issue, impact, and fix - if applicable. 11 | 12 | You can reach the Ansible modules for Dell PowerFlex maintainers at ansible.team@dell.com. 13 | -------------------------------------------------------------------------------- /docs/SUPPORT.md: -------------------------------------------------------------------------------- 1 | ## Support 2 | For all your support needs you can interact with us on [GitHub](https://github.com/dell/ansible-powerflex) by creating a [GitHub Issue](https://github.com/dell/ansible-powerflex/issues) or through the [Ansible Community](https://www.dell.com/community/Automation/bd-p/Automation). 3 | -------------------------------------------------------------------------------- /meta/execution-environment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 3 3 | dependencies: 4 | # Absolute/relative path of requirements.yml 5 | galaxy: requirements.yml 6 | # Absolute/relative path of requirements.txt 7 | python: requirements.txt 8 | -------------------------------------------------------------------------------- /meta/runtime.yml: -------------------------------------------------------------------------------- 1 | --- 2 | requires_ansible: ">=2.15.0" 3 | plugin_routing: 4 | modules: 5 | dellemc_powerflex_gatherfacts: 6 | tombstone: 7 | removal_date: "2024-03-22" 8 | warning_text: Use info module instead. 9 | dellemc_powerflex_device: 10 | tombstone: 11 | removal_date: "2024-03-22" 12 | warning_text: Use device module instead. 13 | dellemc_powerflex_sdc: 14 | tombstone: 15 | removal_date: "2024-03-22" 16 | warning_text: Use sdc module instead. 17 | dellemc_powerflex_sds: 18 | tombstone: 19 | removal_date: "2024-03-22" 20 | warning_text: Use sds module instead. 21 | dellemc_powerflex_snapshot: 22 | tombstone: 23 | removal_date: "2024-03-22" 24 | warning_text: Use snapshot module instead. 25 | dellemc_powerflex_storagepool: 26 | tombstone: 27 | removal_date: "2024-03-22" 28 | warning_text: Use storagepool module instead. 29 | dellemc_powerflex_volume: 30 | tombstone: 31 | removal_date: "2024-03-22" 32 | warning_text: Use volume module instead. 33 | -------------------------------------------------------------------------------- /playbooks/modules/fault_set.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Fault set Operations 3 | hosts: localhost 4 | connection: local 5 | gather_facts: false 6 | vars: 7 | hostname: 'x.x.x.x' 8 | username: 'admin' 9 | password: 'Password' 10 | validate_certs: false 11 | host_port: 443 12 | fault_set_name: "sample_fault_set_name_1" 13 | protection_domain_name: "Ansible-PD1" 14 | 15 | tasks: 16 | - name: Create fault set 17 | dellemc.powerflex.fault_set: 18 | hostname: "{{ hostname }}" 19 | username: "{{ username }}" 20 | password: "{{ password }}" 21 | validate_certs: "{{ validate_certs }}" 22 | port: "{{ host_port }}" 23 | fault_set_name: "{{ fault_set_name }}" 24 | protection_domain_name: "{{ protection_domain_name }}" 25 | 26 | - name: Get fault set details using name and protection domain 27 | register: result 28 | dellemc.powerflex.fault_set: 29 | hostname: "{{ hostname }}" 30 | username: "{{ username }}" 31 | password: "{{ password }}" 32 | validate_certs: "{{ validate_certs }}" 33 | port: "{{ host_port }}" 34 | fault_set_name: "{{ fault_set_name }}" 35 | protection_domain_name: "{{ protection_domain_name }}" 36 | 37 | - name: Get fault set details using ID 38 | dellemc.powerflex.fault_set: 39 | hostname: "{{ hostname }}" 40 | username: "{{ username }}" 41 | password: "{{ password }}" 42 | validate_certs: "{{ validate_certs }}" 43 | port: "{{ host_port }}" 44 | fault_set_id: "{{ result.fault_set_details.id }}" 45 | state: "present" 46 | 47 | - name: Rename fault set details using ID 48 | dellemc.powerflex.fault_set: 49 | hostname: "{{ hostname }}" 50 | username: "{{ username }}" 51 | password: "{{ password }}" 52 | validate_certs: "{{ validate_certs }}" 53 | port: "{{ host_port }}" 54 | fault_set_id: "{{ result.fault_set_details.id }}" 55 | fault_set_new_name: "fault_set_new_name" 56 | state: "present" 57 | 58 | - name: Delete fault set 59 | dellemc.powerflex.fault_set: 60 | hostname: "{{ hostname }}" 61 | username: "{{ username }}" 62 | password: "{{ password }}" 63 | validate_certs: "{{ validate_certs }}" 64 | port: "{{ host_port }}" 65 | fault_set_name: "fault_set_new_name" 66 | protection_domain_name: "{{ protection_domain_name }}" 67 | state: "absent" 68 | -------------------------------------------------------------------------------- /playbooks/modules/nvme_host.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: NVMe Host Operations 3 | hosts: localhost 4 | connection: local 5 | gather_facts: false 6 | vars: 7 | hostname: 'x.x.x.x' 8 | username: 'admin' 9 | password: 'Password' 10 | validate_certs: false 11 | nvme_host_name: test_nvme_host 12 | nvme_host_new_name: test_nvme_host_new 13 | nqn: nqn 14 | max_num_paths: '5' 15 | max_num_sys_ports: '12' 16 | 17 | tasks: 18 | - name: Create NVMe host 19 | dellemc.powerflex.nvme_host: 20 | hostname: "{{ hostname }}" 21 | username: "{{ username }}" 22 | password: "{{ password }}" 23 | validate_certs: "{{ validate_certs }}" 24 | nqn: "{{ nqn }}" 25 | nvme_host_name: "{{ nvme_host_name }}" 26 | state: "present" 27 | 28 | - name: Rename nvme_host using NVMe host id 29 | dellemc.powerflex.nvme_host: 30 | hostname: "{{ hostname }}" 31 | username: "{{ username }}" 32 | password: "{{ password }}" 33 | validate_certs: "{{ validate_certs }}" 34 | nvme_host_name: "{{ nvme_host_name }}" 35 | nvme_host_new_name: "{{ nvme_host_new_name }}" 36 | state: "present" 37 | 38 | - name: Set maximum number of paths per volume and maximum Number of Ports Per Protection Domain of nvme_host 39 | dellemc.powerflex.nvme_host: 40 | hostname: "{{ hostname }}" 41 | username: "{{ username }}" 42 | password: "{{ password }}" 43 | validate_certs: "{{ validate_certs }}" 44 | nvme_host_name: "{{ nvme_host_name }}" 45 | max_num_paths: "{{ max_num_paths }}" 46 | max_num_sys_ports: "{{ max_num_sys_ports }}" 47 | state: "present" 48 | 49 | - name: Remove nvme_host 50 | dellemc.powerflex.nvme_host: 51 | hostname: "{{ hostname }}" 52 | username: "{{ username }}" 53 | password: "{{ password }}" 54 | validate_certs: "{{ validate_certs }}" 55 | nvme_host_name: "{{ nvme_host_name }}" 56 | state: "absent" 57 | -------------------------------------------------------------------------------- /playbooks/modules/replication_pair.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Replication pair operations on PowerFlex array. 3 | hosts: localhost 4 | connection: local 5 | gather_facts: false 6 | vars: 7 | hostname: 'x.x.x.x' 8 | remote_hostname: '**.**.**.**' 9 | username: 'admin' 10 | password: 'Password' 11 | validate_certs: false 12 | rcg_name: "test_rcg" 13 | rcg_id: "aadc17d900000002" 14 | 15 | tasks: 16 | - name: Get replication pair details by name 17 | register: result 18 | dellemc.powerflex.replication_pair: 19 | hostname: "{{ hostname }}" 20 | username: "{{ username }}" 21 | password: "{{ password }}" 22 | validate_certs: "{{ validate_certs }}" 23 | pair_name: "test_pair" 24 | 25 | - name: Add replication pair to RCG 26 | register: result 27 | dellemc.powerflex.replication_pair: 28 | hostname: "{{ hostname }}" 29 | username: "{{ username }}" 30 | password: "{{ password }}" 31 | validate_certs: "{{ validate_certs }}" 32 | pairs: 33 | - source_volume_name: "ans_test_vol" 34 | target_volume_name: "ans_env8_vol" 35 | copy_type: "OnlineCopy" 36 | name: "test_pair" 37 | rcg_name: "test_rcg" 38 | remote_peer: 39 | hostname: "{{ remote_hostname }}" 40 | username: "{{ username }}" 41 | password: "{{ password }}" 42 | validate_certs: "{{ validate_certs }}" 43 | 44 | - name: Pause Replication pair 45 | register: result 46 | dellemc.powerflex.replication_pair: 47 | hostname: "{{ hostname }}" 48 | username: "{{ username }}" 49 | password: "{{ password }}" 50 | validate_certs: "{{ validate_certs }}" 51 | pair_name: "test_pair" 52 | pause: true 53 | 54 | - name: Resume Replication pair 55 | register: result 56 | dellemc.powerflex.replication_pair: 57 | hostname: "{{ hostname }}" 58 | username: "{{ username }}" 59 | password: "{{ password }}" 60 | validate_certs: "{{ validate_certs }}" 61 | pair_name: "test_pair" 62 | pause: false 63 | 64 | - name: Delete replication pair 65 | register: result 66 | dellemc.powerflex.replication_pair: 67 | hostname: "{{ hostname }}" 68 | username: "{{ username }}" 69 | password: "{{ password }}" 70 | validate_certs: "{{ validate_certs }}" 71 | pair_name: "test_pair" 72 | state: "absent" 73 | 74 | - name: Delete replication pair - Idemotency 75 | register: result 76 | dellemc.powerflex.replication_pair: 77 | hostname: "{{ hostname }}" 78 | username: "{{ username }}" 79 | password: "{{ password }}" 80 | validate_certs: "{{ validate_certs }}" 81 | pair_name: "test_pair" 82 | state: "absent" 83 | -------------------------------------------------------------------------------- /playbooks/modules/resource_group.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Resource group operations on PowerFlex array. 3 | hosts: localhost 4 | connection: local 5 | gather_facts: false 6 | vars: 7 | hostname: 'x.x.x.x' 8 | username: 'admin' 9 | password: 'Password' 10 | validate_certs: false 11 | host_port: 443 12 | resource_group_name_1: "ans_rg" 13 | node_1: "vpi2170" 14 | template_id: "c65d0172-8666-48ab-935e-9a0bf69ed66d" 15 | 16 | tasks: 17 | - name: Validate deployment of a resource group 18 | register: result 19 | dellemc.powerflex.resource_group: 20 | hostname: "{{ hostname }}" 21 | username: "{{ username }}" 22 | password: "{{ password }}" 23 | validate_certs: "{{ validate_certs }}" 24 | resource_group_name: "{{ resource_group_name_1 }}" 25 | description: ans_rg 26 | template_id: "{{ template_id }}" 27 | firmware_repository_name: "PowerFlex 4.5.0.0" 28 | validate: true 29 | 30 | - name: Deploy a resource group 31 | register: result 32 | dellemc.powerflex.resource_group: 33 | hostname: "{{ hostname }}" 34 | username: "{{ username }}" 35 | password: "{{ password }}" 36 | validate_certs: "{{ validate_certs }}" 37 | resource_group_name: "{{ resource_group_name_1 }}" 38 | description: ans_rg 39 | template_id: "{{ template_id }}" 40 | firmware_repository_name: "PowerFlex 4.5.0.0" 41 | 42 | - name: Add a node to a resource group 43 | dellemc.powerflex.resource_group: 44 | hostname: "{{ hostname }}" 45 | username: "{{ username }}" 46 | password: "{{ password }}" 47 | validate_certs: "{{ validate_certs }}" 48 | resource_group_name: "{{ resource_group_name_1 }}" 49 | scaleup: true 50 | clone_node: "{{ node_1 }}" 51 | node_count: 2 52 | 53 | - name: Modify a resource group 54 | dellemc.powerflex.resource_group: 55 | hostname: "{{ hostname }}" 56 | username: "{{ username }}" 57 | password: "{{ password }}" 58 | validate_certs: "{{ validate_certs }}" 59 | resource_group_name: "{{ resource_group_name_1 }}" 60 | new_resource_group_name: "new_resource_group_name" 61 | description: "description new" 62 | 63 | - name: Delete a resource group 64 | register: result 65 | dellemc.powerflex.resource_group: 66 | hostname: "{{ hostname }}" 67 | username: "{{ username }}" 68 | password: "{{ password }}" 69 | validate_certs: "{{ validate_certs }}" 70 | resource_group_name: "{{ resource_group_name_1 }}" 71 | state: "absent" 72 | -------------------------------------------------------------------------------- /playbooks/modules/sdc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: SDC Operations 3 | hosts: localhost 4 | connection: local 5 | gather_facts: false 6 | vars: 7 | hostname: 'x.x.x.x' 8 | username: 'admin' 9 | password: 'Password' 10 | validate_certs: false 11 | sdc_name: test_sdc 12 | 13 | tasks: 14 | - name: Get sdc details using sdc ip 15 | register: result 16 | dellemc.powerflex.sdc: 17 | hostname: "{{ hostname }}" 18 | username: "{{ username }}" 19 | password: "{{ password }}" 20 | validate_certs: "{{ validate_certs }}" 21 | sdc_ip: "1.1.1.1" 22 | state: "present" 23 | 24 | - name: Set sdc id 25 | ansible.builtin.set_fact: 26 | sdc_id: "{{ result.sdc_details.id }}" 27 | 28 | - name: Rename sdc using sdc id 29 | dellemc.powerflex.sdc: 30 | hostname: "{{ hostname }}" 31 | username: "{{ username }}" 32 | password: "{{ password }}" 33 | validate_certs: "{{ validate_certs }}" 34 | sdc_id: "{{ sdc_id }}" 35 | sdc_new_name: "{{ sdc_name }}" 36 | state: "present" 37 | 38 | - name: Get sdc details using sdc name 39 | dellemc.powerflex.sdc: 40 | hostname: "{{ hostname }}" 41 | username: "{{ username }}" 42 | password: "{{ password }}" 43 | validate_certs: "{{ validate_certs }}" 44 | sdc_name: "{{ sdc_name }}" 45 | state: "present" 46 | 47 | - name: Set performance profile of sdc using sdc name 48 | dellemc.powerflex.sdc: 49 | hostname: "{{ hostname }}" 50 | username: "{{ username }}" 51 | password: "{{ password }}" 52 | validate_certs: "{{ validate_certs }}" 53 | sdc_name: "{{ sdc_name }}" 54 | performance_profile: "HighPerformance" 55 | state: "present" 56 | 57 | - name: Remove sdc 58 | dellemc.powerflex.sdc: 59 | hostname: "{{ hostname }}" 60 | username: "{{ username }}" 61 | password: "{{ password }}" 62 | validate_certs: "{{ validate_certs }}" 63 | sdc_name: "{{ sdc_name }}" 64 | state: "absent" 65 | -------------------------------------------------------------------------------- /playbooks/roles/group_vars/all: -------------------------------------------------------------------------------- 1 | powerflex_common_file_install_location: "/var/tmp" 2 | powerflex_common_esxi_files_location: "/tmp/" 3 | powerflex_common_win_package_location: "C:\\Windows\\Temp" 4 | powerflex_gateway_disable_gpg_check: true 5 | # powerflex sdc params 6 | powerflex_sdc_driver_sync_repo_address: 'ftp://ftp.emc.com/' 7 | powerflex_sdc_driver_sync_repo_user: 'QNzgdxXix' 8 | powerflex_sdc_driver_sync_repo_password: 'Aw3wFAwAq3' 9 | powerflex_sdc_driver_sync_repo_local_dir: '/bin/emc/scaleio/scini_sync/driver_cache/' 10 | powerflex_sdc_driver_sync_user_private_rsa_key_src: '' 11 | powerflex_sdc_driver_sync_user_private_rsa_key_dest: '/bin/emc/scaleio/scini_sync/scini_key' 12 | powerflex_sdc_driver_sync_repo_public_rsa_key_src: '' 13 | powerflex_sdc_driver_sync_repo_public_rsa_key_dest: '/bin/emc/scaleio/scini_sync/scini_repo_key.pub' 14 | powerflex_sdc_driver_sync_module_sigcheck: 1 15 | powerflex_sdc_driver_sync_emc_public_gpg_key_src: ../../../files/RPM-GPG-KEY-powerflex_2.0.*.0 16 | powerflex_sdc_driver_sync_emc_public_gpg_key_dest: '/bin/emc/scaleio/scini_sync/emc_key.pub' 17 | powerflex_sdc_driver_sync_sync_pattern: .* 18 | powerflex_sdc_state: present 19 | # powerflex mdm role params 20 | powerflex_mdm_state: present 21 | powerflex_mdm_password: 'Password123' 22 | powerflex_mdm_cert_password: 'Password123!' 23 | i_am_sure: 1 24 | powerflex_mdm_virtual_ip: '' 25 | # powerflex lia params 26 | powerflex_lia_state: present 27 | powerflex_lia_token: Cluster1! 28 | # powerflex tb params 29 | powerflex_tb_state: present 30 | powerflex_tb_cert_password: "{{ powerflex_mdm_cert_password }}" 31 | # powerflex sds params 32 | powerflex_sds_number: 1 33 | powerflex_sds_disks: { ansible_available_disks: ['/dev/sdb'] } 34 | powerflex_sds_disks_type: HDD 35 | powerflex_sds_protection_domain: domain1 36 | powerflex_sds_storage_pool: pool1 37 | powerflex_sds_role: all 38 | powerflex_sds_device_media_type: HDD 39 | powerflex_sds_device_name: '/dev/sdb' 40 | powerflex_sds_external_acceleration_type: ReadAndWrite 41 | powerflex_sds_state: present 42 | # powerflex webui params 43 | powerflex_webui_state: present 44 | # powerflex gateway role params 45 | powerflex_gateway_state: present 46 | powerflex_gateway_admin_password: Password123 47 | powerflex_gateway_http_port: 80 48 | powerflex_gateway_https_port: 443 49 | powerflex_gateway_is_redundant: false 50 | #powerflex sdr params 51 | powerflex_protection_domain_name: domain1 52 | powerflex_storage_pool_name: pool1 53 | #powerflex sdt params 54 | powerflex_sdt_storage_port: 12200 55 | powerflex_sdt_nvme_port: 4420 56 | powerflex_sdt_discovery_port: 8009 57 | powerflex_sdt_protection_domain: PD1 58 | powerflex_sdt_state: present 59 | -------------------------------------------------------------------------------- /playbooks/roles/host_vars/node2: -------------------------------------------------------------------------------- 1 | # SDC params 2 | powerflex_sdc_name: sdc_test 3 | powerflex_sdc_performance_profile: Compact 4 | #TB params 5 | powerflex_tb_primary_name: primary_tb 6 | powerflex_tb_secondary_name: secondary_tb 7 | powerflex_tb_cluster_mode: "ThreeNodes" 8 | powerflex_protection_domain_name: "domain1" 9 | powerflex_fault_sets: ['fs1','fs2','fs3'] 10 | powerflex_media_type: 'SSD' # When version is R3 11 | powerflex_storage_pool_name: "pool1" 12 | -------------------------------------------------------------------------------- /playbooks/roles/host_vars/sdt1: -------------------------------------------------------------------------------- 1 | #powerflex sdt params 2 | powerflex_sdt_ip_list: 10.x.x.1,10.x.x.2 3 | powerflex_sdt_role_list: storage_and_host,storage_and_host 4 | -------------------------------------------------------------------------------- /playbooks/roles/host_vars/sdt2: -------------------------------------------------------------------------------- 1 | #powerflex sdt params 2 | powerflex_sdt_ip_list: 10.x.y.1,10.x.y.2 3 | powerflex_sdt_role_list: storage_and_host,storage_and_host 4 | -------------------------------------------------------------------------------- /playbooks/roles/inventory: -------------------------------------------------------------------------------- 1 | node0 ansible_host=10.1.1.1 ansible_port=22 ansible_ssh_pass=password ansible_user=root 2 | node1 ansible_host=10.x.x.x ansible_port=22 ansible_ssh_pass=password ansible_user=root 3 | node2 ansible_host=10.x.x.y ansible_port=22 ansible_ssh_pass=password ansible_user=root 4 | sdt1 ansible_host=10.x.x.x ansible_port=22 ansible_ssh_pass=password ansible_user=root 5 | sdt2 ansible_host=10.x.x.y ansible_port=22 ansible_ssh_pass=password ansible_user=root 6 | 7 | [activemq] 8 | node0 9 | node1 10 | 11 | [lia] 12 | node0 13 | node1 14 | node2 15 | 16 | [mdm] 17 | node0 18 | node1 19 | 20 | [gateway] 21 | node2 22 | 23 | [tb] 24 | node2 25 | 26 | [config] 27 | node1 28 | 29 | [sdc] 30 | node2 31 | 32 | [sds] 33 | node0 34 | node1 35 | node2 36 | 37 | [webui] 38 | node1 39 | 40 | [sdr] 41 | node0 42 | node1 43 | node2 44 | 45 | [sdt] 46 | sdt1 47 | sdt2 48 | -------------------------------------------------------------------------------- /playbooks/roles/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: "Install PowerFlex Common" 3 | hosts: all 4 | roles: 5 | - powerflex_common 6 | 7 | - name: Install and configure PowerFlex MDM 8 | hosts: mdm 9 | roles: 10 | - powerflex_mdm 11 | 12 | - name: Install and configure PowerFlex gateway 13 | hosts: gateway 14 | roles: 15 | - powerflex_gateway 16 | 17 | - name: Install and configure PowerFlex TB 18 | hosts: tb 19 | vars_files: 20 | - vars_files/connection.yml 21 | roles: 22 | - powerflex_tb 23 | 24 | - name: Configure protection domain, fault set and storage pool. 25 | hosts: config 26 | vars_files: 27 | - vars_files/connection.yml 28 | roles: 29 | - powerflex_config 30 | 31 | - name: Install and configure PowerFlex Web UI 32 | hosts: webui 33 | vars_files: 34 | - vars_files/connection.yml 35 | roles: 36 | - powerflex_webui 37 | 38 | - name: Install and configure PowerFlex SDC 39 | hosts: sdc 40 | vars_files: 41 | - vars_files/connection.yml 42 | roles: 43 | - powerflex_sdc 44 | 45 | - name: Install and configure PowerFlex LIA 46 | hosts: lia 47 | vars_files: 48 | - vars_files/connection.yml 49 | roles: 50 | - powerflex_lia 51 | 52 | - name: Install and configure PowerFlex SDS 53 | hosts: sds 54 | vars_files: 55 | - vars_files/connection.yml 56 | roles: 57 | - powerflex_sds 58 | 59 | - name: Install PowerFlex SDR 60 | hosts: sdr 61 | vars_files: 62 | - vars_files/connection.yml 63 | roles: 64 | - powerflex_sdr 65 | -------------------------------------------------------------------------------- /playbooks/roles/site_powerflex45.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: "Install PowerFlex Common" 3 | hosts: all 4 | roles: 5 | - powerflex_common 6 | 7 | - name: Install and configure PowerFlex ActiveMQ 8 | hosts: activemq 9 | vars_files: 10 | - vars_files/connection.yml 11 | roles: 12 | - powerflex_activemq 13 | 14 | - name: Install and configure PowerFlex LIA 15 | hosts: lia 16 | vars_files: 17 | - vars_files/connection.yml 18 | roles: 19 | - powerflex_lia 20 | 21 | - name: Install and configure PowerFlex MDM 22 | hosts: mdm 23 | roles: 24 | - powerflex_mdm 25 | 26 | - name: Install and configure PowerFlex TB 27 | hosts: tb 28 | vars_files: 29 | - vars_files/connection.yml 30 | roles: 31 | - powerflex_tb 32 | 33 | - name: Configure protection domain, fault set and storage pool. 34 | hosts: config 35 | vars_files: 36 | - vars_files/connection.yml 37 | roles: 38 | - powerflex_config 39 | 40 | - name: Install and configure PowerFlex SDC 41 | hosts: sdc 42 | vars_files: 43 | - vars_files/connection.yml 44 | roles: 45 | - powerflex_sdc 46 | 47 | - name: Install and configure PowerFlex SDS 48 | hosts: sds 49 | vars_files: 50 | - vars_files/connection.yml 51 | roles: 52 | - powerflex_sds 53 | 54 | - name: Install PowerFlex SDR 55 | hosts: sdr 56 | vars_files: 57 | - vars_files/connection.yml 58 | roles: 59 | - powerflex_sdr 60 | 61 | - name: Install and configure PowerFlex SDT 62 | hosts: sdt 63 | vars_files: 64 | - vars_files/connection.yml 65 | roles: 66 | - powerflex_sdt 67 | -------------------------------------------------------------------------------- /playbooks/roles/uninstall_powerflex.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall PowerFlex SDC 3 | hosts: sdc 4 | vars_files: 5 | - vars_files/connection.yml 6 | roles: 7 | - powerflex_sdc 8 | vars: 9 | powerflex_sdc_state: absent 10 | 11 | - name: Uninstall PowerFlex SDS 12 | hosts: sds 13 | vars_files: 14 | - vars_files/connection.yml 15 | roles: 16 | - powerflex_sds 17 | vars: 18 | powerflex_sds_state: absent 19 | 20 | - name: Uninstall PowerFlex SDR 21 | hosts: sdr 22 | vars_files: 23 | - vars_files/connection.yml 24 | roles: 25 | - powerflex_sdr 26 | vars: 27 | powerflex_sdr_state: absent 28 | 29 | - name: Uninstall PowerFlex LIA 30 | hosts: lia 31 | roles: 32 | - powerflex_lia 33 | vars: 34 | powerflex_lia_state: absent 35 | 36 | - name: Uninstall PowerFlex web UI 37 | hosts: webui 38 | roles: 39 | - powerflex_webui 40 | vars: 41 | powerflex_webui_state: absent 42 | 43 | - name: Uninstall PowerFlex TB 44 | hosts: tb 45 | vars_files: 46 | - vars_files/connection.yml 47 | roles: 48 | - powerflex_tb 49 | vars: 50 | powerflex_tb_state: absent 51 | 52 | - name: Uninstall PowerFlex gateway 53 | hosts: gateway 54 | roles: 55 | - powerflex_gateway 56 | vars: 57 | powerflex_gateway_state: absent 58 | 59 | - name: Uninstall PowerFlex MDM 60 | hosts: mdm 61 | roles: 62 | - powerflex_mdm 63 | vars: 64 | powerflex_mdm_state: absent 65 | -------------------------------------------------------------------------------- /playbooks/roles/uninstall_powerflex45.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall PowerFlex SDC 3 | hosts: sdc 4 | vars_files: 5 | - vars_files/connection.yml 6 | roles: 7 | - powerflex_sdc 8 | vars: 9 | powerflex_sdc_state: absent 10 | 11 | - name: Uninstall PowerFlex SDS 12 | hosts: sds 13 | vars_files: 14 | - vars_files/connection.yml 15 | roles: 16 | - powerflex_sds 17 | vars: 18 | powerflex_sds_state: absent 19 | 20 | - name: Uninstall PowerFlex SDR 21 | hosts: sdr 22 | vars_files: 23 | - vars_files/connection.yml 24 | roles: 25 | - powerflex_sdr 26 | vars: 27 | powerflex_sdr_state: absent 28 | 29 | - name: Uninstall PowerFlex TB 30 | hosts: tb 31 | vars_files: 32 | - vars_files/connection.yml 33 | roles: 34 | - powerflex_tb 35 | vars: 36 | powerflex_tb_state: absent 37 | 38 | - name: Uninstall PowerFlex MDM 39 | hosts: mdm 40 | roles: 41 | - powerflex_mdm 42 | vars_files: 43 | - vars_files/connection.yml 44 | vars: 45 | powerflex_mdm_state: absent 46 | 47 | - name: Uninstall PowerFlex LIA 48 | hosts: lia 49 | roles: 50 | - powerflex_lia 51 | vars: 52 | powerflex_lia_state: absent 53 | 54 | - name: Uninstall PowerFlex ActiveMQ 55 | hosts: activemq 56 | vars: 57 | powerflex_activemq_state: absent 58 | vars_files: 59 | - vars_files/connection.yml 60 | roles: 61 | - powerflex_activemq 62 | 63 | - name: Uninstall PowerFlex SDT 64 | hosts: sdt 65 | vars_files: 66 | - vars_files/connection.yml 67 | roles: 68 | - powerflex_sdt 69 | vars: 70 | powerflex_sdt_state: absent 71 | -------------------------------------------------------------------------------- /playbooks/roles/vars_files/connection.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # common params 3 | hostname: 10.XX.XX.XX 4 | username: 'user' 5 | password: 'password' 6 | validate_certs: false 7 | port: 443 8 | timeout: 120 9 | -------------------------------------------------------------------------------- /plugins/doc_fragments/powerflex.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies. 2 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 3 | 4 | from __future__ import absolute_import, division, print_function 5 | __metaclass__ = type 6 | 7 | 8 | class ModuleDocFragment(object): 9 | # Documentation fragment for PowerFlex 10 | DOCUMENTATION = r''' 11 | options: 12 | hostname: 13 | required: true 14 | description: 15 | - IP or FQDN of the PowerFlex host. 16 | type: str 17 | aliases: 18 | - gateway_host 19 | username: 20 | type: str 21 | required: true 22 | description: 23 | - The username of the PowerFlex host. 24 | password: 25 | type: str 26 | required: true 27 | description: 28 | - The password of the PowerFlex host. 29 | validate_certs: 30 | type: bool 31 | default: true 32 | aliases: 33 | - verifycert 34 | description: 35 | - Boolean variable to specify whether or not to validate SSL 36 | certificate. 37 | - C(true) - Indicates that the SSL certificate should be verified. 38 | - C(false) - Indicates that the SSL certificate should not be 39 | verified. 40 | port: 41 | description: 42 | - Port number through which communication happens with PowerFlex 43 | host. 44 | type: int 45 | default: 443 46 | timeout: 47 | description: 48 | - Time after which connection will get terminated. 49 | - It is to be mentioned in seconds. 50 | type: int 51 | required: false 52 | default: 120 53 | requirements: 54 | - A Dell PowerFlex storage system version 3.6 or later. 55 | - PyPowerFlex 1.14.0. 56 | notes: 57 | - The modules present in the collection named as 'dellemc.powerflex' 58 | are built to support the Dell PowerFlex storage platform. 59 | ''' 60 | -------------------------------------------------------------------------------- /plugins/module_utils/storage/dell/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/ansible-powerflex/54fa6ee63f738fe0c23d9555611a7b91271207f3/plugins/module_utils/storage/dell/__init__.py -------------------------------------------------------------------------------- /plugins/module_utils/storage/dell/libraries/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/ansible-powerflex/54fa6ee63f738fe0c23d9555611a7b91271207f3/plugins/module_utils/storage/dell/libraries/__init__.py -------------------------------------------------------------------------------- /plugins/module_utils/storage/dell/libraries/powerflex_base.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | from __future__ import (absolute_import, division, print_function) 6 | 7 | __metaclass__ = type 8 | 9 | from ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell \ 10 | import utils 11 | 12 | LOG = utils.get_logger('powerflex_base') 13 | 14 | 15 | class PowerFlexBase: 16 | 17 | '''PowerFlex Base Class''' 18 | 19 | def __init__(self, ansible_module, ansible_module_params): 20 | """ 21 | Initialize the powerflex base class 22 | 23 | :param ansible_module: Ansible module class 24 | :type ansible_module: AnsibleModule 25 | :param ansible_module_params: Parameters for ansible module class 26 | :type ansible_module_params: dict 27 | """ 28 | self.module_params = utils.get_powerflex_gateway_host_parameters() 29 | ansible_module_params['argument_spec'].update(self.module_params) 30 | 31 | # Initialize the ansible module 32 | self.module = ansible_module( 33 | **ansible_module_params 34 | ) 35 | 36 | utils.ensure_required_libs(self.module) 37 | self.result = {"changed": False} 38 | 39 | try: 40 | self.powerflex_conn = utils.get_powerflex_gateway_host_connection( 41 | self.module.params) 42 | LOG.info("Got the PowerFlex system connection object instance") 43 | except Exception as e: 44 | LOG.error(str(e)) 45 | self.module.fail_json(msg=str(e)) 46 | -------------------------------------------------------------------------------- /plugins/module_utils/storage/dell/logging_handler.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2022, Dell Technologies 2 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 3 | 4 | """Custom rotating file handler for PowerFlex""" 5 | 6 | from __future__ import (absolute_import, division, print_function) 7 | __metaclass__ = type 8 | 9 | from datetime import datetime 10 | from logging.handlers import RotatingFileHandler 11 | 12 | 13 | class CustomRotatingFileHandler(RotatingFileHandler): 14 | def rotation_filename(self, default_name): 15 | """ 16 | Modify the filename of a log file when rotating. 17 | :param default_name: The default name of the log file. 18 | """ 19 | src_file_name = default_name.split('.') 20 | dest_file_name = "{0}_{1}.{2}.{3}".format( 21 | src_file_name[0], '{0:%Y%m%d}'.format(datetime.now()), 22 | src_file_name[1], src_file_name[2] 23 | ) 24 | return dest_file_name 25 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | PyPowerFlex 2 | -------------------------------------------------------------------------------- /requirements.yml: -------------------------------------------------------------------------------- 1 | --- 2 | collections: 3 | - name: dellemc.powerflex 4 | -------------------------------------------------------------------------------- /roles/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: centos 8 | image: quay.io/centos/centos:stream8 9 | pre_build_image: true 10 | volumes: 11 | - /tmp:/tmp 12 | provisioner: 13 | name: ansible 14 | inventory: 15 | links: 16 | hosts: ../../../../playbooks/roles/inventory 17 | group_vars: ../../../../playbooks/roles/group_vars/ 18 | host_vars: ../../../../playbooks/roles/host_vars/ 19 | verifier: 20 | name: ansible 21 | scenario: 22 | test_sequence: 23 | - check 24 | - converge 25 | - idempotence 26 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: activemq 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_activemq_mdm_ips }}" 6 | powerflex_activemq_state: 'present' 7 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/meta/argument_specs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage the installation and uninstallation of Powerflex ActiveMQ. 5 | description: 6 | - Role to manage the installation and uninstallation of Powerflex ActiveMQ. 7 | options: 8 | hostname: 9 | required: true 10 | type: str 11 | description: IP or FQDN of the PowerFlex host. 12 | username: 13 | required: true 14 | type: str 15 | description: The username of the PowerFlex host. 16 | password: 17 | required: true 18 | type: str 19 | description: The password of the PowerFlex host. 20 | port: 21 | type: int 22 | description: Port of the PowerFlex host. 23 | default: 443 24 | validate_certs: 25 | description: 26 | - If C(false), the SSL certificates will not be validated. 27 | - Configure C(false) only on personally controlled sites where self-signed certificates are used. 28 | type: bool 29 | default: false 30 | timeout: 31 | description: Time after which connection will get terminated. 32 | type: int 33 | default: 120 34 | powerflex_common_file_install_location: 35 | description: 36 | - Location of installation, compatible installation software package 37 | based on the operating system of the node. 38 | - The files can be downloaded from the Dell Product support page for PowerFlex software. 39 | type: path 40 | default: /var/tmp 41 | powerflex_activemq_state: 42 | description: 43 | - Specifies the state of the ActiveMQ. 44 | - present will install the ActiveMQ if not already installed. 45 | - absent will uninstall the ActiveMQ if installed. 46 | type: str 47 | choices: ['absent', 'present'] 48 | default: present 49 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Pavan Mudunuri 4 | description: Role to manage the installation and uninstallation of Powerflex ActiveMQ. 5 | company: Dell Technologies 6 | role_name: powerflex_activemq 7 | namespace: dellemc 8 | 9 | license: GPL-3.0-only 10 | 11 | min_ansible_version: "2.14.0" 12 | 13 | platforms: 14 | - name: EL 15 | versions: 16 | - "9" 17 | - "8" 18 | - name: Ubuntu 19 | versions: 20 | - jammy 21 | 22 | - name: SLES 23 | versions: 24 | - "15SP3" 25 | - "15SP4" 26 | 27 | galaxy_tags: [] 28 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/molecule/activemq_install/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of ActiveMQ 3 | hosts: activemq 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure Powerflex ActiveMQ 9 | ansible.builtin.import_role: 10 | name: powerflex_activemq 11 | vars: 12 | powerflex_activemq_state: present 13 | 14 | - name: Verifying install package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_common_install_package_output.msg == "Check mode: No changes made" 18 | when: ansible_check_mode 19 | 20 | - name: Verifying installation package in normal mode 21 | ansible.builtin.assert: 22 | that: 23 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 24 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 25 | 26 | - name: Verifying installation package in Idempotency mode 27 | ansible.builtin.assert: 28 | that: > 29 | "'Nothing to do' in powerflex_common_install_package_output.results[0]" or 30 | "'is already installed' in powerflex_common_install_package_output.results[0]" 31 | when: not ansible_check_mode and not powerflex_common_install_package_output.changed 32 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/molecule/activemq_install/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/molecule/activemq_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for uninstallation of ActiveMQ 3 | hosts: activemq 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Uninstall powerflex ActiveMQ 9 | ansible.builtin.import_role: 10 | name: powerflex_activemq 11 | vars: 12 | powerflex_activemq_state: absent 13 | 14 | - name: Verifying uninstall package in normal mode 15 | ansible.builtin.assert: 16 | that: 17 | - "'Removed:' in powerflex_activemq_uninstall_output.results[0].results[0]" 18 | when: 19 | - not ansible_check_mode 20 | - powerflex_activemq_uninstall_output.changed 21 | - ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") 22 | 23 | - name: Verifying uninstall package in check mode 24 | ansible.builtin.assert: 25 | that: 26 | - powerflex_activemq_uninstall_output.msg == "Check mode: No changes made" 27 | when: 28 | - ansible_check_mode 29 | - ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") 30 | 31 | - name: Verifying uninstall package in Idempotency 32 | ansible.builtin.assert: 33 | that: > 34 | "'Nothing to do' in powerflex_activemq_uninstall_output.results[0].msg" or 35 | "'EMC-ScaleIO-activemq is not installed' in powerflex_activemq_uninstall_output.results[0].results[0]" 36 | when: 37 | - not ansible_check_mode 38 | - not powerflex_activemq_uninstall_output.changed 39 | - ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") 40 | 41 | - name: Verifying uninstall package in check mode for ubuntu 42 | ansible.builtin.assert: 43 | that: 44 | - powerflex_activemq_uninstall_deb_output.results[0].msg == "Check mode: No changes made" 45 | - powerflex_activemq_uninstall_deb_output.changed 46 | when: 47 | - ansible_check_mode 48 | - ansible_distribution == "Ubuntu" 49 | 50 | - name: Verifying uninstall package in normal mode for ubuntu 51 | ansible.builtin.assert: 52 | that: 53 | - "'Removed:' in powerflex_activemq_uninstall_deb_output.results[0].results[0]" 54 | when: 55 | - not ansible_check_mode 56 | - powerflex_activemq_uninstall_deb_output.changed 57 | - ansible_distribution == "Ubuntu" 58 | 59 | - name: Verifying uninstall package in Idempotency for ubuntu 60 | ansible.builtin.assert: 61 | that: > 62 | "'Nothing to do' in powerflex_activemq_uninstall_deb_output.results[0].msg" or 63 | "'is not installed' in powerflex_activemq_uninstall_deb_output.results[0].results[0]" 64 | when: 65 | - not ansible_check_mode 66 | - not powerflex_activemq_uninstall_deb_output.changed 67 | - ansible_distribution == "Ubuntu" 68 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/molecule/activemq_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/tasks/install_activemq.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set facts for MDM counts 3 | ansible.builtin.set_fact: 4 | mdm_count: "{{ groups['mdm'] | length }}" 5 | 6 | - name: Set facts for powerflex_activemq_primary_ip 7 | ansible.builtin.set_fact: 8 | powerflex_activemq_primary_ip: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }}" 9 | 10 | - name: Set facts for powerflex_activemq_secondary_ip 11 | ansible.builtin.set_fact: 12 | powerflex_activemq_secondary_ip: "{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" 13 | 14 | - name: Set facts for powerflex_activemq_tertiary_ip 15 | ansible.builtin.set_fact: 16 | powerflex_activemq_tertiary_ip: "{{ hostvars[groups['mdm'][2]]['ansible_host'] }}" 17 | when: mdm_count | int > 2 18 | 19 | - name: Set facts for powerflex_activemq_mdm_ips if mdm_count is 2 20 | ansible.builtin.set_fact: 21 | powerflex_activemq_mdm_ips: "{{ powerflex_activemq_primary_ip }},{{ powerflex_activemq_secondary_ip }}" 22 | when: mdm_count | int == 2 23 | 24 | - name: Set facts for powerflex_activemq_mdm_ips if mdm_count is more than 2 25 | ansible.builtin.set_fact: 26 | powerflex_activemq_mdm_ips: "{{ powerflex_activemq_primary_ip }},{{ powerflex_activemq_secondary_ip }},{{ powerflex_activemq_tertiary_ip }}" 27 | when: mdm_count | int > 2 28 | 29 | - name: Include install_powerflex.yml 30 | ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml 31 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install ActiveMQ 3 | ansible.builtin.include_tasks: install_activemq.yml 4 | when: powerflex_activemq_state == 'present' 5 | 6 | - name: Uninstall ActiveMQ 7 | ansible.builtin.include_tasks: uninstall_activemq.yml 8 | when: powerflex_activemq_state == 'absent' 9 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/tasks/uninstall_activemq.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall package 3 | register: powerflex_activemq_uninstall_output 4 | environment: 5 | I_AM_SURE: "{{ i_am_sure | int }}" 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: "absent" 9 | with_items: 10 | - EMC-ScaleIO-activemq 11 | when: ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") 12 | 13 | - name: Uninstall deb package 14 | register: powerflex_activemq_uninstall_deb_output 15 | ansible.builtin.apt: 16 | name: "{{ item }}" 17 | state: absent 18 | with_items: 19 | - emc-scaleio-activemq 20 | when: ansible_distribution == "Ubuntu" 21 | -------------------------------------------------------------------------------- /roles/powerflex_activemq/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_common/README.md: -------------------------------------------------------------------------------- 1 | # powerflex_common 2 | 3 | Role to manage the common operations of Powerflex. 4 | -------------------------------------------------------------------------------- /roles/powerflex_common/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_file_install_location: "/var/tmp" 3 | powerflex_common_esxi_files_location: "/tmp/" 4 | powerflex_common_win_package_location: "C:\\Windows\\Temp" 5 | -------------------------------------------------------------------------------- /roles/powerflex_common/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Jennifer John 4 | description: The role helps to manage the common functions of PowerFlex. 5 | company: Dell Technologies 6 | role_name: powerflex_common 7 | namespace: dellemc 8 | # If the issue tracker for your role is not on github, uncomment the 9 | # next line and provide a value 10 | # issue_tracker_url: http://example.com/issue/tracker 11 | 12 | # Choose a valid license ID from https://spdx.org - some suggested licenses: 13 | # - BSD-3-Clause (default) 14 | # - MIT 15 | # - GPL-2.0-or-later 16 | # - GPL-3.0-only 17 | # - CC-BY-4.0 18 | license: GPL-3.0-only 19 | 20 | min_ansible_version: "2.14.0" 21 | platforms: 22 | - name: EL 23 | versions: 24 | - "9" 25 | - "8" 26 | - name: Ubuntu 27 | versions: 28 | - jammy 29 | - name: SLES 30 | versions: 31 | - "15SP3" 32 | - "15SP4" 33 | 34 | galaxy_tags: [] 35 | # List tags for your role here, one per line. A tag is a keyword that describes 36 | # and categorizes the role. Users find roles by searching for tags. Be sure to 37 | # remove the '[]' above, if you add tags to this list. 38 | # 39 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 40 | # Maximum 20 tags per role. 41 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_java_CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install pre-requisite java 3 | ansible.builtin.package: 4 | name: "java-1.8.0-openjdk-devel" 5 | state: "present" 6 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_java_RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install pre-requisite java 3 | ansible.builtin.package: 4 | name: "java-1.8.0-openjdk-devel" 5 | state: "present" 6 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_java_Rocky.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install pre-requisite java 3 | ansible.builtin.package: 4 | name: "java-1.8.0-openjdk-devel" 5 | state: "present" 6 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_java_SLES.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install pre-requisite java 3 | ansible.builtin.package: 4 | name: "java-11-openjdk-headless" 5 | state: "present" 6 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_java_Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install pre-requisite binutils 3 | ansible.builtin.package: 4 | name: "binutils" 5 | state: "present" 6 | 7 | - name: Install pre-requisite java 8 | ansible.builtin.package: 9 | name: "openjdk-8-jdk" 10 | state: "present" 11 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy files 3 | ansible.builtin.copy: 4 | src: "{{ item }}" 5 | dest: "/var/tmp/" 6 | mode: "0644" 7 | register: powerflex_common_file 8 | with_fileglob: 9 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" 10 | - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" 11 | 12 | - name: List the rpm file 13 | register: powerflex_common_package_file 14 | ansible.builtin.find: 15 | paths: "/var/tmp/" 16 | patterns: "*{{ file_glob_name }}*.rpm" 17 | 18 | - name: List the rpm gpg file 19 | register: powerflex_common_package_gpg 20 | ansible.builtin.find: 21 | paths: "/var/tmp/" 22 | patterns: "{{ file_gpg_name }}*" 23 | 24 | - name: Import gpg key 25 | ansible.builtin.rpm_key: 26 | state: present 27 | key: "{{ powerflex_common_package_gpg.files[0].path }}" 28 | when: powerflex_common_package_gpg.files | length > 0 29 | 30 | - name: Install package 31 | register: powerflex_common_install_package_output 32 | environment: "{{ powerflex_role_environment }}" 33 | ansible.builtin.package: 34 | name: "{{ powerflex_common_package_file.files[0].path }}" 35 | state: "present" 36 | disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" 37 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy files 3 | ansible.builtin.copy: 4 | src: "{{ item }}" 5 | dest: "/var/tmp/" 6 | mode: "0644" 7 | register: powerflex_common_file 8 | with_fileglob: 9 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.rpm" 10 | - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" 11 | 12 | - name: List the rpm file 13 | register: powerflex_common_package_file 14 | ansible.builtin.find: 15 | paths: "/var/tmp/" 16 | patterns: "*{{ file_glob_name }}*.rpm" 17 | 18 | - name: List the rpm gpg file 19 | register: powerflex_common_package_gpg 20 | ansible.builtin.find: 21 | paths: "/var/tmp/" 22 | patterns: "{{ file_gpg_name }}*" 23 | 24 | - name: Import gpg key 25 | ansible.builtin.rpm_key: 26 | state: present 27 | key: "{{ powerflex_common_package_gpg.files[0].path }}" 28 | when: powerflex_common_package_gpg.files | length > 0 29 | 30 | - name: Install package 31 | register: powerflex_common_install_package_output 32 | environment: "{{ powerflex_role_environment }}" 33 | ansible.builtin.package: 34 | name: "{{ powerflex_common_package_file.files[0].path }}" 35 | state: "present" 36 | disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" 37 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_Rocky.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy files 3 | ansible.builtin.copy: 4 | src: "{{ item }}" 5 | dest: "/var/tmp/" 6 | mode: "0644" 7 | register: powerflex_common_file 8 | with_fileglob: 9 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" 10 | - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" 11 | 12 | - name: List the rpm file 13 | register: powerflex_common_package_file 14 | ansible.builtin.find: 15 | paths: "/var/tmp/" 16 | patterns: "*{{ file_glob_name }}*.rpm" 17 | 18 | - name: List the rpm gpg file 19 | register: powerflex_common_package_gpg 20 | ansible.builtin.find: 21 | paths: "/var/tmp/" 22 | patterns: "{{ file_gpg_name }}*" 23 | 24 | - name: Import gpg key 25 | ansible.builtin.rpm_key: 26 | state: present 27 | key: "{{ powerflex_common_package_gpg.files[0].path }}" 28 | when: powerflex_common_package_gpg.files | length > 0 29 | 30 | - name: Install package 31 | register: powerflex_common_install_package_output 32 | environment: "{{ powerflex_role_environment }}" 33 | ansible.builtin.package: 34 | name: "{{ powerflex_common_package_file.files[0].path }}" 35 | state: "present" 36 | disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" 37 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_SLES.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy files 3 | ansible.builtin.copy: 4 | src: "{{ item }}" 5 | dest: "/var/tmp/" 6 | mode: "0644" 7 | register: powerflex_common_file 8 | with_fileglob: 9 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.rpm" 10 | - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" 11 | 12 | - name: List the rpm file 13 | register: powerflex_common_package_file 14 | ansible.builtin.find: 15 | paths: "/var/tmp/" 16 | patterns: "*{{ file_glob_name }}*.rpm" 17 | 18 | - name: List the rpm gpg file 19 | register: powerflex_common_package_gpg 20 | ansible.builtin.find: 21 | paths: "/var/tmp/" 22 | patterns: "{{ file_gpg_name }}*" 23 | 24 | - name: Import gpg key 25 | ansible.builtin.rpm_key: 26 | state: present 27 | key: "{{ powerflex_common_package_gpg.files[0].path }}" 28 | when: powerflex_common_package_gpg.files | length > 0 29 | 30 | - name: Install package 31 | register: powerflex_common_install_package_output 32 | environment: "{{ powerflex_role_environment }}" 33 | ansible.builtin.package: 34 | name: "{{ powerflex_common_package_file.files[0].path }}" 35 | state: "present" 36 | disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" 37 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy files 3 | ansible.builtin.unarchive: 4 | src: "{{ item }}" 5 | dest: "/var/tmp/" 6 | mode: "0644" 7 | register: powerflex_common_ubuntu_tar_file 8 | with_fileglob: 9 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.tar" 10 | 11 | - name: Get powerflex_common_siob_file # noqa: no-handler 12 | ansible.builtin.find: 13 | paths: "/var/tmp/" 14 | patterns: "*{{ file_glob_name }}*.siob" 15 | register: powerflex_common_siob_file 16 | when: powerflex_common_ubuntu_tar_file.changed 17 | 18 | - name: Execute chmod siob_extract # noqa: no-handler 19 | ansible.builtin.file: 20 | path: "/var/tmp/siob_extract" 21 | mode: "0755" 22 | when: powerflex_common_ubuntu_tar_file.changed 23 | 24 | - name: Execute the siob_extract # noqa: no-handler 25 | ansible.builtin.command: 26 | cmd: /var/tmp/siob_extract "{{ powerflex_common_siob_file.files[0].path }}" 27 | chdir: /var/tmp 28 | when: powerflex_common_ubuntu_tar_file.changed 29 | register: powerflex_common_siob_extract_output 30 | changed_when: powerflex_common_siob_extract_output.rc == 0 31 | 32 | - name: Copy deb file 33 | ansible.builtin.copy: 34 | src: "{{ item }}" 35 | dest: "/var/tmp" 36 | mode: "0644" 37 | with_fileglob: 38 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.deb" 39 | when: powerflex_common_ubuntu_tar_file.skipped 40 | 41 | - name: List the deb file 42 | register: powerflex_common_package_file 43 | ansible.builtin.find: 44 | paths: "/var/tmp/" 45 | patterns: "*{{ file_glob_name }}*.deb" 46 | 47 | - name: Install package 48 | register: powerflex_common_install_package_output 49 | environment: "{{ powerflex_role_environment }}" 50 | ansible.builtin.package: 51 | deb: "{{ powerflex_common_package_file.files[0].path }}" 52 | state: "present" 53 | disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" 54 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_VMkernel.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get the acceptance level of the ESXi node 3 | register: powerflex_common_get_acceptance_output 4 | ansible.builtin.shell: > 5 | esxcli software acceptance get 6 | changed_when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' 7 | 8 | - name: Set the acceptance level to PartnerSupported 9 | register: powerflex_common_set_acceptance_output 10 | ansible.builtin.shell: > 11 | esxcli software acceptance set --level=PartnerSupported 12 | when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' 13 | changed_when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' 14 | 15 | - name: Copy Esxi component and rpm files 16 | ansible.builtin.copy: 17 | src: "{{ item }}" 18 | dest: "{{ powerflex_common_esxi_files_location }}" 19 | mode: "0644" 20 | register: powerflex_common_file 21 | with_fileglob: 22 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" 23 | - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" 24 | 25 | - name: List the zip file 26 | register: powerflex_common_package_file 27 | ansible.builtin.find: 28 | paths: "{{ powerflex_common_esxi_files_location }}" 29 | patterns: "*{{ file_glob_name }}*.zip" 30 | 31 | - name: Install SDC package for ESXi 32 | register: powerflex_common_install_package_output 33 | ansible.builtin.shell: > 34 | esxcli software vib install -d {{ powerflex_common_package_file.files[0].path }} --no-sig-check 35 | ignore_errors: true 36 | changed_when: "'Reboot Required: true' in powerflex_common_install_package_output.stdout" 37 | 38 | - name: Reboot ESXi host 39 | register: powerflex_common_reboot_output 40 | ansible.builtin.reboot: 41 | reboot_timeout: 500 42 | msg: "Rebooting the ESXi host." 43 | when: "'Reboot Required: true' in powerflex_common_install_package_output.stdout" 44 | changed_when: powerflex_common_reboot_output.rebooted 45 | 46 | - name: Ensure the driver is loaded for SDC after reboot 47 | register: powerflex_common_loaded_driver_output 48 | ansible.builtin.shell: > 49 | set -o pipefail && esxcli software vib list | grep sdc 50 | changed_when: powerflex_common_loaded_driver_output.stdout_lines | length == 0 51 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_packages_WindowsOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Copy files 3 | ansible.windows.win_copy: 4 | src: "{{ item }}" 5 | dest: "{{ powerflex_common_win_package_location }}" 6 | register: powerflex_common_file 7 | with_fileglob: 8 | - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.msi" 9 | 10 | - name: List the msi file 11 | ansible.windows.win_find: 12 | paths: "{{ powerflex_common_win_package_location }}" 13 | patterns: "*{{ file_glob_name }}*.msi" 14 | register: powerflex_common_package_file 15 | 16 | - name: Install package 17 | register: powerflex_common_install_package_output 18 | ansible.windows.win_command: > 19 | msiexec.exe /i "{{ powerflex_common_package_file.files[0].path }}" MDM_IP="{{ powerflex_role_environment.MDM_IP }}" /q 20 | ignore_errors: true 21 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/install_powerflex.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set fact # noqa var-naming[no-role-prefix] 3 | ansible.builtin.set_fact: 4 | ansible_distribution: "WindowsOS" 5 | when: " 'Windows' in ansible_distribution" 6 | 7 | - name: Include installation file based on distribution 8 | ansible.builtin.include_tasks: "install_packages_{{ ansible_distribution }}.yml" 9 | -------------------------------------------------------------------------------- /roles/powerflex_common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set fact # noqa var-naming[no-role-prefix] 3 | ansible.builtin.set_fact: 4 | ansible_distribution: "WindowsOS" 5 | when: " 'Windows' in ansible_distribution" 6 | 7 | - name: Include vars 8 | ansible.builtin.include_vars: "../vars/{{ ansible_distribution }}.yml" 9 | 10 | - name: Install required packages # noqa package-latest 11 | ansible.builtin.package: 12 | name: "{{ item }}" 13 | state: latest 14 | with_items: "{{ powerflex_common_packages }}" 15 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: 3 | - numactl 4 | - libaio 5 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: 3 | - numactl 4 | - libaio 5 | - python3 6 | - binutils 7 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/Rocky.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: 3 | - numactl 4 | - libaio 5 | - python3 6 | - binutils 7 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/SLES.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: 3 | - python3 4 | - libapr1 5 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: 3 | - numactl 4 | - libaio1 5 | - ldap-utils 6 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/VMkernel.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: [] 3 | -------------------------------------------------------------------------------- /roles/powerflex_common/vars/WindowsOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_packages: [] 3 | -------------------------------------------------------------------------------- /roles/powerflex_config/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for powerflex_config 3 | powerflex_protection_domain_name: "domain1" 4 | powerflex_fault_sets: ['fs1', 'fs2', 'fs3'] 5 | powerflex_media_type: 'SSD' # When version is R3 6 | powerflex_storage_pool_name: "pool1" 7 | -------------------------------------------------------------------------------- /roles/powerflex_config/meta/argument_specs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to configure the protection domain, fault set and storage pool. 5 | description: 6 | - Role to configure the protection domain, fault set and storage pool. 7 | options: 8 | hostname: 9 | required: true 10 | type: str 11 | description: IP or FQDN of the PowerFlex gateway. 12 | username: 13 | required: true 14 | type: str 15 | description: The username of the PowerFlex gateway. 16 | password: 17 | required: true 18 | type: str 19 | description: The password of the PowerFlex gateway. 20 | port: 21 | type: int 22 | description: Port of the PowerFlex gateway. 23 | default: 443 24 | validate_certs: 25 | description: 26 | - If C(false), the SSL certificates will not be validated. 27 | - Configure C(false) only on personally controlled sites where self-signed certificates are used. 28 | type: bool 29 | default: false 30 | timeout: 31 | description: Timeout. 32 | type: int 33 | default: 120 34 | powerflex_protection_domain_name: 35 | type: str 36 | description: Name of the protection domain. 37 | default: 'config_protection_domain' 38 | powerflex_fault_sets: 39 | description: List of fault sets. 40 | type: list 41 | default: ['fs1', 'fs2', 'fs3'] 42 | powerflex_media_type: 43 | description: Media type of the storage pool. 44 | type: str 45 | choices: ['SSD', 'HDD', 'TRANSITIONAL'] 46 | default: 'SSD' 47 | powerflex_storage_pool_name: 48 | description: Name of the storage pool. 49 | type: str 50 | default: 'config_storage_pool' 51 | -------------------------------------------------------------------------------- /roles/powerflex_config/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Felix Stephen A 4 | description: Role to configure the protection domain, fault set and storage pool. 5 | company: Dell Technologies 6 | license: GPL-3.0-only 7 | role_name: powerflex_config 8 | namespace: dellemc 9 | 10 | min_ansible_version: "2.14.0" 11 | platforms: 12 | - name: EL 13 | versions: 14 | - "9" 15 | - "8" 16 | - name: Ubuntu 17 | versions: 18 | - jammy 19 | 20 | - name: SLES 21 | versions: 22 | - "15SP3" 23 | - "15SP4" 24 | 25 | galaxy_tags: [] 26 | -------------------------------------------------------------------------------- /roles/powerflex_config/molecule/configure_protection_domain/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for Configuring Protection Domain 3 | hosts: mdm 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Run Config role 9 | ansible.builtin.import_role: 10 | name: "powerflex_config" 11 | register: powerflex_config_result 12 | 13 | - name: "Verifying protection domain creation" 14 | ansible.builtin.assert: 15 | that: 16 | - powerflex_config_add_pd_output.protection_domain_details.name == powerflex_protection_domain_name 17 | when: not ansible_check_mode and powerflex_config_add_pd_output.changed 18 | 19 | - name: "Verifying storage pool R2 creation" 20 | ansible.builtin.assert: 21 | that: 22 | - powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name 23 | when: not ansible_check_mode and powerflex_config_storage_pool_output.changed 24 | 25 | - name: "Verifying storage pool R3 creation" 26 | ansible.builtin.assert: 27 | that: 28 | - powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name 29 | when: not ansible_check_mode and powerflex_config_storage_pool_output.changed and powerflex_media_type is not none 30 | 31 | - name: "Verifying protection domain creation in Idempotency" 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_config_add_pd_output.protection_domain_details.name == powerflex_protection_domain_name 35 | when: not ansible_check_mode and powerflex_config_add_pd_output.changed 36 | 37 | - name: "Verifying storage pool R2 creation in Idempotency" 38 | ansible.builtin.assert: 39 | that: 40 | powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name 41 | when: not ansible_check_mode and powerflex_config_storage_pool_output.changed 42 | 43 | - name: "Verifying storage pool R3 creation in Idempotency" 44 | ansible.builtin.assert: 45 | that: 46 | - powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name 47 | when: not ansible_check_mode and powerflex_config_storage_pool_output.changed and powerflex_media_type is not none 48 | -------------------------------------------------------------------------------- /roles/powerflex_config/molecule/configure_protection_domain/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_config/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for powerflex_config 3 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Is the gateway redundant (will install keepalived) 3 | powerflex_gateway_is_redundant: false 4 | # Virtual IP if redundant 5 | powerflex_gateway_virtual_ip: '' 6 | # Interface to attach the virtual ip 7 | powerflex_gateway_virtual_interface: eth1 8 | # Skip Java installation for PowerFlex (assume it's on the system) 9 | powerflex_gateway_skip_java: false 10 | # Disable GPG check to install PowerFlex gateway 11 | powerflex_gateway_disable_gpg_check: true 12 | powerflex_gateway_user_properties_file: /opt/emc/scaleio/gateway/webapps/ROOT/WEB-INF/classes/gatewayUser.properties 13 | powerflex_gateway_catalina_properties_file: /opt/emc/scaleio/gateway/conf/catalina.properties 14 | file_glob_name: gateway 15 | powerflex_role_environment: 16 | MDM_IP: "{{ powerflex_mdm_ips }}" 17 | GATEWAY_ADMIN_PASSWORD: "{{ powerflex_gateway_admin_password }}" 18 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restart keepalived 3 | ansible.builtin.service: 4 | name: "keepalived" 5 | state: "restarted" 6 | enabled: true 7 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/meta/argument_specs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage the installation and uninstallation of 5 | PowerFlex gateway 6 | description: 7 | - Role to manage the installation and uninstallation of PowerFlex gateway. 8 | options: 9 | powerflex_common_file_install_location: 10 | type: path 11 | description: 12 | - Location of installation, compatible installation software package 13 | based on the operating system of the node. 14 | - The files can be downloaded from the Dell Product support page for 15 | the PowerFlex software. 16 | default: '/var/tmp' 17 | powerflex_gateway_is_redundant: 18 | type: bool 19 | description: Is the gateway redundant (will install keepalived) 20 | default: false 21 | powerflex_gateway_admin_password: 22 | required: true 23 | type: str 24 | description: Admin password for the PowerFlex gateway. 25 | powerflex_gateway_http_port: 26 | type: int 27 | description: PowerFlex gateway HTTP port. 28 | default: 80 29 | powerflex_gateway_https_port: 30 | type: int 31 | description: PowerFlex gateway HTTPS port. 32 | default: 443 33 | powerflex_gateway_virtual_ip: 34 | type: str 35 | description: Virtual IP address of PowerFlex gateway. 36 | powerflex_gateway_virtual_interface: 37 | type: str 38 | description: Virtual interface of PowerFlex gateway. 39 | powerflex_gateway_state: 40 | type: str 41 | description: State of the PowerFlex gateway. 42 | choices: ['present', 'absent'] 43 | default: 'present' 44 | powerflex_gateway_skip_java: 45 | type: bool 46 | description: Specifies whether to install java or not. 47 | default: false 48 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | role_name: powerflex_gateway 4 | namespace: dellemc 5 | author: Bhavneet Sharma 6 | description: Role to manage the installation and uninstallation of Powerflex gateway 7 | company: Dell Technologies 8 | license: GPL-3.0-only 9 | min_ansible_version: "2.14.0" 10 | platforms: 11 | - name: EL 12 | versions: 13 | - "9" 14 | - "8" 15 | 16 | - name: Ubuntu 17 | versions: 18 | - jammy 19 | 20 | - name: SLES 21 | versions: 22 | - "15SP3" 23 | - "15SP4" 24 | 25 | galaxy_tags: [] 26 | 27 | dependencies: 28 | - role: powerflex_common 29 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/molecule/gateway_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install gateway 3 | hosts: gateway 4 | gather_facts: true 5 | tasks: 6 | - name: Install and configure powerflex gateway 7 | ansible.builtin.import_role: 8 | name: "powerflex_gateway" 9 | vars: 10 | powerflex_gateway_state: present 11 | register: powerflex_gateway_result_molecule 12 | 13 | - name: Verifying installation package in check mode 14 | ansible.builtin.assert: 15 | that: 16 | - " 'No changes made, but would have if not in check mode' in powerflex_common_install_package_output.msg" 17 | when: ansible_check_mode 18 | 19 | - name: Verifying installation package 20 | ansible.builtin.assert: 21 | that: 22 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 23 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 24 | 25 | - name: Verifying installation package in idempotency 26 | ansible.builtin.assert: 27 | that: 28 | - " 'Nothing to do' in powerflex_common_install_package_output.msg" 29 | when: not ansible_check_mode and not powerflex_common_install_package_output.changed 30 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/molecule/gateway_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/molecule/gateway_installation_invalid_path_rpm/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install gateway with invalid rpm path 3 | hosts: gateway 4 | gather_facts: true 5 | tasks: 6 | - name: Install and configure powerflex gateway with no rpm 7 | ansible.builtin.import_role: 8 | name: "powerflex_gateway" 9 | vars: 10 | powerflex_common_file_install_location: "/opt/empty" 11 | powerflex_gateway_state: present 12 | ignore_errors: true 13 | register: powerflex_gateway_install_config_no_rpm_result 14 | 15 | - name: Verifying failure of install package with respect to no rpm file 16 | ansible.builtin.assert: 17 | that: 18 | - powerflex_common_package_file.files | length == 0 19 | 20 | - name: Install and configure powerflex gateway with wrong file path 21 | ansible.builtin.import_role: 22 | name: "powerflex_gateway" 23 | vars: 24 | powerflex_common_file_install_location: "/opt/aaab" 25 | powerflex_gateway_state: present 26 | ignore_errors: true 27 | register: powerflex_gateway_install_config_wrong_path_result 28 | 29 | - name: Verifying failure of install package with wrong file path 30 | ansible.builtin.assert: 31 | that: 32 | - powerflex_common_package_file.files | length == 0 33 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/molecule/gateway_installation_invalid_path_rpm/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/molecule/gateway_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall gateway 3 | hosts: gateway 4 | gather_facts: true 5 | tasks: 6 | - name: Uninstall powerflex gateway 7 | ansible.builtin.import_role: 8 | name: "powerflex_gateway" 9 | vars: 10 | powerflex_gateway_state: 'absent' 11 | 12 | - name: Verifying uninstall package in check mode 13 | ansible.builtin.assert: 14 | that: 15 | - powerflex_gateway_uninstall_output.msg == "Check mode: No changes made, but would have if not in check mode" 16 | - powerflex_gateway_uninstall_output.changed is true 17 | when: ansible_check_mode and ansible_distribution in ("RedHat", "CentOS", "SLES") 18 | 19 | - name: Verifying uninstall package in converge 20 | ansible.builtin.assert: 21 | that: 22 | - " 'Removed:' in powerflex_gateway_uninstall_output.results[0].results[0]" 23 | when: not ansible_check_mode and powerflex_gateway_uninstall_output.changed and ansible_distribution in ("RedHat", "CentOS", "SLES") 24 | 25 | - name: Verifying uninstall package in Idempotency 26 | ansible.builtin.assert: 27 | that: 28 | - powerflex_gateway_uninstall_output.results[0].msg == 'Nothing to do' 29 | when: not ansible_check_mode and not powerflex_gateway_uninstall_output.changed and ansible_distribution in ("RedHat", "CentOS", "SLES") 30 | 31 | - name: Verifying uninstall package in check mode 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_gateway_uninstall_deb_output.msg == "Check mode: No changes made, but would have if not in check mode" 35 | - powerflex_gateway_uninstall_deb_output.changed is true 36 | when: ansible_check_mode and ansible_distribution == "Ubuntu" 37 | 38 | - name: Verifying uninstall package in converge 39 | ansible.builtin.assert: 40 | that: 41 | - " 'Removed:' in powerflex_gateway_uninstall_deb_output.results[0].results[0]" 42 | when: not ansible_check_mode and powerflex_gateway_uninstall_deb_output.changed and ansible_distribution == "Ubuntu" 43 | 44 | - name: Verifying uninstall package in Idempotency 45 | ansible.builtin.assert: 46 | that: 47 | - powerflex_gateway_uninstall_deb_output.results[0].msg == 'Nothing to do' 48 | when: not ansible_check_mode and not powerflex_gateway_uninstall_deb_output.changed and ansible_distribution == "Ubuntu" 49 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/molecule/gateway_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/tasks/install_gateway.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set Fact the powerflex_mdm_ips 3 | ansible.builtin.set_fact: 4 | powerflex_mdm_ips: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }},{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" 5 | 6 | - name: Install java 7 | ansible.builtin.include_tasks: "../../powerflex_common/tasks/install_java_{{ ansible_distribution }}.yml" 8 | when: not powerflex_gateway_skip_java 9 | 10 | - name: Set gateway admin password 11 | ansible.builtin.set_fact: 12 | token: "{{ powerflex_gateway_admin_password }}" 13 | 14 | - name: Include install_powerflex.yml 15 | ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml 16 | 17 | - name: Include install_keepalived.yml 18 | ansible.builtin.include_tasks: install_keepalived.yml 19 | when: powerflex_gateway_is_redundant == "true" 20 | 21 | - name: Configure gateway with MDM addresses 22 | ansible.builtin.lineinfile: 23 | name: "{{ powerflex_gateway_user_properties_file }}" 24 | regexp: '^mdm.ip.addresses' 25 | line: "mdm.ip.addresses={{ powerflex_mdm_ips }}" 26 | ignore_errors: "{{ ansible_check_mode }}" 27 | 28 | - name: Configure gateway to accept certificates 29 | ansible.builtin.lineinfile: 30 | name: "{{ powerflex_gateway_user_properties_file }}" 31 | regexp: '^security.bypass_certificate_check' 32 | line: "security.bypass_certificate_check=true" 33 | ignore_errors: "{{ ansible_check_mode }}" 34 | 35 | - name: Configure gateway http port 36 | ansible.builtin.lineinfile: 37 | name: "{{ powerflex_gateway_catalina_properties_file }}" 38 | regexp: '^http.port' 39 | line: "http.port={{ powerflex_gateway_http_port }}" 40 | ignore_errors: "{{ ansible_check_mode }}" 41 | 42 | - name: Configure gateway https port 43 | ansible.builtin.lineinfile: 44 | name: "{{ powerflex_gateway_catalina_properties_file }}" 45 | regexp: '^ssl.port' 46 | line: "ssl.port={{ powerflex_gateway_https_port }}" 47 | ignore_errors: "{{ ansible_check_mode }}" 48 | 49 | - name: Restart service PowerFlex Gateway 50 | ansible.builtin.service: 51 | name: scaleio-gateway.service 52 | state: restarted 53 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/tasks/install_keepalived.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include vars 3 | ansible.builtin.include_vars: "../vars/{{ ansible_distribution }}.yml" 4 | 5 | - name: Install required packages 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: present 9 | with_items: "{{ keepalived_packages }}" 10 | 11 | - name: Set the priority of keepalived 12 | ansible.builtin.set_fact: 13 | keepalived_priority: 100 14 | run_once: true 15 | 16 | - name: Set the priority of keepalived if not defined 17 | ansible.builtin.set_fact: 18 | keepalived_priority: 101 19 | when: keepalived_priority is not defined 20 | 21 | - name: Configure keepalived 22 | ansible.builtin.template: 23 | src: keepalived.conf.j2 24 | dest: "{{ keepalived_config_file_location }}/keepalived.conf" 25 | mode: '0600' 26 | owner: root 27 | group: root 28 | notify: Restart keepalived 29 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Powerflex gateway 3 | ansible.builtin.include_tasks: install_gateway.yml 4 | when: powerflex_gateway_state == "present" 5 | 6 | - name: Uninstall Powerflex gateway 7 | ansible.builtin.include_tasks: uninstall_gateway.yml 8 | when: powerflex_gateway_state == "absent" 9 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/tasks/uninstall_gateway.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall package 3 | register: powerflex_gateway_uninstall_output 4 | environment: 5 | I_AM_SURE: "{{ i_am_sure | int }}" 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: "absent" 9 | with_items: 10 | - EMC-ScaleIO-gateway 11 | when: ansible_distribution in ("RedHat", "CentOS", "SLES") 12 | 13 | - name: Uninstall deb package 14 | register: powerflex_gateway_uninstall_deb_output 15 | ansible.builtin.apt: 16 | name: "{{ item }}" 17 | state: absent 18 | with_items: 19 | - emc-scaleio-gateway 20 | when: ansible_distribution == "Ubuntu" 21 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/templates/keepalived.conf.j2: -------------------------------------------------------------------------------- 1 | vrrp_script chk_gateway { # Requires keepalived-1.1.13 2 | script "killall -0 scaleio-gateway-wd.bash" # cheaper than pidof 3 | interval 2 # check every 2 seconds 4 | weight 2 # add 2 points of prio if OK 5 | } 6 | 7 | vrrp_instance gateway_vi_1 { 8 | interface {{ powerflex_gateway_virtual_interface }} 9 | state MASTER 10 | virtual_router_id 51 11 | priority {{ keepalived_priority }} # 101 on master, 100 on backup 12 | virtual_ipaddress { 13 | {{ powerflex_gateway_virtual_ip }} 14 | } 15 | track_script { 16 | chk_gateway 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/vars/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | keepalived_packages: 3 | - keepalived 4 | keepalived_config_file_location: /etc/keepalived 5 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/vars/RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | keepalived_packages: 3 | - keepalived 4 | keepalived_config_file_location: /etc/keepalived 5 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/vars/SLES.yml: -------------------------------------------------------------------------------- 1 | --- 2 | keepalived_packages: 3 | - keepalived 4 | keepalived_config_file_location: /etc/keepalived 5 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/vars/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | keepalived_packages: 3 | - keepalived 4 | keepalived_config_file_location: /etc/keepalived 5 | -------------------------------------------------------------------------------- /roles/powerflex_gateway/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: gateway 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_mdm_ips }}" 6 | GATEWAY_ADMIN_PASSWORD: "{{ powerflex_gateway_admin_password }}" 7 | -------------------------------------------------------------------------------- /roles/powerflex_lia/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: lia 3 | powerflex_role_environment: 4 | MDM_IP: "{{ powerflex_lia_mdm_ips }}" 5 | TOKEN: "{{ powerflex_lia_token }}" 6 | -------------------------------------------------------------------------------- /roles/powerflex_lia/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Pavan Mudunuri 4 | description: Role to manage the installation and uninstallation of Powerflex LIA. 5 | company: Dell Technologies 6 | role_name: powerflex_lia 7 | namespace: dellemc 8 | 9 | license: GPL-3.0-only 10 | 11 | min_ansible_version: "2.14.0" 12 | 13 | platforms: 14 | - name: EL 15 | versions: 16 | - "9" 17 | - "8" 18 | - name: Ubuntu 19 | versions: 20 | - jammy 21 | 22 | - name: SLES 23 | versions: 24 | - "15SP3" 25 | - "15SP4" 26 | 27 | galaxy_tags: [] 28 | -------------------------------------------------------------------------------- /roles/powerflex_lia/molecule/lia_install/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of LIA 3 | hosts: lia 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure Powerflex LIA 9 | ansible.builtin.import_role: 10 | name: powerflex_lia 11 | vars: 12 | powerflex_lia_state: present 13 | 14 | - name: Verifying install package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_common_install_package_output.msg == "Check mode: No changes made" 18 | when: ansible_check_mode 19 | 20 | - name: Verifying installation package in normal mode 21 | ansible.builtin.assert: 22 | that: 23 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 24 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 25 | 26 | - name: Verifying installation package in Idempotency mode 27 | ansible.builtin.assert: 28 | that: 29 | - "'Nothing to do' in powerflex_common_install_package_output.msg" 30 | when: not ansible_check_mode and not powerflex_common_install_package_output.changed 31 | -------------------------------------------------------------------------------- /roles/powerflex_lia/molecule/lia_install/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_lia/molecule/lia_installation_invalid_path_rpm/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of LIA with invalid rpm path, rpm file 3 | hosts: lia 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure powerflex LIA with no rpm 9 | ansible.builtin.import_role: 10 | name: powerflex_lia 11 | vars: 12 | powerflex_common_file_install_location: "/opt/empty" 13 | powerflex_lia_state: present 14 | register: powerflex_lia_no_rpm_result 15 | ignore_errors: true 16 | 17 | - name: Verifying failure of install package with respect to no rpm file in normal mode 18 | ansible.builtin.assert: 19 | that: 20 | - powerflex_common_package_file.files | length | int == 0 21 | 22 | - name: Install and configure powerflex lia with wrong file path 23 | ansible.builtin.import_role: 24 | name: powerflex_lia 25 | vars: 26 | powerflex_common_file_install_location: "/opt/aaab" 27 | powerflex_lia_state: present 28 | register: powerflex_lia_wrong_file_path_result 29 | ignore_errors: true 30 | 31 | - name: Verifying failure of install package with wrong file path in normal mode 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_common_package_file.files | length | int == 0 35 | -------------------------------------------------------------------------------- /roles/powerflex_lia/molecule/lia_installation_invalid_path_rpm/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_lia/molecule/lia_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for uninstallation of LIA 3 | hosts: lia 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Uninstall powerflex lia 9 | ansible.builtin.import_role: 10 | name: powerflex_lia 11 | vars: 12 | powerflex_lia_state: 'absent' 13 | 14 | - name: Verifying uninstall package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_lia_uninstall_output.msg == "Check mode: No changes made 18 | when: ansible_check_mode 19 | 20 | - name: Verifying uninstall package in normal mode 21 | ansible.builtin.assert: 22 | that: 23 | - "'Removed: EMC-ScaleIO-lia' in powerflex_lia_uninstall_output.results[0].results[0]" 24 | when: not ansible_check_mode and powerflex_lia_uninstall_output.changed 25 | 26 | - name: Verifying uninstall package in Idempotency 27 | ansible.builtin.assert: 28 | that: 29 | - "'Nothing to do' in powerflex_lia_uninstall_output.results[0].msg" 30 | when: not ansible_check_mode and not powerflex_lia_uninstall_output.changed 31 | -------------------------------------------------------------------------------- /roles/powerflex_lia/molecule/lia_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_lia/tasks/install_lia.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set facts for MDM counts 3 | ansible.builtin.set_fact: 4 | mdm_count: "{{ groups['mdm'] | length }}" 5 | 6 | - name: Set facts for powerflex_lia_tertiary_ip 7 | ansible.builtin.set_fact: 8 | powerflex_lia_tertiary_ip: "{{ hostvars[groups['mdm'][2]]['ansible_host'] }}" 9 | when: mdm_count | int > 2 10 | 11 | - name: Set facts for powerflex_lia_mdm_ips if mdm_count is 2 12 | ansible.builtin.set_fact: 13 | powerflex_lia_mdm_ips: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }},{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" 14 | when: mdm_count | int == 2 15 | 16 | - name: Set facts for powerflex_lia_mdm_ips if mdm_count is more than 2 17 | ansible.builtin.set_fact: 18 | powerflex_lia_mdm_ips: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }},{{ hostvars[groups['mdm'][1]]['ansible_host'] }},{{ powerflex_lia_tertiary_ip }}" 19 | when: mdm_count | int > 2 20 | 21 | - name: Include install_powerflex.yml 22 | ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml 23 | 24 | - name: Check if /opt/emc/scaleio/lia/cfg/conf.txt exists 25 | ansible.builtin.stat: 26 | path: /opt/emc/scaleio/lia/cfg/conf.txt 27 | register: powerflex_lia_conf_file_stat 28 | 29 | - name: Update lia_mtls_only 30 | ansible.builtin.lineinfile: 31 | path: /opt/emc/scaleio/lia/cfg/conf.txt 32 | regexp: '^lia_mtls_only=1$' 33 | state: absent 34 | when: powerflex_lia_conf_file_stat.stat.exists 35 | 36 | - name: Replace lia_token value 37 | ansible.builtin.replace: 38 | path: /opt/emc/scaleio/lia/cfg/conf.txt 39 | regexp: '^lia_token=.*$' 40 | replace: 'lia_token={{ powerflex_lia_token }}' 41 | when: powerflex_lia_conf_file_stat.stat.exists 42 | 43 | - name: PKill LIA for config changes effect 44 | ansible.builtin.command: pkill lia 45 | register: powerflex_lia_pkill_ouput 46 | changed_when: powerflex_lia_pkill_ouput.rc == 0 47 | -------------------------------------------------------------------------------- /roles/powerflex_lia/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install LIA 3 | ansible.builtin.include_tasks: install_lia.yml 4 | when: powerflex_lia_state == 'present' 5 | 6 | - name: Uninstall LIA 7 | ansible.builtin.include_tasks: uninstall_lia.yml 8 | when: powerflex_lia_state == 'absent' 9 | -------------------------------------------------------------------------------- /roles/powerflex_lia/tasks/uninstall_lia.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall package 3 | register: powerflex_lia_uninstall_output 4 | environment: 5 | I_AM_SURE: "{{ i_am_sure | int }}" 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: "absent" 9 | with_items: 10 | - EMC-ScaleIO-lia 11 | when: ansible_distribution in ("RedHat", "CentOS", "SLES") 12 | 13 | - name: Uninstall deb package 14 | ansible.builtin.apt: 15 | name: "{{ item }}" 16 | state: absent 17 | with_items: 18 | - emc-scaleio-lia 19 | when: ansible_distribution == "Ubuntu" 20 | -------------------------------------------------------------------------------- /roles/powerflex_lia/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: lia 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_lia_mdm_ips }}" 6 | TOKEN: "{{ powerflex_lia_token }}" 7 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Skip Java installation for powerflex (assume it's on the system) 3 | powerflex_skip_java: false 4 | powerflex_mdm_primary_hostname: '' 5 | powerflex_mdm_primary_ip: '' 6 | powerflex_role_environment: 7 | MDM_IP: "{{ powerflex_mdm_ips }}" 8 | MDM_ROLE_IS_MANAGER: 1 9 | file_glob_name: mdm 10 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/meta/argument_spec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | version_added: "1.8.0" 5 | short_description: Role to manage the installation and uninstallation of Powerflex MDM 6 | description: 7 | - Role to manage the installation and uninstallation of Powerflex MDM. 8 | options: 9 | powerflex_mdm_state: 10 | required: true 11 | type: str 12 | description: State of the Powerflex MDM. 13 | powerflex_mdm_password: 14 | required: true 15 | type: str 16 | description: Password for the Powerflex MDM. 17 | powerflex_common_file_install_location: 18 | required: true 19 | type: str 20 | description: Common file installation location. 21 | powerflex_mdm_virtual_ip: 22 | type: str 23 | description: Virtual IP address of MDM. 24 | powerflex_mdm_cert_password: 25 | type: str 26 | description: 27 | - Password to generate cli certificate for MDM. 28 | - Required while installing MDM for Powerlex 4.x. 29 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Bhavneet Sharma 4 | description: Role to manage the installation and uninstallation of Powerflex MDM. 5 | company: Dell Technologies 6 | role_name: powerflex_mdm 7 | namespace: dellemc 8 | 9 | license: GPL-3.0-only 10 | 11 | min_ansible_version: "2.14.0" 12 | 13 | platforms: 14 | - name: EL 15 | versions: 16 | - "9" 17 | - "8" 18 | - name: Ubuntu 19 | versions: 20 | - jammy 21 | 22 | - name: SLES 23 | versions: 24 | - "15SP3" 25 | - "15SP4" 26 | 27 | galaxy_tags: [] 28 | dependencies: 29 | - role: powerflex_common 30 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/molecule/mdm_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: MDM installation 3 | hosts: mdm 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | tasks: 7 | - name: Install common packages 8 | ansible.builtin.import_role: 9 | name: powerflex_common 10 | 11 | - name: Install and configure Powerflex MDM 12 | ansible.builtin.import_role: 13 | name: powerflex_mdm 14 | vars: 15 | powerflex_mdm_state: present 16 | 17 | - name: Verifying install package in check mode 18 | ansible.builtin.assert: 19 | that: 20 | - powerflex_common_install_package_output.msg == "Check mode: No changes made" 21 | when: ansible_check_mode 22 | 23 | - name: Verifying installation package in normal mode 24 | ansible.builtin.assert: 25 | that: 26 | - "'Installed' in powerflex_common_install_package_output.results[0]" 27 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 28 | 29 | - name: Verifying add primary mdm in normal mode 30 | ansible.builtin.assert: 31 | that: 32 | - "'Successfully created the MDM Cluster' in powerflex_mdm_add_primary_output.stdout" 33 | when: not ansible_check_mode and powerflex_mdm_add_primary_output.changed 34 | 35 | - name: Verifying add secondary mdm in normal mode 36 | ansible.builtin.assert: 37 | that: 38 | - "'Successfully added a standby MDM' in powerflex_mdm_add_secondary_output.stdout" 39 | when: not ansible_check_mode and powerflex_mdm_add_secondary_output.changed 40 | 41 | - name: Verifying add tertiary mdm in normal mode 42 | ansible.builtin.assert: 43 | that: 44 | - "'Successfully added a standby MDM' in powerflex_mdm_add_tertiary_output.stdout" 45 | when: not ansible_check_mode and powerflex_mdm_add_tertiary_output.changed 46 | 47 | - name: Verifying primary mdm configuration in Idempotency 48 | ansible.builtin.assert: 49 | that: 50 | - "'The Primary MDM is already configured' in powerflex_mdm_add_primary_output.stderr_lines[0]" 51 | when: not ansible_check_mode and not powerflex_mdm_add_primary_output.changed 52 | 53 | - name: Verifying secondary mdm configuration in Idempotency 54 | ansible.builtin.assert: 55 | that: 56 | - "'An MDM with the same name already exists' in powerflex_mdm_add_secondary_output.stderr_lines[0]" 57 | when: not ansible_check_mode and not powerflex_mdm_add_secondary_output.changed 58 | 59 | - name: Verifying tertiary mdm configuration in Idempotency 60 | ansible.builtin.assert: 61 | that: 62 | - "'An MDM with the same name already exists' in powerflex_mdm_add_tertiary_output.stderr_lines[0]" 63 | when: not ansible_check_mode and powerflex_mdm_tertiary_ip is defined and not powerflex_mdm_add_tertiary_output.changed 64 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/molecule/mdm_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/molecule/mdm_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: MDM uninstallation 3 | hosts: mdm 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | tasks: 7 | - name: Uninstall powerflex MDM 8 | ansible.builtin.import_role: 9 | name: powerflex_mdm 10 | vars: 11 | powerflex_mdm_state: 'absent' 12 | 13 | - name: Verifying uninstall package in check mode 14 | ansible.builtin.assert: 15 | that: 16 | - powerflex_mdm_uninstall_output.msg == "Check mode: No changes made" 17 | when: ansible_check_mode 18 | 19 | - name: Verifying remove secondary mdm in normal mode 20 | ansible.builtin.assert: 21 | that: 22 | - "'Successfully removed the standby MDM' in powerflex_mdm_remove_secondary.stdout" 23 | when: not ansible_check_mode and powerflex_mdm_remove_secondary.changed 24 | 25 | - name: Verifying remove tertiary mdm in normal mode 26 | ansible.builtin.assert: 27 | that: 28 | - "'Successfully removed the standby MDM' in powerflex_mdm_remove_tertiary.stdout" 29 | when: not ansible_check_mode and powerflex_mdm_tertiary_ip is defined and powerflex_mdm_remove_tertiary.changed 30 | 31 | - name: Verifying uninstall package in normal mode 32 | ansible.builtin.assert: 33 | that: 34 | - "'Removed: EMC-ScaleIO-mdm' in powerflex_mdm_uninstall_output.results[0].results[0]" 35 | when: not ansible_check_mode and powerflex_mdm_uninstall_output.changed 36 | 37 | - name: Verifying remove secondary mdm in Idempotency 38 | ansible.builtin.assert: 39 | that: 40 | - "'No such file or directory' in powerflex_mdm_remove_secondary.msg" 41 | when: not ansible_check_mode and not powerflex_mdm_remove_secondary.changed 42 | 43 | - name: Verifying remove tertiary mdm in Idempotency 44 | ansible.builtin.assert: 45 | that: 46 | - "'No such file or directory' in powerflex_mdm_remove_tertiary.msg" 47 | when: not ansible_check_mode and powerflex_mdm_tertiary_ip is defined and not powerflex_mdm_remove_tertiary.changed 48 | 49 | - name: Verifying uninstall package in Idempotency 50 | ansible.builtin.assert: 51 | that: 52 | - "'Nothing to do' in powerflex_mdm_uninstall_output.results[0].msg" 53 | when: not ansible_check_mode and not powerflex_mdm_uninstall_output.changed 54 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/molecule/mdm_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/tasks/install_mdm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include the mdm_set_facts.yml 3 | ansible.builtin.include_tasks: "mdm_set_facts.yml" 4 | 5 | - name: Include vars 6 | ansible.builtin.include_vars: "../vars/{{ ansible_distribution }}.yml" 7 | 8 | - name: Pre-requisite on rhel6 based os 9 | ansible.posix.sysctl: 10 | name: kernel.shmmax 11 | value: 209715200 12 | when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" 13 | 14 | - name: List the rpm file 15 | register: powerflex_mdm_package_file_version 16 | ansible.builtin.find: 17 | paths: "{{ powerflex_common_file_install_location }}" 18 | patterns: "*{{ file_glob_name }}*.rpm" 19 | delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" 20 | 21 | - name: Extract file versions 22 | ansible.builtin.set_fact: 23 | version: "{{ powerflex_mdm_package_file_version.files[0].path | regex_search('mdm-(\\d+)', '\\1') }}" 24 | when: powerflex_mdm_package_file_version.files | length > 0 25 | 26 | - name: Install MDM for PowerFlex below 4.x 27 | ansible.builtin.include_tasks: install_powerflex3x_mdm.yml 28 | when: version[0] < "4" 29 | 30 | - name: Install MDM for PowerFlex 4.x 31 | ansible.builtin.include_tasks: install_powerflex4x_mdm.yml 32 | when: version[0] >= "4" 33 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install and Configure MDM cluster 3 | ansible.builtin.include_tasks: install_mdm.yml 4 | when: powerflex_mdm_state == "present" 5 | 6 | - name: Uninstall MDM cluster 7 | ansible.builtin.include_tasks: remove_mdm.yml 8 | when: powerflex_mdm_state == "absent" 9 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/tasks/mdm_set_facts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set facts for MDM counts 3 | ansible.builtin.set_fact: 4 | mdm_count: "{{ groups['mdm'] | length }}" 5 | 6 | - name: Set facts for powerflex_mdm_primary_ip 7 | ansible.builtin.set_fact: 8 | powerflex_mdm_primary_ip: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }}" 9 | 10 | - name: Set facts for powerflex_mdm_primary_hostname 11 | ansible.builtin.set_fact: 12 | powerflex_mdm_primary_hostname: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" 13 | 14 | - name: Set facts for powerflex_mdm_secondary_ip 15 | ansible.builtin.set_fact: 16 | powerflex_mdm_secondary_ip: "{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" 17 | 18 | - name: Set facts for powerflex_mdm_secondary_hostname 19 | ansible.builtin.set_fact: 20 | powerflex_mdm_secondary_hostname: "{{ hostvars[groups['mdm'][1]]['inventory_hostname'] }}" 21 | 22 | - name: Set facts for powerflex_mdm_tertiary_ip 23 | ansible.builtin.set_fact: 24 | powerflex_mdm_tertiary_ip: "{{ hostvars[groups['mdm'][2]]['ansible_host'] }}" 25 | when: mdm_count | int > 2 26 | 27 | - name: Set facts for powerflex_mdm_tertiary_hostname 28 | ansible.builtin.set_fact: 29 | powerflex_mdm_tertiary_hostname: "{{ hostvars[groups['mdm'][2]]['inventory_hostname'] }}" 30 | when: mdm_count | int > 2 31 | 32 | - name: Set facts for powerflex_mdm_ips if mdm_count is 2 33 | ansible.builtin.set_fact: 34 | powerflex_mdm_ips: "{{ powerflex_mdm_secondary_ip }},{{ powerflex_mdm_primary_ip }}" 35 | when: mdm_count | int == 2 36 | 37 | - name: Set facts for powerflex_mdm_ips if mdm_count is more than 2 38 | ansible.builtin.set_fact: 39 | powerflex_mdm_ips: "{{ powerflex_mdm_secondary_ip }},{{ powerflex_mdm_primary_ip }},{{ powerflex_mdm_tertiary_ip }}" 40 | when: mdm_count | int > 2 41 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/tasks/remove_mdm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include the mdm_set_facts.yml 3 | ansible.builtin.include_tasks: mdm_set_facts.yml 4 | 5 | - name: List the rpm file 6 | register: powerflex_mdm_package_file_version 7 | ansible.builtin.find: 8 | paths: "/var/tmp/" 9 | patterns: "*{{ file_glob_name }}*.rpm" 10 | 11 | - name: Extract file versions 12 | ansible.builtin.set_fact: 13 | version: "{{ powerflex_mdm_package_file_version.files[0].path | regex_search('mdm-(\\d+)', '\\1') }}" 14 | when: powerflex_mdm_package_file_version.files | length > 0 15 | 16 | - name: MDM Cluster login below PowerFlex 4.x 17 | ansible.builtin.command: > 18 | scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} 19 | --username admin --password {{ powerflex_mdm_password }} --approve_certificate 20 | run_once: true 21 | ignore_errors: true 22 | register: powerflex_mdm_cluster_login 23 | changed_when: powerflex_mdm_cluster_login.rc == 0 24 | delegate_to: "{{ powerflex_mdm_primary_hostname }}" 25 | when: version[0] < "4" 26 | 27 | - name: Login to primary MDM node for PowerFlex 4.x 28 | register: powerflex_mdm_primary_login 29 | ansible.builtin.command: > 30 | scli --login --username {{ username }} --management_system_ip {{ hostname }} --password "{{ password }}" 31 | delegate_to: "{{ powerflex_mdm_primary_hostname }}" 32 | run_once: true 33 | ignore_errors: true 34 | changed_when: powerflex_mdm_primary_login.rc == 0 35 | when: version[0] >= "4" 36 | 37 | - name: Remove secondary MDM 38 | ansible.builtin.command: > 39 | scli --remove_standby_mdm --remove_mdm_ip {{ powerflex_mdm_secondary_ip }} 40 | run_once: true 41 | register: powerflex_mdm_remove_secondary 42 | delegate_to: "{{ powerflex_mdm_primary_hostname }}" 43 | ignore_errors: true 44 | when: powerflex_mdm_secondary_ip is defined 45 | changed_when: powerflex_mdm_remove_secondary.rc == 0 46 | 47 | - name: Remove tertiary MDM 48 | ansible.builtin.command: > 49 | scli --remove_standby_mdm --remove_mdm_ip {{ powerflex_mdm_tertiary_ip }} 50 | run_once: true 51 | register: powerflex_mdm_remove_tertiary 52 | delegate_to: "{{ powerflex_mdm_primary_hostname }}" 53 | ignore_errors: true 54 | when: powerflex_mdm_tertiary_ip is defined 55 | changed_when: powerflex_mdm_remove_tertiary.rc == 0 56 | 57 | - name: Include uninstall_mdm.yml 58 | ansible.builtin.include_tasks: uninstall_mdm.yml 59 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/tasks/uninstall_mdm.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall MDM package 3 | register: powerflex_mdm_uninstall_output 4 | environment: 5 | I_AM_SURE: "{{ i_am_sure | int }}" 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: "absent" 9 | with_items: 10 | - EMC-ScaleIO-mdm 11 | when: ansible_distribution in ("RedHat", "CentOS", "SLES") 12 | 13 | - name: Uninstall deb package 14 | ansible.builtin.apt: 15 | name: "{{ item }}" 16 | state: absent 17 | with_items: 18 | - emc-scaleio-mdm 19 | when: ansible_distribution == "Ubuntu" 20 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/vars/CentOS.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_mdm_packages: 3 | - bash-completion 4 | - python2 5 | - binutils 6 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/vars/RedHat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_mdm_packages: 3 | - bash-completion 4 | - python2 5 | - binutils 6 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/vars/SLES.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_mdm_packages: 3 | - python3 4 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/vars/Ubuntu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_mdm_packages: 3 | - bash-completion 4 | - python2.7 5 | -------------------------------------------------------------------------------- /roles/powerflex_mdm/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: mdm 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_mdm_ips }}" 6 | MDM_ROLE_IS_MANAGER: 1 7 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_common_win_package_location: "C:\\Windows\\Temp" 3 | powerflex_sdc_driver_sync_repo_address: 'ftp://ftp.emc.com/' 4 | powerflex_sdc_driver_sync_repo_user: 'QNzgdxXix' 5 | powerflex_sdc_driver_sync_repo_password: 'Aw3wFAwAq3' 6 | powerflex_sdc_driver_sync_repo_local_dir: '/bin/emc/scaleio/scini_sync/driver_cache/' 7 | powerflex_sdc_driver_sync_user_private_rsa_key_src: '' 8 | powerflex_sdc_driver_sync_user_private_rsa_key_dest: '/bin/emc/scaleio/scini_sync/scini_key' 9 | powerflex_sdc_driver_sync_repo_public_rsa_key_src: '' 10 | powerflex_sdc_driver_sync_repo_public_rsa_key_dest: '/bin/emc/scaleio/scini_sync/scini_repo_key.pub' 11 | powerflex_sdc_driver_sync_module_sigcheck: 1 12 | powerflex_sdc_driver_sync_emc_public_gpg_key_src: ../../../files/RPM-GPG-KEY-powerflex_2.0.*.0 13 | powerflex_sdc_driver_sync_emc_public_gpg_key_dest: '/bin/emc/scaleio/scini_sync/emc_key.pub' 14 | powerflex_sdc_driver_sync_sync_pattern: .* 15 | powerflex_sdc_state: present 16 | powerflex_sdc_name: sdc_test 17 | powerflex_sdc_performance_profile: Compact 18 | file_glob_name: sdc 19 | i_am_sure: 1 20 | powerflex_role_environment: 21 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Restart scini 3 | ansible.builtin.service: 4 | name: "scini" 5 | state: "restarted" 6 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Jennifer John 4 | description: The role helps to manage the installation of SDC. 5 | company: Dell Technologies 6 | role_name: powerflex_sdc 7 | namespace: dellemc 8 | 9 | license: GPL-3.0-only 10 | 11 | min_ansible_version: "2.14.0" 12 | platforms: 13 | - name: EL 14 | versions: 15 | - "9" 16 | - "8" 17 | - name: Ubuntu 18 | versions: 19 | - jammy 20 | - name: SLES 21 | versions: 22 | - "15SP3" 23 | - "15SP4" 24 | 25 | galaxy_tags: [] 26 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_install_map_volume_uninstall_negative/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: sdc 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: "Install and configure powerflex SDC" 9 | ansible.builtin.import_role: 10 | name: "powerflex_sdc" 11 | vars: 12 | powerflex_sdc_state: present 13 | register: powerflex_sdc_result_molecule 14 | 15 | - name: "Verifying installation package" 16 | ansible.builtin.assert: 17 | that: 18 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 19 | when: 20 | - not ansible_check_mode and powerflex_common_install_package_output.changed 21 | - " 'WindowsOS' not in ansible_distribution " 22 | - " 'VMkernel' not in ansible_distribution " 23 | 24 | - name: "Verifying installation package on windows" 25 | ansible.builtin.assert: 26 | that: 27 | - powerflex_common_install_package_output.rc == 0 28 | when: 29 | - " 'WindowsOS' in ansible_distribution " 30 | - not ansible_check_mode and powerflex_common_install_package_output.changed 31 | 32 | - name: "Verifying installation package on ESXi" 33 | ansible.builtin.assert: 34 | that: 35 | - powerflex_common_install_package_output.rc == 0 36 | when: 37 | - " 'VMkernel' in ansible_distribution " 38 | - not ansible_check_mode and powerflex_common_install_package_output.changed 39 | 40 | - name: "Verifying performance profile value" 41 | ansible.builtin.assert: 42 | that: 43 | - powerflex_sdc_performance_profile_output.sdc_details.perfProfile == "{{ powerflex_sdc_performance_profile }}" 44 | when: not ansible_check_mode and powerflex_sdc_performance_profile_output.changed 45 | 46 | - name: "Verifying rename value" 47 | ansible.builtin.assert: 48 | that: 49 | - powerflex_sdc_rename_output.sdc_details.name == "{{ powerflex_sdc_name }}" 50 | when: not ansible_check_mode and powerflex_sdc_performance_profile_output.changed 51 | 52 | - name: "Verifying performance profile value in Idempotency" 53 | ansible.builtin.assert: 54 | that: 55 | - powerflex_sdc_performance_profile_output.sdc_details.perfProfile == "{{ powerflex_sdc_performance_profile }}" 56 | when: not ansible_check_mode and not powerflex_sdc_performance_profile_output.changed 57 | 58 | - name: "Verifying rename value in Idempotency" 59 | ansible.builtin.assert: 60 | that: 61 | - powerflex_sdc_rename_output.sdc_details.name == '{{ powerflex_sdc_name }}' 62 | when: not ansible_check_mode and not powerflex_sdc_performance_profile_output.changed 63 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_installation_invalid_path_rpm/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: sdc 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: "Install and configure powerflex SDC with no rpm" 9 | ansible.builtin.import_role: 10 | name: "powerflex_sdc" 11 | vars: 12 | powerflex_common_file_install_location: "/opt/empty" 13 | powerflex_sdc_state: present 14 | register: powerflex_sdc_result_molecule 15 | ignore_errors: true 16 | 17 | - name: "Verifying failure of install package with respect to no rpm file" 18 | ansible.builtin.assert: 19 | that: 20 | - powerflex_common_package_file.files | length == 0 21 | 22 | - name: "Install and configure powerflex SDC with wrong file path" 23 | ansible.builtin.import_role: 24 | name: "powerflex_sdc" 25 | vars: 26 | powerflex_common_file_install_location: "/opt/aaab" 27 | powerflex_sdc_state: present 28 | register: powerflex_sdc_result_molecule 29 | ignore_errors: true 30 | 31 | - name: "Verifying failure of install package with wrong file path" 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_common_package_file.files | length == 0 35 | 36 | - name: "Install and configure powerflex SDC with wrong rpm version" 37 | ansible.builtin.import_role: 38 | name: "powerflex_sdc" 39 | vars: 40 | powerflex_common_file_install_location: "/opt/wrong_rpm" 41 | powerflex_sdc_state: present 42 | ignore_errors: true 43 | register: powerflex_sdc_wrong_rpm_version 44 | 45 | - name: "Verifying failure of install package with wrong rpm version" 46 | ansible.builtin.assert: 47 | that: 48 | - " 'Depsolve Error occurred: ' in powerflex_common_install_package_output.msg" 49 | 50 | - name: "Uninstall powerflex SDC" 51 | ansible.builtin.import_role: 52 | name: "powerflex_sdc" 53 | vars: 54 | powerflex_sdc_state: absent 55 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_installation_invalid_path_rpm/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: sdc 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: "Uninstall powerflex SDC" 9 | register: powerflex_sdc_uninstall_outputs 10 | ansible.builtin.import_role: 11 | name: "powerflex_sdc" 12 | vars: 13 | powerflex_sdc_state: 'absent' 14 | 15 | - name: "Verifying uninstall package in check mode" 16 | ansible.builtin.assert: 17 | that: 18 | - powerflex_sdc_uninstall_output.msg == "Check mode: No changes made, but would have if not in check mode" 19 | - powerflex_sdc_uninstall_output.changed is true 20 | when: ansible_check_mode 21 | 22 | - name: "Verifying remove the sdc" 23 | ansible.builtin.assert: 24 | that: 25 | - powerflex_sdc_remove_output.sdc_details is none 26 | when: not ansible_check_mode and powerflex_sdc_remove_output.changed 27 | 28 | - name: "Verifying uninstall package in Idempotency" 29 | ansible.builtin.assert: 30 | that: 31 | - powerflex_sdc_uninstall_output.results[0].msg == 'Nothing to do' 32 | when: 33 | - not ansible_check_mode and not powerflex_sdc_uninstall_output.changed 34 | - " 'WindowsOS' not in ansible_distribution " 35 | - " 'VMkernel' not in ansible_distribution " 36 | 37 | - name: "Verifying uninstall package in Idempotency for Windows node" 38 | ansible.builtin.assert: 39 | that: 40 | - powerflex_sdc_uninstall_output.msg == 'All items skipped' 41 | when: 42 | - not ansible_check_mode and not powerflex_sdc_uninstall_output.changed 43 | - " 'WindowsOS' in ansible_distribution " 44 | 45 | - name: "Verifying uninstall package in Idempotency for ESXi node" 46 | ansible.builtin.assert: 47 | that: 48 | - powerflex_sdc_uninstall_output.msg == 'All items skipped' 49 | when: 50 | - not ansible_check_mode and not powerflex_sdc_uninstall_output.changed 51 | - " 'VMkernel' in ansible_distribution " 52 | 53 | - name: "Verifying remove the sdc in Idempotency" 54 | ansible.builtin.assert: 55 | that: 56 | - powerflex_sdc_remove_output.sdc_details is none 57 | when: not ansible_check_mode and not powerflex_sdc_remove_output.changed and powerflex_sdc_remove_output.sdc_details is defined 58 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/sdc_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/var_values.yml: -------------------------------------------------------------------------------- 1 | --- 2 | vol_name: "sdc_test_vol_1" 3 | storage_pool_name: "pool1" 4 | protection_domain_name: "domain1" 5 | vol_size: 8 6 | sdc_name: sdc_test_demo_1 7 | access_mode: "READ_WRITE" 8 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/wrong_sdc_credentials/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: sdc 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: false 7 | tasks: 8 | - name: "Install and configure powerflex SDC with wrong credentials" 9 | ansible.builtin.import_role: 10 | name: "powerflex_sdc" 11 | vars: 12 | powerflex_sdc_state: present 13 | ignore_unreachable: true 14 | ignore_errors: true 15 | register: powerflex_sdc_wrong_credentials_output 16 | 17 | - name: "Verifying failure of install package with wrong credentials" 18 | ansible.builtin.assert: 19 | that: 20 | - " 'failed. The error was: error while evaluating conditional' in powerflex_sdc_driver_sync_output.msg" 21 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/wrong_sdc_credentials/inventory: -------------------------------------------------------------------------------- 1 | node0 ansible_host=10.2.2.2 ansible_port=22 ansible_ssh_pass=wrongpassword ansible_user=root 2 | 3 | [sdc] 4 | node0 5 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/wrong_sdc_credentials/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | provisioner: 3 | name: ansible 4 | inventory: 5 | links: 6 | hosts: inventory 7 | group_vars: ../../../../playbooks/roles/group_vars/ 8 | host_vars: ../../../../playbooks/roles/host_vars/ 9 | scenario: 10 | test_sequence: 11 | - converge 12 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/wrong_sdc_ip/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: sdc 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: false 7 | tasks: 8 | - name: "Install and configure powerflex SDC with wrong SDC IP" 9 | ansible.builtin.import_role: 10 | name: "powerflex_sdc" 11 | vars: 12 | powerflex_sdc_state: present 13 | ignore_unreachable: true 14 | ignore_errors: true 15 | register: powerflex_sdc_wrong_ip_output 16 | 17 | - name: "Verifying failure of install package with wrong SDC IP" 18 | ansible.builtin.assert: 19 | that: 20 | " 'failed. The error was: error while evaluating conditional' in powerflex_sdc_driver_sync_output.msg" 21 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/wrong_sdc_ip/inventory: -------------------------------------------------------------------------------- 1 | node0 ansible_host=10.2.2.0 ansible_port=22 ansible_ssh_pass=password ansible_user=root 2 | 3 | [sdc] 4 | node0 5 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/molecule/wrong_sdc_ip/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | provisioner: 3 | name: ansible 4 | inventory: 5 | links: 6 | hosts: inventory 7 | group_vars: ../../../../playbooks/roles/group_vars/ 8 | host_vars: ../../../../playbooks/roles/host_vars/ 9 | scenario: 10 | test_sequence: 11 | - converge 12 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/tasks/configure_sdc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Rename the SDC 3 | dellemc.powerflex.sdc: 4 | hostname: "{{ hostname }}" 5 | username: "{{ username }}" 6 | password: "{{ password }}" 7 | validate_certs: "{{ validate_certs }}" 8 | sdc_ip: "{{ ansible_host }}" 9 | sdc_new_name: "{{ powerflex_sdc_name }}" 10 | state: "present" 11 | register: powerflex_sdc_rename_output 12 | delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" 13 | when: powerflex_sdc_name is defined and powerflex_sdc_name | length > 0 14 | 15 | - name: Set performance profile of SDC 16 | dellemc.powerflex.sdc: 17 | hostname: "{{ hostname }}" 18 | username: "{{ username }}" 19 | password: "{{ password }}" 20 | validate_certs: "{{ validate_certs }}" 21 | sdc_ip: "{{ ansible_host }}" 22 | performance_profile: "{{ powerflex_sdc_performance_profile }}" 23 | state: "present" 24 | register: powerflex_sdc_performance_profile_output 25 | delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" 26 | when: 27 | - powerflex_sdc_performance_profile is defined 28 | - powerflex_sdc_performance_profile | length > 0 29 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install SDC 3 | ansible.builtin.include_tasks: install_sdc.yml 4 | when: powerflex_sdc_state == 'present' 5 | 6 | - name: Remove SDC 7 | ansible.builtin.include_tasks: remove_sdc.yml 8 | when: powerflex_sdc_state == 'absent' 9 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/tasks/register_esxi_sdc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Generating random GUID 3 | register: powerflex_sdc_esxi_guid 4 | ansible.builtin.shell: > 5 | uuidgen 6 | changed_when: powerflex_sdc_esxi_guid.rc == 0 7 | 8 | - name: Register SDC and Set MDM IP addresses 9 | register: powerflex_sdc_register_set_sdc_mdm 10 | ansible.builtin.shell: > 11 | esxcli system module parameters set -m scini -p "IoctlIniGuidStr={{ powerflex_sdc_esxi_guid.stdout }} 12 | IoctlMdmIPStr={{ powerflex_sdc_mdm_ips }} bBlkDevIsPdlActive=1 blkDevPdlTimeoutMillis=60000" 13 | changed_when: powerflex_sdc_register_set_sdc_mdm.rc == 0 14 | 15 | - name: Reboot ESXi host 16 | register: powerflex_sdc_reboot_node 17 | ansible.builtin.reboot: 18 | reboot_timeout: 500 19 | msg: "Rebooting the ESXi host." 20 | when: 21 | - powerflex_sdc_register_set_sdc_mdm.rc == 0 22 | - "'Reboot Required: true' in powerflex_common_install_package_output.stdout" 23 | changed_when: powerflex_sdc_reboot_node 24 | 25 | - name: Ensure the driver is loaded for SDC 26 | register: powerflex_sdc_driver_loaded 27 | ansible.builtin.shell: > 28 | set -o pipefail && vmkload_mod -l | grep scini 29 | changed_when: powerflex_sdc_driver_loaded.stdout_lines | length == 0 30 | 31 | - name: Verify ESXi SDC connection with MDMs 32 | ansible.builtin.copy: 33 | src: "{{ item }}" 34 | dest: "{{ powerflex_common_esxi_files_location }}" 35 | mode: "0755" 36 | register: powerflex_sdc_drv_cfg_file_output 37 | with_fileglob: 38 | - "{{ powerflex_common_file_install_location }}/drv_cfg*" 39 | 40 | - name: List the drv_cfg file 41 | register: powerflex_sdc_drv_cfg_file 42 | ansible.builtin.find: 43 | paths: "{{ powerflex_common_esxi_files_location }}" 44 | patterns: "*drv_cfg*" 45 | 46 | - name: Execute drv_cfg command 47 | register: powerflex_sdc_drv_cfg_output 48 | ansible.builtin.command: ./drv_cfg --query_mdm 49 | args: 50 | chdir: "{{ powerflex_common_esxi_files_location }}" 51 | when: powerflex_sdc_drv_cfg_file.files | length > 0 52 | changed_when: 53 | - "'Retrieved 1 mdm(s)' not in powerflex_sdc_drv_cfg_output.stdout" 54 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/tasks/remove_sdc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set fact # noqa var-naming[no-role-prefix] 3 | ansible.builtin.set_fact: 4 | ansible_distribution: "WindowsOS" 5 | when: " 'Windows' in ansible_distribution" 6 | 7 | - name: Include uninstall_sdc.yml 8 | ansible.builtin.include_tasks: uninstall_sdc.yml 9 | 10 | - name: Remove the SDC 11 | dellemc.powerflex.sdc: 12 | hostname: "{{ hostname }}" 13 | username: "{{ username }}" 14 | password: "{{ password }}" 15 | validate_certs: "{{ validate_certs }}" 16 | sdc_name: "{{ powerflex_sdc_name }}" 17 | state: "absent" 18 | register: powerflex_sdc_remove_output 19 | delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" 20 | when: powerflex_sdc_name is defined and powerflex_sdc_name | length > 0 21 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/tasks/uninstall_esxi_sdc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Get the name of SDC driver installed 3 | register: powerflex_sdc_installed_driver_list 4 | ansible.builtin.shell: > 5 | set -o pipefail && esxcli software vib list | grep sdc 6 | changed_when: powerflex_sdc_installed_driver_list.stdout_lines | length == 0 7 | ignore_errors: true 8 | 9 | - name: Remove the SDC driver form the esxi host 10 | register: powerflex_sdc_remove_driver_output 11 | ansible.builtin.shell: > 12 | esxcli software vib remove -n {{ powerflex_sdc_installed_driver_list.stdout.split()[0] }} 13 | changed_when: "'Reboot Required: true' in powerflex_sdc_remove_driver_output.stdout" 14 | when: powerflex_sdc_installed_driver_list.stdout_lines | length != 0 15 | 16 | - name: Reboot ESXi host 17 | register: powerflex_sdc_remove_driver_reboot_output 18 | ansible.builtin.reboot: 19 | reboot_timeout: 450 20 | msg: "Rebooting the ESXi host." 21 | when: 22 | - powerflex_sdc_installed_driver_list.stdout_lines | length != 0 23 | changed_when: powerflex_sdc_remove_driver_reboot_output.rebooted 24 | 25 | - name: List the SDC driver installed 26 | ansible.builtin.shell: > 27 | set -o pipefail && esxcli software vib list | grep sdc 28 | register: powerflex_sdc_drivers_list 29 | changed_when: powerflex_sdc_drivers_list.stdout_lines | length != 0 30 | failed_when: powerflex_sdc_drivers_list.stdout_lines | length != 0 31 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/tasks/uninstall_sdc.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall package 3 | register: powerflex_sdc_uninstall_output 4 | environment: 5 | I_AM_SURE: "{{ i_am_sure | int }}" 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: "absent" 9 | with_items: 10 | - EMC-ScaleIO-sdc 11 | when: ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") 12 | 13 | - name: Uninstall deb package 14 | register: powerflex_sdc_uninstall_deb_output 15 | ansible.builtin.apt: 16 | name: "{{ item }}" 17 | state: absent 18 | with_items: 19 | - emc-scaleio-sdc 20 | when: ansible_distribution == "Ubuntu" 21 | 22 | - name: Include uninstall_esxi_sdc.yml to uninstall the esxi sdc 23 | ansible.builtin.include_tasks: uninstall_esxi_sdc.yml 24 | when: ansible_distribution == "VMkernel" 25 | 26 | - name: List the msi files 27 | ansible.windows.win_find: 28 | paths: "{{ powerflex_common_win_package_location }}" 29 | patterns: "*{{ file_glob_name }}*.msi" 30 | register: powerflex_sdc_msi_package_files 31 | when: ansible_distribution == "WindowsOS" 32 | 33 | - name: Uninstall win package 34 | register: powerflex_sdc_uninstall_win_output 35 | ansible.windows.win_package: 36 | path: "{{ item.path }}" 37 | state: absent 38 | with_items: 39 | - "{{ powerflex_sdc_msi_package_files.files }}" 40 | when: ansible_distribution == "WindowsOS" 41 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/templates/driver_sync.conf.j2: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # driver_sync Configuration file 3 | # Everything after a '#' until the end of the line is ignored 4 | ############################################################################### 5 | 6 | # Repository address, prefixed by protocol 7 | repo_address = {{ powerflex_sdc_driver_sync_repo_address }} 8 | 9 | # Repository user (valid for ftp/sftp protocol) 10 | repo_user = {{ powerflex_sdc_driver_sync_repo_user }} 11 | 12 | # Repository password (valid for ftp protocol) 13 | repo_password = {{ powerflex_sdc_driver_sync_repo_password }} 14 | 15 | # Local directory for modules 16 | local_dir = {{ powerflex_sdc_driver_sync_repo_local_dir }} 17 | 18 | # User's RSA private key file (sftp protocol) 19 | user_private_rsa_key = {{ powerflex_sdc_driver_sync_user_private_rsa_key_dest }} 20 | 21 | # Repository host public key (sftp protocol) 22 | repo_public_rsa_key = {{ powerflex_sdc_driver_sync_repo_public_rsa_key_dest }} 23 | 24 | # Should the fetched modules' signatures be checked [0, 1] 25 | module_sigcheck = {{ powerflex_sdc_driver_sync_module_sigcheck }} 26 | 27 | # EMC public signature key (needed when module_sigcheck is 1) 28 | emc_public_gpg_key = {{ powerflex_sdc_driver_sync_emc_public_gpg_key_dest }} 29 | 30 | # Sync pattern (regular expression) for massive retrieve 31 | sync_pattern = {{ powerflex_sdc_driver_sync_sync_pattern }} 32 | -------------------------------------------------------------------------------- /roles/powerflex_sdc/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: sdc 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_sdc_mdm_ips }}" 6 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for powerflex_sdr 3 | file_glob_name: sdr 4 | file_gpg_name: RPM-GPG-KEY-ScaleIO 5 | powerflex_common_file_install_location: "/var/tmp" 6 | powerflex_sdr_repl_journal_capacity_max_ratio: 10 7 | powerflex_role_environment: 8 | MDM_IP: "{{ powerflex_sdr_mdm_primary_ip }}" 9 | powerflex_sdr_state: present 10 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/meta/argument_specs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage installation and uninstallation Powerflex SDR 5 | description: 6 | - Role to manage installation and uninstallation Powerflex SDR. 7 | options: 8 | powerflex_common_file_install_location: 9 | description: 10 | - Location of installation and rpm gpg files to be installed. 11 | - The required, compatible installation software package based on the operating system of the node. 12 | - The files can be downloaded from the Dell Product support page for PowerFlex software. 13 | type: path 14 | default: /var/tmp 15 | powerflex_sdr_state: 16 | description: 17 | - Specifies the state of SDR. 18 | type: str 19 | choices: ['absent', 'present'] 20 | default: present 21 | powerflex_protection_domain_name: 22 | description: The name of the protection domain to which the SDR will be added. 23 | type: str 24 | powerflex_storage_pool_name: 25 | description: The name of the storage pool to which the device will be added. 26 | type: str 27 | powerflex_sdr_repl_journal_capacity_max_ratio: 28 | description: Maximum capacity percentage to be allocated for journal capacity. 29 | type: int 30 | default: 10 31 | powerflex_mdm_password: 32 | required: true 33 | type: str 34 | description: Password for the Powerflex MDM. 35 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | role_name: powerflex_sdr 4 | namespace: dellemc 5 | author: Abhishek Sinha 6 | description: The role to manage installation and uninstallation PowerFlex SDR. 7 | company: Dell Technologies 8 | license: GPL-3.0-only 9 | min_ansible_version: "2.14.0" 10 | platforms: 11 | - name: EL 12 | versions: 13 | - "9" 14 | - "8" 15 | - name: Ubuntu 16 | versions: 17 | - jammy 18 | - name: SLES 19 | versions: 20 | - "15SP3" 21 | - "15SP4" 22 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of SDR 3 | hosts: sdr 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure Powerflex SDR 9 | ansible.builtin.import_role: 10 | name: powerflex_sdr 11 | vars: 12 | powerflex_sdr_state: present 13 | 14 | - name: Verifying install package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_common_install_package_output.msg == "Check mode: No changes made" 18 | when: ansible_check_mode 19 | 20 | - name: Verifying installation package in normal mode 21 | ansible.builtin.assert: 22 | that: 23 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 24 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 25 | 26 | - name: Verifying installation package in Idempotency mode 27 | ansible.builtin.assert: 28 | that: 29 | - "'Nothing to do' in powerflex_common_install_package_output.msg" 30 | when: not ansible_check_mode and not powerflex_common_install_package_output.changed 31 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_installation_invalid_path_rpm/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of SDR with invalid rpm path, rpm file 3 | hosts: sdr 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure powerflex SDR with no rpm 9 | ansible.builtin.import_role: 10 | name: powerflex_sdr 11 | vars: 12 | powerflex_common_file_install_location: "/opt/empty" 13 | powerflex_sdr_state: present 14 | register: powerflex_sdr_no_rpm_result 15 | ignore_errors: true 16 | 17 | - name: Verifying failure of install package with respect to no rpm file in normal mode 18 | ansible.builtin.assert: 19 | that: 20 | - powerflex_common_package_file.files | length | int == 0 21 | 22 | - name: Install and configure powerflex SDR with wrong file path 23 | ansible.builtin.import_role: 24 | name: powerflex_sdr 25 | vars: 26 | powerflex_common_file_install_location: "/opt/aaab" 27 | powerflex_sdr_state: present 28 | ignore_errors: true 29 | register: powerflex_sdr_wrong_path_result 30 | 31 | - name: Verifying failure of install package with wrong file path 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_common_package_file.files | length == 0 35 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_installation_invalid_path_rpm/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_installation_invalid_pd/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of SDR 3 | hosts: sdr 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure powerflex SDR without protection domain 9 | vars: 10 | error_msg: "Please provide powerflex_protection_domain_name and powerflex_storage_pool_name in parameter for installing SDR." 11 | block: 12 | - name: Powerflex SDR 13 | ansible.builtin.import_role: 14 | name: dellemc.powerflex.powerflex_sdr 15 | vars: 16 | powerflex_sdr_state: present 17 | rescue: 18 | - name: Verifying failure of install package without protection domain 19 | ansible.builtin.assert: 20 | that: ansible_failed_result.ansible_facts.powerflex_add_sdr_output.msg == error_msg 21 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_installation_invalid_pd/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: SDR uninstallation 3 | hosts: sdr 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Uninstall powerflex SDR 9 | register: powerflex_sdr_uninstall_outputs 10 | ansible.builtin.import_role: 11 | name: powerflex_sdr 12 | vars: 13 | powerflex_sdr_state: absent 14 | 15 | - name: Verifying uninstall package in converge 16 | ansible.builtin.assert: 17 | that: 18 | - " 'Removed:' in powerflex_sdr_uninstall_output.results[0].results[0]" 19 | when: 20 | - not ansible_check_mode 21 | - powerflex_sdr_uninstall_output.changed 22 | - ansible_distribution in ("RedHat", "CentOS", "SLES") 23 | 24 | - name: Verifying uninstall package in check mode 25 | ansible.builtin.assert: 26 | that: 27 | - powerflex_sdr_uninstall_output.msg == "Check mode: No changes made" 28 | - powerflex_sdr_uninstall_output.changed 29 | - ansible_distribution in ("RedHat", "CentOS", "SLES") 30 | when: ansible_check_mode 31 | 32 | - name: Verifying remove the sdr in normal mode 33 | ansible.builtin.assert: 34 | that: 35 | - powerflex_remove_sdr_output.sdr_details is None 36 | when: 37 | - not ansible_check_mode 38 | - powerflex_remove_sdr_output.changed 39 | - ansible_distribution == "Ubuntu" 40 | 41 | - name: Verifying uninstall package in Idempotency 42 | ansible.builtin.assert: 43 | that: 44 | - powerflex_sdr_uninstall_output.results[0].msg == 'Nothing to do' 45 | - ansible_distribution in ("RedHat", "CentOS", "SLES") 46 | when: 47 | - not ansible_check_mode 48 | - not powerflex_sdr_uninstall_output.changed 49 | - ansible_distribution in ("RedHat", "CentOS", "SLES") 50 | 51 | - name: Verifying remove the sdr in check mode 52 | ansible.builtin.assert: 53 | that: 54 | - powerflex_remove_sdr_output.msg == "Check mode: No changes made" 55 | - powerflex_remove_sdr_output.changed 56 | - ansible_distribution == "Ubuntu" 57 | when: ansible_check_mode 58 | 59 | - name: Verifying remove the sdr in Idempotency 60 | ansible.builtin.assert: 61 | that: 62 | - powerflex_remove_sdr_output.sdr_details is None 63 | when: 64 | - not ansible_check_mode 65 | - not powerflex_remove_sdr_output.changed 66 | - ansible_distribution == "Ubuntu" 67 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/sdr_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/molecule/var_values.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_protection_domain_name: domain1 3 | powerflex_storage_pool_name: pool1 4 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Add SDR 3 | ansible.builtin.include_tasks: add_sdr.yml 4 | when: powerflex_sdr_state == 'present' 5 | 6 | - name: Remove SDR 7 | ansible.builtin.include_tasks: remove_sdr.yml 8 | when: powerflex_sdr_state == 'absent' 9 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/tasks/sdr_set_facts.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set facts for powerflex primary ip and hostname for mdm and sdr 3 | ansible.builtin.set_fact: 4 | powerflex_sdr_mdm_primary_ip: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }}" 5 | powerflex_sdr_mdm_primary_hostname: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" 6 | powerflex_sdr_ip: "{{ hostvars[inventory_hostname]['ansible_host'] }}" 7 | powerflex_sdr_hostname: "{{ inventory_hostname }}" 8 | -------------------------------------------------------------------------------- /roles/powerflex_sdr/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for powerflex_sdr 3 | -------------------------------------------------------------------------------- /roles/powerflex_sds/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: sds 3 | i_am_sure: 1 4 | powerflex_sds_state: present 5 | -------------------------------------------------------------------------------- /roles/powerflex_sds/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Trisha Datta 4 | description: The role helps to manage the installation of SDS. 5 | company: Dell Technologies 6 | license: GPL-3.0-only 7 | role_name: powerflex_sds 8 | namespace: dellemc 9 | 10 | min_ansible_version: "2.14.0" 11 | platforms: 12 | - name: EL 13 | versions: 14 | - "9" 15 | - "8" 16 | - name: Ubuntu 17 | versions: 18 | - jammy 19 | - name: SLES 20 | versions: 21 | - "15SP3" 22 | - "15SP4" 23 | 24 | galaxy_tags: [] 25 | -------------------------------------------------------------------------------- /roles/powerflex_sds/molecule/sds_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: SDS installation 3 | hosts: sds 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | tasks: 7 | - name: Install common packages 8 | ansible.builtin.import_role: 9 | name: powerflex_common 10 | vars: 11 | powerflex_sds_state: present 12 | 13 | - name: Install and configure powerflex SDS 14 | ansible.builtin.import_role: 15 | name: powerflex_sds 16 | vars: 17 | powerflex_sds_state: present 18 | 19 | - name: Verifying device in normal mode 20 | ansible.builtin.assert: 21 | that: 22 | - powerflex_sds_add_device_output.device_details.mediaType == "{{ powerflex_sds_device_media_type }}" 23 | - powerflex_sds_add_device_output.device_details.name == "{{ powerflex_sds_device_name }}" 24 | - powerflex_sds_add_device_output.device_details.externalAccelerationType == "{{ powerflex_sds_external_acceleration_type }}" 25 | - powerflex_sds_add_device_output.device_details.storagepoolPoolName == "{{ powerflex_sds_storage_pool }}" 26 | - powerflex_sds_add_device_output.device_details.protectionDomainName == "{{ powerflex_sds_protection_domain }}" 27 | when: 28 | - not ansible_check_mode 29 | - powerflex_sds_add_device_output.changed 30 | 31 | - name: Verifying install package in check mode 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_common_install_package_output.msg == "Check mode: No changes made" 35 | when: ansible_check_mode 36 | 37 | - name: Verifying installation package 38 | ansible.builtin.assert: 39 | that: 40 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 41 | when: 42 | - not ansible_check_mode 43 | - powerflex_common_install_package_output.changed 44 | 45 | - name: Verifying device in Idempotency 46 | ansible.builtin.assert: 47 | that: 48 | - powerflex_sds_add_device_output.device_details.mediaType == "{{ powerflex_sds_device_media_type }}" 49 | - powerflex_sds_add_device_output.device_details.name == "{{ powerflex_sds_device_name }}" 50 | - powerflex_sds_add_device_output.device_details.externalAccelerationType == "{{ powerflex_sds_external_acceleration_type }}" 51 | - powerflex_sds_add_device_output.device_details.storagepoolPoolName == "{{ powerflex_sds_storage_pool }}" 52 | - powerflex_sds_add_device_output.device_details.protectionDomainName == "{{ powerflex_sds_protection_domain }}" 53 | when: 54 | - not ansible_check_mode 55 | - not powerflex_sds_add_device_output.changed 56 | -------------------------------------------------------------------------------- /roles/powerflex_sds/molecule/sds_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sds/molecule/sds_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: SDS uninstallation 3 | hosts: sds 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | tasks: 7 | - name: Uninstall powerflex SDS 8 | register: powerflex_sds_uninstall_outputs 9 | ansible.builtin.import_role: 10 | name: powerflex_sds 11 | vars: 12 | powerflex_sds_state: absent 13 | 14 | - name: Verifying uninstall package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_sds_uninstall_output.msg == "Check mode: No changes made" 18 | - powerflex_sds_uninstall_output.changed 19 | when: ansible_check_mode 20 | 21 | - name: Verifying remove the sds in normal mode 22 | ansible.builtin.assert: 23 | that: 24 | - powerflex_sds_remove_result.sds_details is None 25 | when: 26 | - not ansible_check_mode 27 | - powerflex_sds_remove_result.changed 28 | 29 | - name: Verifying uninstall package in Idempotency 30 | ansible.builtin.assert: 31 | that: 32 | - powerflex_sds_uninstall_output.results[0].msg == 'Nothing to do' 33 | when: 34 | - not ansible_check_mode 35 | - not powerflex_sds_uninstall_output.changed 36 | 37 | - name: Verifying remove the sds in check mode 38 | ansible.builtin.assert: 39 | that: 40 | - powerflex_sds_remove_result.msg == "Check mode: No changes made" 41 | - powerflex_sds_remove_result.changed 42 | when: ansible_check_mode 43 | 44 | - name: Verifying remove the sds in Idempotency 45 | ansible.builtin.assert: 46 | that: 47 | - powerflex_sds_remove_result.sds_details is None 48 | when: 49 | - not ansible_check_mode 50 | - not powerflex_sds_remove_result.changed 51 | -------------------------------------------------------------------------------- /roles/powerflex_sds/molecule/sds_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sds/molecule/var_values.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_sds_disks: 3 | ansible_available_disks: 4 | - '/dev/sdb' 5 | powerflex_sds_disks_type: HDD 6 | powerflex_sds_protection_domain: domain1 7 | powerflex_sds_storage_pool: pool1 8 | powerflex_sds_role: all 9 | powerflex_sds_device_media_type: HDD 10 | powerflex_sds_device_name: '/dev/sdb' 11 | powerflex_sds_external_acceleration_type: ReadAndWrite 12 | -------------------------------------------------------------------------------- /roles/powerflex_sds/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install SDS 3 | ansible.builtin.include_tasks: install_sds.yml 4 | when: powerflex_sds_state == 'present' 5 | 6 | - name: Remove SDS 7 | ansible.builtin.include_tasks: uninstall_sds.yml 8 | when: powerflex_sds_state == 'absent' 9 | -------------------------------------------------------------------------------- /roles/powerflex_sds/tasks/uninstall_sds.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Remove SDS 3 | dellemc.powerflex.sds: 4 | hostname: "{{ hostname }}" 5 | username: "{{ username }}" 6 | password: "{{ password }}" 7 | validate_certs: "{{ validate_certs }}" 8 | port: "{{ port }}" 9 | sds_name: "{{ inventory_hostname }}" 10 | state: "absent" 11 | register: powerflex_sds_remove_result 12 | delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" 13 | 14 | - name: Uninstall package 15 | register: powerflex_sds_uninstall_output 16 | environment: 17 | I_AM_SURE: "{{ i_am_sure | int }}" 18 | ansible.builtin.package: 19 | name: "{{ item }}" 20 | state: "absent" 21 | with_items: 22 | - EMC-ScaleIO-sds 23 | when: ansible_distribution in ("RedHat", "CentOS", "SLES") 24 | 25 | - name: Uninstall deb package 26 | ansible.builtin.apt: 27 | name: "{{ item }}" 28 | state: absent 29 | with_items: 30 | - emc-scaleio-sds 31 | when: ansible_distribution == "Ubuntu" 32 | -------------------------------------------------------------------------------- /roles/powerflex_sds/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: sds 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_sds_mdm_ips }}" 6 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_sdt_state: present 3 | powerflex_sdt_storage_port: 12200 4 | powerflex_sdt_nvme_port: 4420 5 | powerflex_sdt_discovery_port: 8009 6 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/meta/argument_spec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage the installation and uninstallation of 5 | Powerflex SDT. 6 | description: 7 | - Role to manage the installation and uninstallation of Powerflex SDT. 8 | options: 9 | hostname: 10 | required: true 11 | type: str 12 | description: IP or FQDN of the PowerFlex gateway. 13 | username: 14 | required: true 15 | type: str 16 | description: The username of the PowerFlex gateway. 17 | password: 18 | required: true 19 | type: str 20 | description: The password of the PowerFlex gateway. 21 | port: 22 | type: int 23 | description: Port of the PowerFlex gateway. 24 | default: 443 25 | validate_certs: 26 | description: 27 | - If C(false), the SSL certificates will not be validated. 28 | - Configure C(false) only on personally controlled sites where 29 | self-signed certificates are used. 30 | type: bool 31 | default: false 32 | timeout: 33 | description: Timeout. 34 | type: int 35 | default: 120 36 | powerflex_common_file_install_location: 37 | description: 38 | - Location of installation and rpm gpg files to be installed. 39 | - The required, compatible installation software package based 40 | on the operating system of the node. 41 | - The files can be downloaded from the Dell Product support 42 | page for PowerFlex software. 43 | type: str 44 | default: /var/tmp 45 | powerflex_sdt_discovery_port: 46 | description: 47 | - Port used by the NVMe hosts for discovery. Set to 1 in order 48 | to indicate no use of discovery port. 49 | type: int 50 | default: 8009 51 | powerflex_sdt_ip_list: 52 | required: true 53 | description: 54 | - Target IP list of SDT. Comma separated. 55 | type: str 56 | powerflex_sdt_nvme_port: 57 | description: 58 | - Port used by the NVMe hosts. 59 | type: int 60 | default: 4420 61 | powerflex_sdt_protection_domain: 62 | required: true 63 | description: 64 | - The name of the protection domain to which the SDT will be added. 65 | type: str 66 | powerflex_sdt_role_list: 67 | required: true 68 | description: 69 | - Role list of SDT target IP. Comma separated. 70 | type: str 71 | choices: ["storage_only", "host_only", "storage_and_host"] 72 | powerflex_sdt_state: 73 | description: 74 | - Specifies the state of SDT. 75 | type: str 76 | choices: ["absent", "present"] 77 | default: present 78 | powerflex_sdt_storage_port: 79 | description: 80 | - Port assigned to the SDT 81 | type: int 82 | default: 12200 83 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Yuhao Liu 4 | description: The role helps to manage the installation of SDT. 5 | company: Dell Technologies 6 | license: GPL-3.0-only 7 | role_name: powerflex_sdt 8 | namespace: dellemc 9 | 10 | min_ansible_version: "2.14.0" 11 | platforms: 12 | - name: EL 13 | versions: 14 | - "9" 15 | - "8" 16 | - name: Ubuntu 17 | versions: 18 | - jammy 19 | - name: SLES 20 | versions: 21 | - "15SP3" 22 | - "15SP4" 23 | 24 | galaxy_tags: [] 25 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/molecule/sdt_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Molecule Test for installation of SDT 3 | hosts: sdt 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | 7 | tasks: 8 | - name: Install and configure Powerflex SDT 9 | ansible.builtin.import_role: 10 | name: powerflex_sdt 11 | vars: 12 | powerflex_sdt_state: present 13 | 14 | - name: Verifying install package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_common_install_package_output.msg == "Check mode: No changes made" 18 | when: ansible_check_mode 19 | 20 | - name: Verifying add sdt in check mode 21 | ansible.builtin.assert: 22 | that: 23 | - powerflex_add_sdt_result.msg == "Check mode: No changes made" 24 | when: ansible_check_mode 25 | 26 | - name: Verifying installation package in converge mode 27 | ansible.builtin.assert: 28 | that: 29 | - not powerflex_common_install_package_output.failed 30 | - powerflex_common_install_package_output.state == "present" 31 | when: 32 | - not ansible_check_mode 33 | - powerflex_common_install_package_output.changed 34 | 35 | - name: Verifying add sdt in converge mode 36 | ansible.builtin.assert: 37 | that: 38 | - not powerflex_add_sdt_result.failed 39 | when: 40 | - not ansible_check_mode 41 | - powerflex_add_sdt_result.changed 42 | 43 | - name: Verifying installation package in Idempotency mode 44 | ansible.builtin.assert: 45 | that: 46 | - not powerflex_common_install_package_output.failed 47 | - powerflex_common_install_package_output.state == "present" 48 | when: 49 | - not ansible_check_mode 50 | - not powerflex_common_install_package_output.changed 51 | 52 | - name: Verifying add sdt in Idempotency mode 53 | ansible.builtin.assert: 54 | that: 55 | - powerflex_add_sdt_result.rc == 7 56 | when: 57 | - not ansible_check_mode 58 | - not powerflex_add_sdt_result.changed 59 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/molecule/sdt_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/molecule/sdt_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: SDT uninstallation 3 | hosts: sdt 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | tasks: 7 | - name: Uninstall powerflex SDT 8 | register: powerflex_sdt_uninstall_output 9 | ansible.builtin.import_role: 10 | name: powerflex_sdt 11 | vars: 12 | powerflex_sdt_state: absent 13 | 14 | - name: Verifying uninstall package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - powerflex_sdt_uninstall_output.msg == "Check mode: No changes made" 18 | when: ansible_check_mode 19 | 20 | - name: Verifying remove the sdt in check mode 21 | ansible.builtin.assert: 22 | that: 23 | - powerflex_sdt_remove_result.msg == "Check mode: No changes made" 24 | when: ansible_check_mode 25 | 26 | - name: Verifying uninstall package in converge mode 27 | ansible.builtin.assert: 28 | that: 29 | - not powerflex_sdt_uninstall_output.results[0].failed 30 | - powerflex_sdt_uninstall_output.results[0].state == "absent" 31 | when: 32 | - not ansible_check_mode 33 | - powerflex_sdt_uninstall_output.changed 34 | 35 | - name: Verifying remove the sdt in converge mode 36 | ansible.builtin.assert: 37 | that: 38 | - not powerflex_sdt_remove_result.failed 39 | when: 40 | - not ansible_check_mode 41 | - powerflex_sdt_remove_result.changed 42 | 43 | - name: Verifying uninstall package in Idempotency 44 | ansible.builtin.assert: 45 | that: 46 | - not powerflex_sdt_uninstall_output.results[0].failed 47 | - powerflex_sdt_uninstall_output.results[0].state == "absent" 48 | when: 49 | - not ansible_check_mode 50 | - not powerflex_sdt_uninstall_output.changed 51 | 52 | - name: Verifying remove the sdt in Idempotency 53 | ansible.builtin.assert: 54 | that: 55 | - powerflex_sdt_remove_result.rc == 7 56 | when: 57 | - not ansible_check_mode 58 | - not powerflex_sdt_remove_result.changed 59 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/molecule/sdt_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install SDT 3 | ansible.builtin.include_tasks: install_sdt.yml 4 | when: powerflex_sdt_state == 'present' 5 | 6 | - name: Remove SDT 7 | ansible.builtin.include_tasks: uninstall_sdt.yml 8 | when: powerflex_sdt_state == 'absent' 9 | -------------------------------------------------------------------------------- /roles/powerflex_sdt/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: sdt 3 | file_gpg_name: RPM-GPG-KEY-ScaleIO 4 | i_am_sure: 1 5 | powerflex_role_environment: 6 | MDM_IP: "{{ powerflex_sdt_mdm_ips }}" 7 | -------------------------------------------------------------------------------- /roles/powerflex_tb/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for powerflex_tb 3 | powerflex_tb_primary_name: primary_tb 4 | powerflex_tb_secondary_name: secondary_tb 5 | powerflex_tb_cluster_mode: "ThreeNodes" 6 | file_glob_name: mdm 7 | powerflex_role_environment: 8 | MDM_IP: "{{ powerflex_tb_mdm_ips }}" 9 | -------------------------------------------------------------------------------- /roles/powerflex_tb/meta/argument_spec.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage the installation and uninstallation of Powerflex TB. 5 | description: 6 | - Role to manage the installation and uninstallation of Powerflex TB. 7 | options: 8 | hostname: 9 | required: true 10 | type: str 11 | description: IP or FQDN of the PowerFlex gateway. 12 | username: 13 | required: true 14 | type: str 15 | description: The username of the PowerFlex gateway. 16 | password: 17 | required: true 18 | type: str 19 | description: The password of the PowerFlex gateway. 20 | port: 21 | type: int 22 | description: Port of the PowerFlex gateway. 23 | default: 443 24 | validate_certs: 25 | description: 26 | - If C(false), the SSL certificates will not be validated. 27 | - Configure C(false) only on personally controlled sites where self-signed certificates are used. 28 | type: bool 29 | default: false 30 | timeout: 31 | description: Timeout. 32 | type: int 33 | default: 120 34 | powerflex_common_file_install_location: 35 | description: 36 | - Location of installation and rpm gpg files to be installed. 37 | - The required, compatible installation software package based on the operating system of the node. 38 | type: str 39 | default: /var/tmp 40 | powerflex_tb_state: 41 | description: 42 | - Specify state of TB. 43 | type: str 44 | choices: ['absent', 'present'] 45 | default: present 46 | powerflex_tb_primary_name: 47 | required: true 48 | description: 49 | - Name of the primary TB. 50 | type: str 51 | default: 'primary_tb' 52 | powerflex_tb_secondary_name: 53 | required: true 54 | description: 55 | - Name of the secondary TB. 56 | type: str 57 | default: 'secondary_tb' 58 | powerflex_tb_cluster_mode: 59 | required: true 60 | description: 61 | - Mode of the cluster. 62 | choices: ['ThreeNodes', 'FiveNodes'] 63 | type: str 64 | default: 'ThreeNodes' 65 | powerflex_protection_domain_name: 66 | description: 67 | - Name of the protection domain. 68 | type: str 69 | default: 'tb_protection_domain' 70 | powerflex_fault_sets: 71 | description: 72 | - List of fault sets. 73 | type: list 74 | default: ['fs1', 'fs2', 'fs3'] 75 | powerflex_media_type: 76 | description: 77 | - Media type of the storage pool. 78 | type: str 79 | choices: ['SSD', 'HDD', 'TRANSITIONAL'] 80 | default: 'SSD' 81 | powerflex_storage_pool_name: 82 | description: 83 | - Name of the storage pool. 84 | type: str 85 | default: 'tb_storage_pool' 86 | -------------------------------------------------------------------------------- /roles/powerflex_tb/meta/argument_specs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage the installation and uninstallation of Powerflex TB. 5 | description: 6 | - Role to manage the installation and uninstallation of Powerflex TB. 7 | options: 8 | hostname: 9 | required: true 10 | type: str 11 | description: IP or FQDN of the PowerFlex gateway. 12 | username: 13 | required: true 14 | type: str 15 | description: The username of the PowerFlex gateway. 16 | password: 17 | required: true 18 | type: str 19 | description: The password of the PowerFlex gateway. 20 | port: 21 | type: int 22 | description: Port of the PowerFlex gateway. 23 | default: 443 24 | validate_certs: 25 | description: 26 | - If C(false), the SSL certificates will not be validated. 27 | - Configure C(false) only on personally controlled sites where self-signed certificates are used. 28 | type: bool 29 | default: false 30 | timeout: 31 | description: Timeout. 32 | type: int 33 | default: 120 34 | powerflex_common_file_install_location: 35 | description: 36 | - Location of installation and rpm gpg files to be installed. 37 | - The required, compatible installation software package based on the operating system of the node. 38 | type: str 39 | default: /var/tmp 40 | powerflex_tb_state: 41 | description: 42 | - Specify state of TB. 43 | type: str 44 | choices: ['absent', 'present'] 45 | default: present 46 | powerflex_tb_primary_name: 47 | description: 48 | - Name of the primary TB. 49 | type: str 50 | default: 'primary_tb' 51 | powerflex_tb_secondary_name: 52 | description: 53 | - Name of the secondary TB. 54 | type: str 55 | default: 'secondary_tb' 56 | powerflex_tb_cluster_mode: 57 | description: 58 | - Mode of the cluster. 59 | choices: ['ThreeNodes', 'FiveNodes'] 60 | type: str 61 | default: 'ThreeNodes' 62 | powerflex_tb_cert_password: 63 | description: 64 | - The CLI certificate password for login to the primary MDM. 65 | type: str 66 | -------------------------------------------------------------------------------- /roles/powerflex_tb/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: Ananthu S Kuttattu 4 | description: Role to manage the installation and uninstallation of Powerflex TB. 5 | company: Dell Technologies 6 | license: GPL-3.0-only 7 | role_name: powerflex_tb 8 | namespace: dellemc 9 | 10 | min_ansible_version: "2.14.0" 11 | platforms: 12 | - name: EL 13 | versions: 14 | - "9" 15 | - "8" 16 | - name: Ubuntu 17 | versions: 18 | - jammy 19 | 20 | - name: SLES 21 | versions: 22 | - "15SP3" 23 | - "15SP4" 24 | 25 | galaxy_tags: [] 26 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/tb_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: TB installation 3 | hosts: tb 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: Install common packages 9 | ansible.builtin.import_role: 10 | name: powerflex_common 11 | 12 | - name: "Install PowerFlex TieBreaker" 13 | ansible.builtin.import_role: 14 | name: "powerflex_tb" 15 | vars: 16 | powerflex_tb_state: present 17 | register: powerflex_tb_results 18 | 19 | - name: "Verifying installation package" 20 | ansible.builtin.assert: 21 | that: 22 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 23 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 24 | 25 | - name: "Verifying cluster mode switch from 1 node to 3 node MDM cluster" 26 | ansible.builtin.assert: 27 | that: 28 | - powerflex_tb_cluster_to_three_output.stdout == "Successfully switched the cluster mode." 29 | when: not ansible_check_mode and powerflex_tb_cluster_to_three_output.changed and powerflex_tb_cluster_mode == "ThreeNodes" 30 | 31 | - name: "Verifying cluster mode switch from 1 node to 5 node MDM cluster" 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_tb_cluster_to_five_output.stdout == "Successfully switched the cluster mode." 35 | when: not ansible_check_mode and powerflex_tb_cluster_to_five_output.changed and powerflex_tb_cluster_mode == "FiveNodes" 36 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/tb_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/tb_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: TB uninstallation 3 | hosts: tb 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: "Uninstall powerflex TB" 9 | register: powerflex_tb_uninstall_outputs 10 | ansible.builtin.import_role: 11 | name: "powerflex_tb" 12 | vars: 13 | powerflex_tb_state: 'absent' 14 | 15 | - name: "Verifying remove the TB" 16 | ansible.builtin.assert: 17 | that: 18 | - powerflex_tb_remove_primary_tb_output.stdout == "Successfully removed the standby MDM." 19 | when: not ansible_check_mode and powerflex_tb_remove_primary_tb_output.changed 20 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/tb_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/var_values.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_tb_primary_name: primary_tb 3 | powerflex_tb_secondary_name: secondary_tb 4 | powerflex_tb_cluster_mode: "ThreeNodes" 5 | powerflex_protection_domain_name: "tb_protection_domain" 6 | powerflex_fault_sets: ['fs1', 'fs2', 'fs3'] 7 | powerflex_storage_pool_name: "tb_storage_pool" 8 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/wrong_tb_credentials/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Providing incorrect credentials for TB node 3 | hosts: tb 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: false 7 | tasks: 8 | - name: "Install and configure powerflex tb with wrong credentials" 9 | ansible.builtin.import_role: 10 | name: "powerflex_tb" 11 | vars: 12 | powerflex_tb_state: present 13 | ignore_unreachable: true 14 | ignore_errors: true 15 | register: powerflex_tb_wrong_credentials_output 16 | 17 | - name: "Verifying failure of install package with wrong credentials" 18 | ansible.builtin.assert: 19 | that: 20 | - " 'Communication error' in powerflex_tb_primary_output.msg" 21 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/wrong_tb_credentials/inventory: -------------------------------------------------------------------------------- 1 | node0 ansible_host=10.2.2.2 ansible_port=22 ansible_ssh_pass=wrongpassword ansible_user=root 2 | 3 | [tb] 4 | node0 5 | -------------------------------------------------------------------------------- /roles/powerflex_tb/molecule/wrong_tb_credentials/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | provisioner: 3 | name: ansible 4 | inventory: 5 | links: 6 | hosts: inventory 7 | group_vars: ../../../../playbooks/roles/group_vars/ 8 | host_vars: ../../../../playbooks/roles/host_vars/ 9 | scenario: 10 | test_sequence: 11 | - converge 12 | -------------------------------------------------------------------------------- /roles/powerflex_tb/tasks/install_tb.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install TB for PowerFlex below 4.x 3 | ansible.builtin.include_tasks: install_tb3x.yml 4 | when: powerflex_tb_scli_version[0] == '3' 5 | 6 | - name: Install TB for PowerFlex 4.x 7 | ansible.builtin.include_tasks: install_tb4x.yml 8 | when: powerflex_tb_scli_version[0] >= '4' 9 | -------------------------------------------------------------------------------- /roles/powerflex_tb/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Include set_tb_ips.yml 3 | ansible.builtin.include_tasks: set_tb_ips.yml 4 | 5 | - name: Get SCli version 6 | ansible.builtin.command: > 7 | scli --query_cluster 8 | register: powerflex_tb_scli_cluster_details 9 | tags: register 10 | changed_when: powerflex_tb_scli_cluster_details.rc == 0 11 | delegate_to: "{{ powerflex_tb_mdm_primary_hostname }}" 12 | 13 | - name: Extract the scli version 14 | ansible.builtin.set_fact: 15 | powerflex_tb_scli_version: "{{ input_query | ansible.builtin.regex_search('Version: (\\d+)\\.(\\d+)', '\\1\\2') }}" 16 | vars: 17 | input_query: "{{ powerflex_tb_scli_cluster_details.stdout }}" 18 | 19 | - name: Extract the cluster mode 20 | ansible.builtin.set_fact: 21 | powerflex_tb_mdm_cluster_mode: "{{ input_query | ansible.builtin.regex_search('Mode: (\\w+)', '\\1') }}" 22 | vars: 23 | input_query: "{{ powerflex_tb_scli_cluster_details.stdout }}" 24 | 25 | - name: Install TB 26 | ansible.builtin.include_tasks: install_tb.yml 27 | when: powerflex_tb_state == 'present' 28 | 29 | - name: Uninstall TB 30 | ansible.builtin.include_tasks: uninstall_tb.yml 31 | when: powerflex_tb_state == 'absent' 32 | -------------------------------------------------------------------------------- /roles/powerflex_tb/tasks/set_tb_ips.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Set TB count 3 | ansible.builtin.set_fact: 4 | powerflex_tb_count: "{{ groups['tb'] | length }}" 5 | powerflex_tb_mdm_count: "{{ groups['mdm'] | length }}" 6 | 7 | - name: Set fact - powerflex_tb_mdm_primary_ip and powerflex_tb_mdm_secondary_ip 8 | ansible.builtin.set_fact: 9 | powerflex_tb_mdm_primary_ip: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }}" 10 | powerflex_tb_mdm_primary_hostname: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" 11 | powerflex_tb_mdm_secondary_ip: "{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" 12 | powerflex_tb_mdm_secondary_hostname: "{{ hostvars[groups['mdm'][1]]['inventory_hostname'] }}" 13 | 14 | - name: Set fact - powerflex_tb_primary 15 | ansible.builtin.set_fact: 16 | powerflex_tb_primary_ip: "{{ hostvars[groups['tb'][0]]['ansible_host'] }}" 17 | powerflex_tb_primary_hostname: "{{ hostvars[groups['tb'][0]]['inventory_hostname'] }}" 18 | 19 | - name: Set fact - powerflex_tb_device_management_system_ip_address 20 | ansible.builtin.set_fact: 21 | powerflex_tb_device_management_system_ip_address: "{{ powerflex_tb_mdm_primary_ip }}, {{ powerflex_tb_mdm_secondary_ip }}, {{ powerflex_tb_primary_ip }}" 22 | 23 | - name: Set fact - powerflex_tb_primary 24 | ansible.builtin.set_fact: 25 | powerflex_tb_secondary_ip: "{{ hostvars[groups['tb'][1]]['ansible_host'] }}" 26 | powerflex_tb_secondary_hostname: "{{ hostvars[groups['tb'][1]]['inventory_hostname'] }}" 27 | powerflex_tb_device_management_system_ip_address: "{{ powerflex_tb_device_management_system_ip_address }}, {{ powerflex_tb_secondary_ip }}" 28 | when: "powerflex_tb_count | int > 1" 29 | 30 | - name: Set fact - powerflex_tb_mdm_tertiary_ip 31 | ansible.builtin.set_fact: 32 | powerflex_tb_mdm_tertiary_ip: "{{ hostvars[groups['tb'][2]]['ansible_host'] }}" 33 | powerflex_tb_mdm_tertiary_hostname: "{{ hostvars[groups['tb'][2]]['inventory_hostname'] }}" 34 | powerflex_tb_device_management_system_ip_address: "{{ powerflex_tb_device_management_system_ip_address }}, {{ powerflex_tb_mdm_tertiary_ip }}" 35 | when: "powerflex_tb_mdm_count | int > 2" 36 | -------------------------------------------------------------------------------- /roles/powerflex_tb/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for powerflex_tb 3 | file_glob_name: mdm 4 | file_gpg_name: RPM-GPG-KEY-ScaleIO 5 | powerflex_role_environment: 6 | MDM_IP: "{{ powerflex_tb_mdm_ips }}" 7 | -------------------------------------------------------------------------------- /roles/powerflex_webui/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | powerflex_skip_java: false 3 | file_glob_name: mgmt-server 4 | powerflex_role_environment: 5 | MDM_IP: "{{ powerflex_webui_mdm_ips }}" 6 | powerflex_webui_state: "present" 7 | -------------------------------------------------------------------------------- /roles/powerflex_webui/meta/argument_specs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | argument_specs: 3 | main: 4 | short_description: Role to manage the installation and uninstallation of Powerflex web UI. 5 | description: 6 | - Role to manage the installation and uninstallation of Powerflex web UI. 7 | options: 8 | hostname: 9 | required: true 10 | type: str 11 | description: IP or FQDN of the PowerFlex gateway. 12 | username: 13 | required: true 14 | type: str 15 | description: The username of the PowerFlex gateway. 16 | password: 17 | required: true 18 | type: str 19 | description: The password of the PowerFlex gateway. 20 | port: 21 | type: int 22 | description: Port of the PowerFlex gateway. 23 | default: 443 24 | validate_certs: 25 | description: 26 | - If C(false), the SSL certificates will not be validated. 27 | - Configure C(false) only on personally controlled sites where self-signed certificates are used. 28 | type: bool 29 | default: false 30 | timeout: 31 | description: Time after which connection will get terminated. 32 | type: int 33 | default: 120 34 | powerflex_common_file_install_location: 35 | description: 36 | - Location of installation, compatible installation software package 37 | based on the operating system of the node. 38 | - The files can be downloaded from the Dell Product support page for PowerFlex software. 39 | type: path 40 | default: /var/tmp 41 | powerflex_webui_skip_java: 42 | type: bool 43 | description: Specifies whether to install java or not. 44 | default: false 45 | powerflex_webui_state: 46 | description: 47 | - Specifies the state of the web UI. 48 | - present will install the web UI if not already installed. 49 | - absent will uninstall the web UI if installed. 50 | type: str 51 | choices: ['absent', 'present'] 52 | default: present 53 | -------------------------------------------------------------------------------- /roles/powerflex_webui/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | role_name: powerflex_webui 4 | author: Trisha Datta 5 | namespace: dellemc 6 | description: Role to manage the installation and uninstallation of Powerflex WebUI. 7 | company: Dell Technologies 8 | 9 | license: GPL-3.0-only 10 | 11 | min_ansible_version: "2.14.0" 12 | 13 | platforms: 14 | - name: EL 15 | versions: 16 | - "9" 17 | - "8" 18 | - name: Ubuntu 19 | versions: 20 | - jammy 21 | 22 | - name: SLES 23 | versions: 24 | - "15SP3" 25 | - "15SP4" 26 | 27 | galaxy_tags: [] 28 | dependencies: 29 | - role: powerflex_common 30 | -------------------------------------------------------------------------------- /roles/powerflex_webui/molecule/webui_installation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: webui 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: Install and configure powerflex webui 9 | ansible.builtin.import_role: 10 | name: "powerflex_webui" 11 | vars: 12 | powerflex_webui_state: present 13 | 14 | - name: Verifying installation package in check mode 15 | ansible.builtin.assert: 16 | that: 17 | - " 'No changes made, but would have if not in check mode' in powerflex_common_install_package_output.msg" 18 | when: ansible_check_mode 19 | 20 | - name: Verifying installation package in converge 21 | ansible.builtin.assert: 22 | that: 23 | - " 'Installed' in powerflex_common_install_package_output.results[0]" 24 | when: not ansible_check_mode and powerflex_common_install_package_output.changed 25 | 26 | - name: Verifying installation package in idempotency 27 | ansible.builtin.assert: 28 | that: 29 | - " 'Nothing to do' in powerflex_common_install_package_output.msg" 30 | when: not ansible_check_mode and not powerflex_common_install_package_output.changed 31 | -------------------------------------------------------------------------------- /roles/powerflex_webui/molecule/webui_installation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_webui/molecule/webui_installation_invalid_path_rpm/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: webui 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: Install and configure powerflex webui with no rpm 9 | ansible.builtin.import_role: 10 | name: "powerflex_webui" 11 | vars: 12 | powerflex_common_file_install_location: "/opt/empty" 13 | powerflex_webui_state: present 14 | ignore_errors: true 15 | register: powerflex_webui_install_config_no_rpm_result 16 | 17 | - name: Verifying failure of install package with respect to no rpm file 18 | ansible.builtin.assert: 19 | that: 20 | - powerflex_common_package_file.files | length == 0 21 | 22 | - name: Install and configure powerflex webui with wrong file path 23 | ansible.builtin.import_role: 24 | name: "powerflex_webui" 25 | vars: 26 | powerflex_common_file_install_location: "/opt/aaab" 27 | powerflex_webui_state: present 28 | ignore_errors: true 29 | register: powerflex_webui_install_config_wrong_path_result 30 | 31 | - name: Verifying failure of install package with wrong file path 32 | ansible.builtin.assert: 33 | that: 34 | - powerflex_common_package_file.files | length == 0 35 | -------------------------------------------------------------------------------- /roles/powerflex_webui/molecule/webui_installation_invalid_path_rpm/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | scenario: 3 | test_sequence: 4 | - converge 5 | -------------------------------------------------------------------------------- /roles/powerflex_webui/molecule/webui_uninstallation/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: webui 4 | vars_files: 5 | - ../../../../playbooks/roles/vars_files/connection.yml 6 | gather_facts: true 7 | tasks: 8 | - name: Uninstall powerflex webui 9 | ansible.builtin.import_role: 10 | name: "powerflex_webui" 11 | vars: 12 | powerflex_webui_state: 'absent' 13 | 14 | - name: Verifying uninstall package in converge 15 | ansible.builtin.assert: 16 | that: 17 | - " 'Removed:' in powerflex_webui_uninstall_output.results[0].results[0]" 18 | when: not ansible_check_mode and powerflex_webui_uninstall_output.changed and ansible_distribution in ("RedHat", "CentOS", "SLES") 19 | 20 | - name: Verifying uninstall package in check mode 21 | ansible.builtin.assert: 22 | that: 23 | - powerflex_webui_uninstall_output.results[0].msg == "Check mode: No changes made, but would have if not in check mode" 24 | when: ansible_check_mode and ansible_distribution in ("RedHat", "CentOS", "SLES") 25 | 26 | - name: Verifying uninstall package in Idempotency 27 | ansible.builtin.assert: 28 | that: 29 | - powerflex_webui_uninstall_output.results[0].msg == 'Nothing to do' 30 | when: not ansible_check_mode and not powerflex_webui_uninstall_output.changed and ansible_distribution in ("RedHat", "CentOS", "SLES") 31 | 32 | - name: Verifying uninstall package in check mode for deb 33 | ansible.builtin.assert: 34 | that: 35 | - powerflex_webui_uninstall_deb_output.results[0].msg == "Check mode: No changes made, but would have if not in check mode" 36 | when: ansible_check_mode and ansible_distribution == "Ubuntu" 37 | 38 | - name: Verifying uninstall package in converge for deb 39 | ansible.builtin.assert: 40 | that: 41 | - " 'Removed:' in powerflex_webui_uninstall_deb_output.results[0].results[0]" 42 | when: not ansible_check_mode and powerflex_webui_uninstall_deb_output.changed and ansible_distribution == "Ubuntu" 43 | 44 | - name: Verifying uninstall package in Idempotency for deb 45 | ansible.builtin.assert: 46 | that: 47 | - powerflex_webui_uninstall_deb_output.results[0].msg == 'Nothing to do' 48 | when: not ansible_check_mode and not powerflex_webui_uninstall_deb_output.changed and ansible_distribution == "Ubuntu" 49 | -------------------------------------------------------------------------------- /roles/powerflex_webui/molecule/webui_uninstallation/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/powerflex_webui/tasks/install_webui.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check if webui package is available 3 | delegate_to: localhost 4 | ansible.builtin.find: 5 | paths: "{{ powerflex_common_file_install_location }}" 6 | patterns: "*{{ file_glob_name }}*" 7 | 8 | - name: Get configured MDM IP addresses 9 | dellemc.powerflex.mdm_cluster: 10 | hostname: "{{ hostname }}" 11 | username: "{{ username }}" 12 | password: "{{ password }}" 13 | port: "{{ port }}" 14 | validate_certs: "{{ validate_certs }}" 15 | state: present 16 | register: powerflex_webui_result 17 | delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" 18 | 19 | - name: Set fact - powerflex_webui_mdm_ips 20 | ansible.builtin.set_fact: 21 | powerflex_webui_mdm_ips: "{{ powerflex_webui_result.mdm_cluster_details.mdmAddresses | join(',') }}" 22 | 23 | - name: Include install_powerflex.yml 24 | ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml 25 | -------------------------------------------------------------------------------- /roles/powerflex_webui/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install and Configure PowerFlex webUI 3 | ansible.builtin.include_tasks: install_webui.yml 4 | when: powerflex_webui_state == "present" 5 | 6 | - name: Uninstall PowerFlex webUI 7 | ansible.builtin.include_tasks: uninstall_webui.yml 8 | when: powerflex_webui_state == "absent" 9 | -------------------------------------------------------------------------------- /roles/powerflex_webui/tasks/uninstall_webui.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Uninstall web UI package 3 | register: powerflex_webui_uninstall_output 4 | environment: 5 | I_AM_SURE: "{{ i_am_sure | int }}" 6 | ansible.builtin.package: 7 | name: "{{ item }}" 8 | state: "absent" 9 | with_items: 10 | - EMC-ScaleIO-mgmt-server 11 | when: ansible_distribution in ("RedHat", "CentOS", "SLES") 12 | 13 | - name: Uninstall deb package 14 | register: powerflex_webui_uninstall_deb_output 15 | ansible.builtin.apt: 16 | name: "{{ item }}" 17 | state: absent 18 | with_items: 19 | - EMC-ScaleIO-mgmt-server 20 | when: ansible_distribution == "Ubuntu" 21 | -------------------------------------------------------------------------------- /roles/powerflex_webui/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | file_glob_name: mgmt-server 3 | powerflex_role_environment: 4 | MDM_IP: "{{ powerflex_webui_mdm_ips }}" 5 | file_gpg_name: RPM-GPG-KEY-ScaleIO 6 | -------------------------------------------------------------------------------- /tests/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | modules: 3 | python_requires: '>=3.9' 4 | -------------------------------------------------------------------------------- /tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/ansible-powerflex/54fa6ee63f738fe0c23d9555611a7b91271207f3/tests/unit/__init__.py -------------------------------------------------------------------------------- /tests/unit/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/ansible-powerflex/54fa6ee63f738fe0c23d9555611a7b91271207f3/tests/unit/plugins/__init__.py -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/libraries/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/ansible-powerflex/54fa6ee63f738fe0c23d9555611a7b91271207f3/tests/unit/plugins/module_utils/libraries/__init__.py -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/libraries/fail_json.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """Mock fail json for PowerFlex Test modules""" 6 | 7 | from __future__ import (absolute_import, division, print_function) 8 | 9 | __metaclass__ = type 10 | 11 | 12 | class FailJsonException(Exception): 13 | def __init__(self, *args): 14 | if args: 15 | self.message = args[0] 16 | else: 17 | self.message = None 18 | 19 | 20 | def fail_json(msg, **kwargs): 21 | raise FailJsonException(msg) 22 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/libraries/initial_mock.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | from __future__ import (absolute_import, division, print_function) 6 | 7 | __metaclass__ = type 8 | from ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell \ 9 | import utils 10 | from mock.mock import MagicMock 11 | 12 | utils.get_logger = MagicMock() 13 | utils.get_powerflex_gateway_host_connection = MagicMock() 14 | utils.PowerFlexClient = MagicMock() 15 | 16 | from ansible.module_utils import basic 17 | basic.AnsibleModule = MagicMock() 18 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/libraries/powerflex_unit_base.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | from __future__ import (absolute_import, division, print_function) 6 | 7 | __metaclass__ = type 8 | import pytest 9 | # pylint: disable=unused-import 10 | from ansible_collections.dellemc.powerflex.tests.unit.plugins.module_utils.libraries import initial_mock 11 | from mock.mock import MagicMock 12 | from ansible_collections.dellemc.powerflex.tests.unit.plugins.module_utils.libraries. \ 13 | fail_json import FailJsonException, fail_json 14 | 15 | 16 | class PowerFlexUnitBase: 17 | 18 | '''Powerflex Unit Test Base Class''' 19 | 20 | @pytest.fixture 21 | def powerflex_module_mock(self, mocker, module_object): 22 | powerflex_module_mock = module_object() 23 | powerflex_module_mock.module = MagicMock() 24 | powerflex_module_mock.module.fail_json = fail_json 25 | powerflex_module_mock.module.check_mode = False 26 | return powerflex_module_mock 27 | 28 | def capture_fail_json_call(self, error_msg, module_mock, module_handler=None, invoke_perform_module=False): 29 | try: 30 | if not invoke_perform_module: 31 | module_handler().handle(module_mock, module_mock.module.params) 32 | else: 33 | module_mock.perform_module_operation() 34 | except FailJsonException as fj_object: 35 | if error_msg not in fj_object.message: 36 | raise AssertionError(fj_object.message) 37 | 38 | def set_module_params(self, module_mock, get_module_args, params): 39 | get_module_args.update(params) 40 | module_mock.module.params = get_module_args 41 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_api_exception.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2022, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """Mock ApiException for Dell Technologies (Dell) PowerFlex Test modules""" 6 | 7 | from __future__ import (absolute_import, division, print_function) 8 | 9 | __metaclass__ = type 10 | 11 | 12 | class MockApiException(Exception): 13 | body = "PyPowerFlex Error message" 14 | status = "500" 15 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_fail_json.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2023, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """Mock fail json for PowerFlex Test modules""" 6 | 7 | from __future__ import (absolute_import, division, print_function) 8 | 9 | __metaclass__ = type 10 | 11 | 12 | class FailJsonException(Exception): 13 | def __init__(self, *args): 14 | if args: 15 | self.message = args[0] 16 | else: 17 | self.message = None 18 | 19 | 20 | def fail_json(msg): 21 | raise FailJsonException(msg) 22 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_fault_set_api.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """ 6 | Mock Api response for Unit tests of fault set module on Dell Technologies (Dell) PowerFlex 7 | """ 8 | 9 | from __future__ import (absolute_import, division, print_function) 10 | 11 | __metaclass__ = type 12 | 13 | 14 | class MockFaultSetApi: 15 | FAULT_SET_COMMON_ARGS = { 16 | "hostname": "**.***.**.***", 17 | "protection_domain_name": None, 18 | "protection_domain_id": None, 19 | "fault_set_name": None, 20 | "fault_set_id": None, 21 | "fault_set_new_name": None, 22 | "state": None 23 | } 24 | 25 | FAULT_SET_GET_LIST = [ 26 | { 27 | "protectionDomainId": "7bd6457000000000", 28 | "name": "fault_set_name_1", 29 | "id": "fault_set_id_1", 30 | "links": [] 31 | } 32 | ] 33 | 34 | PROTECTION_DOMAIN = { 35 | "protectiondomain": [ 36 | { 37 | "id": "7bd6457000000000", 38 | "name": "test_pd_1", 39 | "protectionDomainState": "Active", 40 | "overallIoNetworkThrottlingInKbps": 20480, 41 | "rebalanceNetworkThrottlingInKbps": 10240, 42 | "rebuildNetworkThrottlingInKbps": 10240, 43 | "vtreeMigrationNetworkThrottlingInKbps": 10240, 44 | "rfcacheEnabled": "false", 45 | "rfcacheMaxIoSizeKb": 128, 46 | "rfcacheOpertionalMode": "None", 47 | "rfcachePageSizeKb": 64, 48 | "storagePools": [ 49 | { 50 | "id": "8d1cba1700000000", 51 | "name": "pool1" 52 | } 53 | ] 54 | } 55 | ] 56 | } 57 | 58 | RESPONSE_EXEC_DICT = { 59 | 'delete_fault_set_exception': "Removing Fault Set fault_set_id_1 failed with error", 60 | 'rename_fault_set_exception': "Failed to rename the fault set instance", 61 | 'create_fault_set_exception': "Create fault set test_fs_1 operation failed", 62 | 'get_fault_set_exception': "Failed to get the Fault Set", 63 | 'create_fault_set_wo_pd_exception': "Provide protection_domain_id/protection_domain_name with fault_set_name.", 64 | 'create_fault_set_empty_name_exception': "Provide valid value for name for the creation/modification of the fault set." 65 | } 66 | 67 | @staticmethod 68 | def get_fault_set_exception_response(response_type): 69 | return MockFaultSetApi.RESPONSE_EXEC_DICT.get(response_type, "") 70 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_nvme_host_api.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """ 6 | Mock Api response for Unit tests of NVMe host module on Dell Technologies PowerFlex 7 | """ 8 | 9 | from __future__ import absolute_import, division, print_function 10 | 11 | __metaclass__ = type 12 | 13 | 14 | class MockNVMeHostApi: 15 | MODULE_UTILS_PATH = ( 16 | "ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell.utils" 17 | ) 18 | COMMON_ARGS = { 19 | "nqn": None, 20 | "max_num_paths": None, 21 | "max_num_sys_ports": None, 22 | "nvme_host_name": None, 23 | "nvme_host_new_name": None, 24 | "state": None, 25 | } 26 | 27 | @staticmethod 28 | def create_nvme_host(): 29 | return {"id": "da8f60fd00010000"} 30 | 31 | NVME_HOST_DETAILS = [ 32 | { 33 | "nqn": "test_nqn", 34 | "maxNumPaths": 3, 35 | "maxNumSysPorts": 3, 36 | "name": "nvme_host_test", 37 | "hostType": "NVMeHost", 38 | "id": "da8f60fd00010000", 39 | } 40 | ] 41 | 42 | NVME_HOST_NO_NAME_DETAILS = [ 43 | { 44 | "nqn": "test_nqn", 45 | "maxNumPaths": 3, 46 | "maxNumSysPorts": 3, 47 | "hostType": "NVMeHost", 48 | "name": None, 49 | "id": "da8f60fd00010000", 50 | } 51 | ] 52 | 53 | RESPONSE_EXEC_DICT = { 54 | "modify_host": "Failed to modify NVMe host", 55 | "create_host": "Create NVMe host operation failed", 56 | "delete_host": "Failed to remove NVMe host", 57 | "get_host": "Failed to get NVMe host", 58 | "invalid_params": "Provide valid nqn", 59 | "modify_host_version_check": "not supported in PowerFlex versions earlier than 4.6" 60 | } 61 | 62 | INFO_ARRAY_DETAILS = [{ 63 | 'mdmCluster': { 64 | 'master': { 65 | 'versionInfo': 'R4_6.0.0' 66 | } 67 | } 68 | }] 69 | 70 | INFO_ARRAY_DETAILS_4_5 = [{ 71 | 'mdmCluster': { 72 | 'master': { 73 | 'versionInfo': 'R4_5.0.0' 74 | } 75 | } 76 | }] 77 | 78 | @staticmethod 79 | def get_exception_response(response_type): 80 | return MockNVMeHostApi.RESPONSE_EXEC_DICT.get(response_type, "") 81 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_replication_pair_api.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """ 6 | Mock Api response for Unit tests of replication pair module on Dell Technologies (Dell) PowerFlex 7 | """ 8 | 9 | from __future__ import (absolute_import, division, print_function) 10 | 11 | __metaclass__ = type 12 | 13 | 14 | class MockReplicationPairApi: 15 | REPLICATION_PAIR_COMMON_ARGS = { 16 | "hostname": "**.***.**.***", 17 | "rcg_name": None, "rcg_id": None, 18 | "pair_id": None, "pair_name": None, 19 | "pairs": [{"source_volume_name": None, "source_volume_id": None, "target_volume_name": None, 20 | "target_volume_id": None}], "pause": None, 21 | "remote_peer": {"hostname": None, "username": None, "password": None, 22 | "verifycert": None, "port": None}, "state": None 23 | } 24 | PAIR_ID = "23aa0bc900000001" 25 | FAIL_MSG = " failed with error" 26 | 27 | @staticmethod 28 | def get_pair_details(copy_state="Done"): 29 | return [{"copyType": "OnlineCopy", 30 | "id": "23aa0bc900000001", 31 | "initialCopyPriority": -1, 32 | "initialCopyState": copy_state, 33 | "lifetimeState": "Normal", 34 | "localActivityState": "RplEnabled", 35 | "localVolumeId": "e2bc1fab00000008", 36 | "name": None, 37 | "peerSystemName": None, 38 | "remoteActivityState": "RplEnabled", 39 | "remoteCapacityInMB": 8192, 40 | "remoteId": "a058446700000001", 41 | "remoteVolumeId": "1cda7af20000000d", 42 | "remoteVolumeName": "vol", 43 | "replicationConsistencyGroupId": "e2ce036b00000002", 44 | "userRequestedPauseTransmitInitCopy": False, 45 | "links": []}] 46 | 47 | @staticmethod 48 | def get_volume_details(): 49 | return [{"id": "0001", 50 | "name": "volume1"}] 51 | 52 | @staticmethod 53 | def get_error_message(response_type): 54 | error_msg = {"get_rcg_exception": "Failed to get the replication consistency group 12 with error ", 55 | "get_rcg_id_name_error": "Specify either rcg_id or rcg_name to create replication pair", 56 | "get_pause_error": "Specify either pair_id or pair_name to perform pause or resume of initial copy", 57 | "get_pause_or_resume_error": "Specify a valid pair_name or pair_id to perform pause or resume", 58 | "get_volume_exception": "Failed to retrieve volume"} 59 | return error_msg[response_type] 60 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_sdc_api.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2024, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """ 6 | Mock Api response for Unit tests of SDC module on Dell Technologies (Dell) PowerFlex 7 | """ 8 | 9 | from __future__ import (absolute_import, division, print_function) 10 | 11 | __metaclass__ = type 12 | 13 | 14 | class MockSdcApi: 15 | MODULE_UTILS_PATH = "ansible_collections.dellemc.powerflex.plugins.module_utils.storage.dell.utils" 16 | COMMON_ARGS = { 17 | "sdc_id": None, 18 | "sdc_ip": None, 19 | "sdc_name": None, "sdc_new_name": None, 20 | "performance_profile": None, 21 | "state": None 22 | } 23 | SDC_ID = "07335d3d00000006" 24 | 25 | @staticmethod 26 | def get_sdc_details(): 27 | return [{ 28 | "id": "07335d3d00000006", 29 | "installedSoftwareVersionInfo": "R3_6.0.0", 30 | "kernelBuildNumber": None, 31 | "kernelVersion": "3.10.0", 32 | "mapped_volumes": [], 33 | "mdmConnectionState": "Disconnected", 34 | "memoryAllocationFailure": None, 35 | "name": "LGLAP203", 36 | "osType": "Linux", 37 | "peerMdmId": None, 38 | "perfProfile": "HighPerformance", 39 | "sdcApproved": True, 40 | "sdcApprovedIps": None, 41 | "sdcGuid": "F8ECB844-23B8-4629-92BB-B6E49A1744CB", 42 | "sdcIp": "N/A", 43 | "sdcIps": None, 44 | "sdcType": "AppSdc", 45 | "sdrId": None, 46 | "socketAllocationFailure": None, 47 | "softwareVersionInfo": "R3_6.0.0", 48 | "systemId": "4a54a8ba6df0690f", 49 | "versionInfo": "R3_6.0.0" 50 | }] 51 | 52 | RESPONSE_EXEC_DICT = { 53 | 'get_sdc_details_empty_sdc_id_exception': "Please provide valid sdc_id", 54 | 'get_sdc_details_with_exception': "Failed to get the SDC 07335d3d00000006 with error", 55 | 'get_sdc_details_mapped_volumes_with_exception': "Failed to get the volumes mapped to SDC", 56 | 'modify_sdc_throws_exception': "Modifying performance profile of SDC 07335d3d00000006 failed with error", 57 | 'rename_sdc_empty_new_name_exception': "Provide valid SDC name to rename to.", 58 | 'rename_sdc_throws_exception': "Failed to rename SDC", 59 | 'remove_sdc_throws_exception': "Removing SDC 07335d3d00000006 failed with error" 60 | } 61 | 62 | @staticmethod 63 | def get_sdc_exception_response(response_type): 64 | return MockSdcApi.RESPONSE_EXEC_DICT.get(response_type, "") 65 | -------------------------------------------------------------------------------- /tests/unit/plugins/module_utils/mock_sdk_response.py: -------------------------------------------------------------------------------- 1 | # Copyright: (c) 2022, Dell Technologies 2 | 3 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) 4 | 5 | """Mock SDKResponse for Unit tests for Dell Technologies (Dell) PowerFlex modules""" 6 | 7 | from __future__ import (absolute_import, division, print_function) 8 | 9 | __metaclass__ = type 10 | 11 | 12 | class MockSDKResponse: 13 | def __init__(self, data=None, status_code=200): 14 | self.data = data 15 | self.status_code = status_code 16 | -------------------------------------------------------------------------------- /tests/unit/plugins/modules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dell/ansible-powerflex/54fa6ee63f738fe0c23d9555611a7b91271207f3/tests/unit/plugins/modules/__init__.py -------------------------------------------------------------------------------- /tests/unit/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-xdist 3 | pytest-mock 4 | pytest-cov 5 | pytest-forked 6 | coverage 7 | mock 8 | --------------------------------------------------------------------------------