diff --git a/.ansible-lint b/.ansible-lint index 6e0657d..e40e46d 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -24,3 +24,7 @@ exclude_paths: - roles/powerflex_tb/vars/ - roles/powerflex_webui/defaults/ - roles/powerflex_webui/vars/ + - roles/powerflex_activemq/defaults/ + - roles/powerflex_activemq/vars/ + - roles/powerflex_config/defaults/ + - roles/powerflex_config/vars/ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f59815d..f783d12 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,8 +12,7 @@ # Jennifer John (Jennifer-John) # Meenakshi Dembi (meenakshidembi691) # Pavan Mudunuri (Pavan-Mudunuri) -# Previnkumar G (Previnkumar-G) # Trisha Datta (trisha-dell) # for all files: -* @kuttattz @Bhavneet-Sharma @Jennifer-John @meenakshidembi691 @Pavan-Mudunuri @Previnkumar-G @trisha-dell +* @kuttattz @Bhavneet-Sharma @Jennifer-John @meenakshidembi691 @Pavan-Mudunuri @trisha-dell diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7afcef0..ed0edb1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,16 @@ Dellemc.PowerFlex Change Logs .. contents:: Topics +v2.0.0 +====== + +Minor Changes +------------- + +- Added support for PowerFlex Denver version(4.5.x) +- Added support for SDC installation on ESXi, Rocky Linux and Windows OS. +- Added Ansible role to support installation and uninstallation of Active MQ. +- Added Ansible role to support creation and deletion of protection domain, storage pool and fault set. v1.9.0 ====== diff --git a/README.md b/README.md index b7891d9..db29b4e 100644 --- a/README.md +++ b/README.md @@ -6,29 +6,29 @@ The capabilities of the Ansible modules are managing SDCs, volumes, snapshots, s ## Table of contents -* [Code of conduct](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/CODE_OF_CONDUCT.md) -* [Maintainer guide](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/MAINTAINER_GUIDE.md) -* [Committer guide](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/COMMITTER_GUIDE.md) -* [Contributing guide](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/CONTRIBUTING.md) -* [Branching strategy](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/BRANCHING.md) -* [List of adopters](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/ADOPTERS.md) -* [Maintainers](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/MAINTAINERS.md) -* [Support](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/SUPPORT.md) +* [Code of conduct](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/CODE_OF_CONDUCT.md) +* [Maintainer guide](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/MAINTAINER_GUIDE.md) +* [Committer guide](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/COMMITTER_GUIDE.md) +* [Contributing guide](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/CONTRIBUTING.md) +* [Branching strategy](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/BRANCHING.md) +* [List of adopters](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/ADOPTERS.md) +* [Maintainers](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/MAINTAINERS.md) +* [Support](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/SUPPORT.md) * [License](#license) -* [Security](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/SECURITY.md) +* [Security](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/SECURITY.md) * [Prerequisites](#prerequisites) * [List of Ansible modules for Dell PowerFlex](#list-of-ansible-modules-for-dell-powerflex) * [Installation and execution of Ansible modules for Dell PowerFlex](#installation-and-execution-of-ansible-modules-for-dell-powerflex) * [Releasing, Maintenance and Deprecation](#releasing-maintenance-and-deprecation) ## License -The Ansible collection for PowerFlex is released and licensed under the GPL-3.0 license. See [LICENSE](https://github.com/dell/ansible-powerflex/blob/1.9.0/LICENSE) for the full terms. Ansible modules and modules utilities that are part of the Ansible collection for PowerFlex are released and licensed under the Apache 2.0 license. See [MODULE-LICENSE](https://github.com/dell/ansible-powerflex/blob/1.9.0/MODULE-LICENSE) for the full terms. +The Ansible collection for PowerFlex is released and licensed under the GPL-3.0 license. See [LICENSE](https://github.com/dell/ansible-powerflex/blob/2.0.0/LICENSE) for the full terms. Ansible modules and modules utilities that are part of the Ansible collection for PowerFlex are released and licensed under the Apache 2.0 license. See [MODULE-LICENSE](https://github.com/dell/ansible-powerflex/blob/2.0.0/MODULE-LICENSE) for the full terms. ## Prerequisites | **Ansible Modules** | **PowerFlex/VxFlex OS Version** | **SDK version** | **Python version** | **Ansible** | |---------------------|-----------------------|-------|--------------------|--------------------------| -| v1.9.0 |3.5
3.6
4.0 | 1.9.0 | 3.9.x
3.10.x
3.11.x | 2.13
2.14
2.15 | +| v2.0.0 |3.6
4.0
4.5 | 2.0.0 | 3.9.x
3.10.x
3.11.x | 2.13
2.14
2.15 | * Please follow PyPowerFlex installation instructions on [PyPowerFlex Documentation](https://github.com/dell/python-powerflex) @@ -36,21 +36,21 @@ The Ansible collection for PowerFlex is released and licensed under the GPL-3.0 The modules are written in such a way that all requests are idempotent and hence fault-tolerant. It essentially means that the result of a successfully performed request is independent of the number of times it is executed. ## List of Ansible modules for Dell PowerFlex - * [Info module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/info.rst) - * [Snapshot module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/snapshot.rst) - * [SDC module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/sdc.rst) - * [Storage pool module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/storagepool.rst) - * [Volume module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/volume.rst) - * [SDS module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/sds.rst) - * [Device Module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/device.rst) - * [Protection Domain Module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/protection_domain.rst) - * [MDM Cluster Module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/mdm_cluster.rst) - * [Replication Consistency Grop Module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/replication_consistency_group.rst) - * [Replication Pair Module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/replication_pair.rst) - * [Snapshot Policy Module](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/modules/snapshot_policy.rst) + * [Info module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/info.rst) + * [Snapshot module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/snapshot.rst) + * [SDC module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/sdc.rst) + * [Storage pool module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/storagepool.rst) + * [Volume module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/volume.rst) + * [SDS module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/sds.rst) + * [Device Module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/device.rst) + * [Protection Domain Module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/protection_domain.rst) + * [MDM Cluster Module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/mdm_cluster.rst) + * [Replication Consistency Grop Module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/replication_consistency_group.rst) + * [Replication Pair Module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/replication_pair.rst) + * [Snapshot Policy Module](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/modules/snapshot_policy.rst) ## Installation and execution of Ansible modules for Dell PowerFlex -The installation and execution steps of Ansible modules for Dell PowerFlex can be found [here](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/INSTALLATION.md). +The installation and execution steps of Ansible modules for Dell PowerFlex can be found [here](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/INSTALLATION.md). ## Releasing, Maintenance and Deprecation @@ -58,6 +58,6 @@ Ansible Modules for Dell Technnologies PowerFlex follows [Semantic Versioning](h New version will be release regularly if significant changes (bug fix or new feature) are made in the collection. -Released code versions are located on "release" branches with names of the form "release-x.y.z" where x.y.z corresponds to the version number. More information on branching strategy followed can be found [here](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/BRANCHING.md). +Released code versions are located on "release" branches with names of the form "release-x.y.z" where x.y.z corresponds to the version number. More information on branching strategy followed can be found [here](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/BRANCHING.md). Ansible Modules for Dell Technologies PowerFlex deprecation cycle is aligned with that of [Ansible](https://docs.ansible.com/ansible/latest/dev_guide/module_lifecycle.html). \ No newline at end of file diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 0bb11ab..8aaf8b4 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -120,3 +120,12 @@ releases: - Added Ansible role to support installation and uninstallation of SDR. - Added Ansible role to support installation and uninstallation of Web UI. release_date: '2023-09-29' + 2.0.0: + changes: + minor_changes: + - Added support for PowerFlex Denver version(4.5.x) + - Added support for SDC installation on ESXi, Rocky Linux and Windows OS. + - Added Ansible role to support installation and uninstallation of Active MQ. + - Added Ansible role to support creation and deletion of protection domain, + storage pool and fault set. + release_date: '2023-10-31' diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 1250403..8c86bf6 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -10,7 +10,7 @@ You may obtain a copy of the License at # How to contribute -Become one of the contributors to this project! We thrive to build a welcoming and open community for anyone who wants to use the project or contribute to it. There are just a few small guidelines you need to follow. To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](https://github.com/dell/ansible-powerflex/blob/1.9.0/CODE_OF_CONDUCT.md). +Become one of the contributors to this project! We thrive to build a welcoming and open community for anyone who wants to use the project or contribute to it. There are just a few small guidelines you need to follow. To help us create a safe and positive community experience for all, we require all participants to adhere to the [Code of Conduct](https://github.com/dell/ansible-powerflex/blob/2.0.0/CODE_OF_CONDUCT.md). ## Table of contents @@ -76,7 +76,7 @@ Triage helps ensure that issues resolve quickly by: If you don't have the knowledge or time to code, consider helping with _issue triage_. The Ansible modules for Dell PowerFlex community will thank you for saving them time by spending some of yours. -Read more about the ways you can [Triage issues](https://github.com/dell/ansible-powerflex/blob/1.9.0/ISSUE_TRIAGE.md). +Read more about the ways you can [Triage issues](https://github.com/dell/ansible-powerflex/blob/2.0.0/ISSUE_TRIAGE.md). ## Your first contribution @@ -89,7 +89,7 @@ When you're ready to contribute, it's time to create a pull request. ## Branching -* [Branching Strategy for Ansible modules for Dell PowerFlex](https://github.com/dell/ansible-powerflex/blob/1.9.0/BRANCHING.md) +* [Branching Strategy for Ansible modules for Dell PowerFlex](https://github.com/dell/ansible-powerflex/blob/2.0.0/BRANCHING.md) ## Signing your commits @@ -144,7 +144,7 @@ Make sure that the title for your pull request uses the same format as the subje ### Quality gates for pull requests -GitHub Actions are used to enforce quality gates when a pull request is created or when any commit is made to the pull request. These GitHub Actions enforce our minimum code quality requirement for any code that get checked into the repository. If any of the quality gates fail, it is expected that the contributor will look into the check log, understand the problem and resolve the issue. If help is needed, please feel free to reach out the maintainers of the project for [support](https://github.com/dell/ansible-powerflex/blob/1.9.0/SUPPORT.md). +GitHub Actions are used to enforce quality gates when a pull request is created or when any commit is made to the pull request. These GitHub Actions enforce our minimum code quality requirement for any code that get checked into the repository. If any of the quality gates fail, it is expected that the contributor will look into the check log, understand the problem and resolve the issue. If help is needed, please feel free to reach out the maintainers of the project for [support](https://github.com/dell/ansible-powerflex/blob/2.0.0/SUPPORT.md). #### Code sanitization diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 6865526..3e0689e 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -41,7 +41,7 @@ You may obtain a copy of the License at * Download the latest tar build from any of the available distribution channel [Ansible Galaxy](https://galaxy.ansible.com/dellemc/powerflex) /[Automation Hub](https://console.redhat.com/ansible/automation-hub/repo/published/dellemc/powerflex) and use this command to install the collection anywhere in your system: - ansible-galaxy collection install dellemc-powerflex-1.9.0.tar.gz -p + ansible-galaxy collection install dellemc-powerflex-2.0.0.tar.gz -p * Set the environment variable: @@ -68,7 +68,7 @@ You may obtain a copy of the License at ## Ansible modules execution -The Ansible server must be configured with Python library for PowerFlex to run the Ansible playbooks. The [Documents](https://github.com/dell/ansible-powerflex/blob/1.9.0/docs/) provide information on different Ansible modules along with their functions and syntax. The parameters table in the Product Guide provides information on various parameters which needs to be configured before running the modules. +The Ansible server must be configured with Python library for PowerFlex to run the Ansible playbooks. The [Documents](https://github.com/dell/ansible-powerflex/blob/2.0.0/docs/) provide information on different Ansible modules along with their functions and syntax. The parameters table in the Product Guide provides information on various parameters which needs to be configured before running the modules. ## SSL certificate validation diff --git a/docs/ISSUE_TRIAGE.md b/docs/ISSUE_TRIAGE.md index a17b0ca..0e06980 100644 --- a/docs/ISSUE_TRIAGE.md +++ b/docs/ISSUE_TRIAGE.md @@ -43,7 +43,7 @@ Should explain what happened, what was expected and how to reproduce it together - Ansible Version: [e.g. 2.14] - Python Version [e.g. 3.11] - - Ansible modules for Dell PowerFlex Version: [e.g. 1.9.0] + - Ansible modules for Dell PowerFlex Version: [e.g. 2.0.0] - PowerFlex SDK version: [e.g. PyPowerFlex 1.8.0] - Any other additional information... diff --git a/docs/MAINTAINER_GUIDE.md b/docs/MAINTAINER_GUIDE.md index f2d6e8e..c0d6117 100644 --- a/docs/MAINTAINER_GUIDE.md +++ b/docs/MAINTAINER_GUIDE.md @@ -27,7 +27,7 @@ If a candidate is approved, a Maintainer contacts the candidate to invite them t ## Maintainer policies * Lead by example -* Follow the [Code of Conduct](https://github.com/dell/ansible-powerflex/blob/1.9.0/CODE_OF_CONDUCT.md) and the guidelines in the [Contributing](https://github.com/dell/ansible-powerflex/blob/1.9.0/CONTRIBUTING.md) and [Committer](https://github.com/dell/ansible-powerflex/blob/1.9.0/COMMITTER_GUIDE.md) guides +* Follow the [Code of Conduct](https://github.com/dell/ansible-powerflex/blob/2.0.0/CODE_OF_CONDUCT.md) and the guidelines in the [Contributing](https://github.com/dell/ansible-powerflex/blob/2.0.0/CONTRIBUTING.md) and [Committer](https://github.com/dell/ansible-powerflex/blob/2.0.0/COMMITTER_GUIDE.md) guides * Promote a friendly and collaborative environment within our community * Be actively engaged in discussions, answering questions, updating defects, and reviewing pull requests * Criticize code, not people. Ideally, tell the contributor a better way to do what they need. diff --git a/docs/Release Notes.md b/docs/Release Notes.md index 0e63a5f..f8c354c 100644 --- a/docs/Release Notes.md +++ b/docs/Release Notes.md @@ -1,6 +1,6 @@ **Ansible Modules for Dell Technologies PowerFlex** ========================================= -### Release notes 1.9.0 +### Release notes 2.0.0 > © 2023 Dell Inc. or its subsidiaries. All rights reserved. Dell > and other trademarks are trademarks of Dell Inc. or its @@ -28,7 +28,7 @@ Table 1. Revision history | Revision | Date | Description | |----------|-----------------|-------------------------------------------------------------| -| 01 | September 2023 | Current release of Ansible Modules for Dell PowerFlex 1.9.0 | +| 01 | October 2023 | Current release of Ansible Modules for Dell PowerFlex 2.0.0 | Product description ------------------- @@ -44,9 +44,11 @@ each of the entities. New features and enhancements ----------------------------- Along with the previous release deliverables, this release supports following features - -- Added Ansible role to support installation and uninstallation of Gateway. -- Added Ansible role to support installation and uninstallation of SDR. -- Added Ansible role to support installation and uninstallation of Web UI. +- Added support for PowerFlex Denver version(4.5.x) +- Added support for SDC installation on ESXi, Rocky Linux and Windows OS. +- Added Ansible role to support installation and uninstallation of Active MQ. +- Added Ansible role to support creation and deletion of protection domain, + storage pool and fault set. Known issues ------------ @@ -60,11 +62,11 @@ Limitations Distribution ------------ The software package is available for download from the [Ansible Modules -for PowerFlex GitHub](https://github.com/dell/ansible-powerflex/tree/1.9.0) page. +for PowerFlex GitHub](https://github.com/dell/ansible-powerflex/tree/2.0.0) page. Documentation ------------- -The documentation is available on [Ansible Modules for PowerFlex GitHub](https://github.com/dell/ansible-powerflex/tree/1.9.0/docs) +The documentation is available on [Ansible Modules for PowerFlex GitHub](https://github.com/dell/ansible-powerflex/tree/2.0.0/docs) page. It includes the following: - README diff --git a/docs/SECURITY.md b/docs/SECURITY.md index 666ddab..223a341 100644 --- a/docs/SECURITY.md +++ b/docs/SECURITY.md @@ -12,7 +12,7 @@ You may obtain a copy of the License at The Ansible modules for Dell PowerFlex repository are inspected for security vulnerabilities via blackduck scans and static code analysis. -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/1.9.0/docs/CONTRIBUTING.md#Pull-requests) for more information. +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/2.0.0/docs/CONTRIBUTING.md#Pull-requests) for more information. ## Reporting a vulnerability diff --git a/galaxy.yml b/galaxy.yml index 3cb134e..fc87c83 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -14,7 +14,7 @@ name: powerflex # The version of the collection. # Must be compatible with semantic versioning -version: 1.9.0 +version: 2.0.0 # The path to the Markdown (.md) readme file. # This path is relative to the root of the collection. @@ -60,13 +60,13 @@ tags: [storage] dependencies: {} # The URL of the originating SCM repository -repository: https://github.com/dell/ansible-powerflex/tree/1.9.0 +repository: https://github.com/dell/ansible-powerflex/tree/2.0.0 # The URL to any online docs -documentation: https://github.com/dell/ansible-powerflex/tree/1.9.0/docs +documentation: https://github.com/dell/ansible-powerflex/tree/2.0.0/docs # The URL to the homepage of the collection/project -homepage: https://github.com/dell/ansible-powerflex/tree/1.9.0 +homepage: https://github.com/dell/ansible-powerflex/tree/2.0.0 # The URL to the collection issue tracker issues: https://www.dell.com/community/Automation/bd-p/Automation diff --git a/playbooks/modules/mdm_cluster.yml b/playbooks/modules/mdm_cluster.yml index d667d80..bdc44bd 100644 --- a/playbooks/modules/mdm_cluster.yml +++ b/playbooks/modules/mdm_cluster.yml @@ -43,17 +43,6 @@ mdm_new_name: "node_renamed" state: "present" - - name: Rename MDM cluster - Idempotency - dellemc.powerflex.mdm_cluster: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - port: "{{ host_port }}" - mdm_id: "1c13c3847c971201" - mdm_new_name: "node_renamed" - state: "present" - - name: Remove standby MDM dellemc.powerflex.mdm_cluster: hostname: "{{ hostname }}" @@ -157,19 +146,3 @@ mdm_type: "TieBreaker" mdm_state: "absent-in-cluster" state: "present" - - - name: Switch cluster mode to ThreeNodes - Idempotency - dellemc.powerflex.mdm_cluster: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - port: "{{ host_port }}" - cluster_mode: "ThreeNodes" - mdm: - - mdm_name: "mdm_manger_node" - mdm_type: "Secondary" - - mdm_name: "mdm_tiebreaker_node" - mdm_type: "TieBreaker" - mdm_state: "absent-in-cluster" - state: "present" diff --git a/playbooks/modules/protection_domain.yml b/playbooks/modules/protection_domain.yml index 68d97c7..5911a90 100644 --- a/playbooks/modules/protection_domain.yml +++ b/playbooks/modules/protection_domain.yml @@ -31,25 +31,6 @@ pass_through_mode: "Write" state: "present" - - name: Create Protection Domain - Idempotency - dellemc.powerflex.protection_domain: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - port: "{{ host_port }}" - protection_domain_name: "domain_1" - network_limits: - rebuild_limit: 10240 - rebalance_limit: 10240 - vtree_migration_limit: 10240 - overall_limit: 20480 - bandwidth_unit: "KBps" - rf_cache_limits: - page_size: 32 - pass_through_mode: "Write" - state: "present" - - name: Get Protection Domain dellemc.powerflex.protection_domain: hostname: "{{ hostname }}" diff --git a/playbooks/modules/replication_pair.yml b/playbooks/modules/replication_pair.yml index 046bbb6..b243138 100644 --- a/playbooks/modules/replication_pair.yml +++ b/playbooks/modules/replication_pair.yml @@ -41,25 +41,6 @@ password: "{{ password }}" validate_certs: "{{ validate_certs }}" - - name: Add replication pair to RCG - Idempotency - register: result - dellemc.powerflex.replication_pair: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - pairs: - - source_volume_name: "ans_test_vol" - target_volume_name: "ans_env8_vol" - copy_type: "OnlineCopy" - name: "test_pair" - rcg_name: "test_rcg" - remote_peer: - hostname: "{{ remote_hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - - name: Pause Replication pair register: result dellemc.powerflex.replication_pair: @@ -70,16 +51,6 @@ pair_name: "test_pair" pause: true - - name: Pause Replication pair - Idempotency - register: result - dellemc.powerflex.replication_pair: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - pair_name: "test_pair" - pause: true - - name: Resume Replication pair register: result dellemc.powerflex.replication_pair: @@ -90,16 +61,6 @@ pair_name: "test_pair" pause: false - - name: Resume Replication pair - idempotency - register: result - dellemc.powerflex.replication_pair: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - pair_name: "test_pair" - pause: false - - name: Delete replication pair register: result dellemc.powerflex.replication_pair: diff --git a/playbooks/modules/snapshot.yml b/playbooks/modules/snapshot.yml index c70db30..3397553 100644 --- a/playbooks/modules/snapshot.yml +++ b/playbooks/modules/snapshot.yml @@ -21,16 +21,6 @@ vol_name: "ansible_volume" state: "present" - - name: Create snapshot idempotency - dellemc.powerflex.snapshot: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_name: "ansible_snapshot_1" - vol_name: "ansible_volume" - state: "present" - - name: Set snapshot id ansible.builtin.set_fact: snapshot_id: "{{ result.snapshot_details.id }}" @@ -65,16 +55,6 @@ desired_retention: 4 state: "present" - - name: Modify the retention - idempotency - dellemc.powerflex.snapshot: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_name: "ansible_snapshot_2" - desired_retention: 4 - state: "present" - - name: Map snapshot to SDC dellemc.powerflex.snapshot: hostname: "{{ hostname }}" @@ -89,20 +69,6 @@ sdc_state: "mapped" state: "present" - - name: Map snapshot to SDC - Idempotency - dellemc.powerflex.snapshot: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_id: "{{ snapshot_id }}" - sdc: - - sdc_ip: '**.**.**.**' - - sdc_id: "663ac0d200000001" - allow_multiple_mappings: true - sdc_state: "mapped" - state: "present" - - name: Modify the attributes of SDC mapped to snapshot dellemc.powerflex.snapshot: hostname: "{{ hostname }}" @@ -120,23 +86,6 @@ sdc_state: "mapped" state: "present" - - name: Modify the attributes of SDC mapped to snapshot - Idempotency - dellemc.powerflex.snapshot: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_id: "{{ snapshot_id }}" - sdc: - - sdc_ip: '**.**.**.**' - iops_limit: 11 - bandwidth_limit: 4096 - - sdc_id: "663ac0d200000001" - iops_limit: 20 - bandwidth_limit: 2048 - sdc_state: "mapped" - state: "present" - - name: Extend the size of snapshot dellemc.powerflex.snapshot: hostname: "{{ hostname }}" @@ -179,13 +128,3 @@ snapshot_id: "{{ snapshot_id }}" remove_mode: "ONLY_ME" state: "absent" - - - name: Delete snapshot idempotency - dellemc.powerflex.snapshot: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_id: "{{ snapshot_id }}" - remove_mode: "ONLY_ME" - state: "absent" diff --git a/playbooks/modules/snapshot_policy.yml b/playbooks/modules/snapshot_policy.yml index 09f4bdd..fd83a2a 100644 --- a/playbooks/modules/snapshot_policy.yml +++ b/playbooks/modules/snapshot_policy.yml @@ -48,22 +48,6 @@ - 20 state: "present" - - name: Create a snapshot policy - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name }}" - access_mode: "READ_WRITE" - secure_snapshots: false - auto_snapshot_creation_cadence: - time: 1 - unit: "Hour" - num_of_retained_snapshots_per_level: - - 20 - state: "present" - - name: Get snapshot policy details using name dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -108,19 +92,6 @@ num_of_retained_snapshots_per_level: - 40 - - name: Modify a snapshot policy - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name }}" - auto_snapshot_creation_cadence: - time: 2 - unit: "Hour" - num_of_retained_snapshots_per_level: - - 40 - - name: Rename a snapshot policy dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -130,15 +101,6 @@ snapshot_policy_name: "{{ snapshot_policy_name }}" new_name: "{{ snapshot_policy_name_new }}" - - name: Rename a snapshot policy - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name_new }}" - new_name: "{{ snapshot_policy_name_new }}" - - name: Add source volume - check mode dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -164,18 +126,6 @@ - name: "{{ source_volume_name2 }}" state: "present" - - name: Add source volume Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name_new }}" - source_volume: - - name: "{{ source_volume_name1 }}" - - name: "{{ source_volume_name2 }}" - state: "present" - - name: Remove source volume - check mode dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -207,21 +157,6 @@ auto_snap_removal_action: 'Remove' state: "absent" - - name: Remove source volume - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name_new }}" - source_volume: - - name: "{{ source_volume_name1 }}" - auto_snap_removal_action: 'Remove' - state: "absent" - - name: "{{ source_volume_name2 }}" - auto_snap_removal_action: 'Remove' - state: "absent" - - name: Pause snapshot policy - check mode dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -241,15 +176,6 @@ snapshot_policy_name: "{{ snapshot_policy_name_new }}" pause: true - - name: Pause snapshot policy - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name_new }}" - pause: true - - name: Resume snapshot policy - check mode dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -269,15 +195,6 @@ snapshot_policy_name: "{{ snapshot_policy_name_new }}" pause: false - - name: Resume snapshot policy - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_name: "{{ snapshot_policy_name_new }}" - pause: false - - name: Delete snapshot policy - check mode dellemc.powerflex.snapshot_policy: hostname: "{{ hostname }}" @@ -296,12 +213,3 @@ validate_certs: "{{ validate_certs }}" snapshot_policy_name: "{{ snapshot_policy_name_new }}" state: "absent" - - - name: Delete snapshot policy - Idempotency - dellemc.powerflex.snapshot_policy: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - snapshot_policy_id: "{{ result.snapshot_policy_details.id }}" - state: "absent" diff --git a/playbooks/modules/storagepool.yml b/playbooks/modules/storagepool.yml index 9117226..7e7860a 100644 --- a/playbooks/modules/storagepool.yml +++ b/playbooks/modules/storagepool.yml @@ -23,17 +23,6 @@ media_type: "HDD" state: "present" - - name: Create a new Storage pool (Idempotency case) - dellemc.powerflex.storagepool: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - storage_pool_name: "{{ pool_name }}" - protection_domain_name: "{{ protection_domain_name }}" - media_type: "HDD" - state: "present" - - name: Set pool id ansible.builtin.set_fact: pool_id: "{{ result.storage_pool_details.id }}" @@ -48,16 +37,6 @@ storage_pool_new_name: "new_ansible_pool" state: "present" - - name: Rename Storage pool by id (Idempotency case) - dellemc.powerflex.storagepool: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - storage_pool_id: "{{ pool_id }}" - storage_pool_new_name: "new_ansible_pool" - state: "present" - - name: Restore the name of Storage pool by id dellemc.powerflex.storagepool: hostname: "{{ hostname }}" @@ -80,15 +59,3 @@ use_rmcache: true use_rfcache: true state: "present" - - - name: Modify a Storage pool by name (Idempotency case) - dellemc.powerflex.storagepool: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - storage_pool_name: "ansible_test_pool" - protection_domain_name: "{{ protection_domain_name }}" - use_rmcache: true - use_rfcache: true - state: "present" diff --git a/playbooks/modules/volume.yml b/playbooks/modules/volume.yml index ee44fd8..da5f255 100644 --- a/playbooks/modules/volume.yml +++ b/playbooks/modules/volume.yml @@ -37,25 +37,6 @@ ansible.builtin.set_fact: vol_id: "{{ result.volume_details.id }}" - - name: Create a volume Idempotency Case - register: result - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_name: "{{ vol_name }}" - storage_pool_name: "{{ storage_pool_name }}" - protection_domain_name: "{{ protection_domain_name }}" - snapshot_policy_name: "{{ snapshot_policy_name }}" - sdc: - - sdc_ip: '**.**.**.**' - - sdc_id: "663ac0d200000001" - allow_multiple_mappings: true - sdc_state: "mapped" - size: 8 - state: "present" - - name: Get volume details using volume id dellemc.powerflex.volume: hostname: "{{ hostname }}" @@ -84,16 +65,6 @@ size: 16 state: "present" - - name: Modify the size idempotency case - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_name: "{{ vol_name }}" - size: 16 - state: "present" - - name: Map volume to SDC and remove snapshot policy dellemc.powerflex.volume: hostname: "{{ hostname }}" @@ -110,23 +81,6 @@ sdc_state: "mapped" state: "present" - - name: Map volume to SDC and remove snapshot policy idempotency case - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_id: "{{ vol_id }}" - sdc: - - sdc_ip: '**.**.**.**' - - sdc_id: "663ac0d200000001" - allow_multiple_mappings: true - snapshot_policy_name: "" - auto_snap_remove_type: "remove" - sdc_state: "mapped" - state: "present" - - - name: Modify the attributes of SDC mapped to volume dellemc.powerflex.volume: hostname: "{{ hostname }}" @@ -145,24 +99,6 @@ sdc_state: "mapped" state: "present" - - name: Modify the attributes of SDC mapped to volume Idempotency - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_id: "{{ vol_id }}" - sdc: - - sdc_ip: '**.**.**.**' - iops_limit: 11 - bandwidth_limit: 4096 - - sdc_id: "663ac0d200000001" - iops_limit: 20 - bandwidth_limit: 2048 - allow_multiple_mappings: true - sdc_state: "mapped" - state: "present" - - name: Unmap SDCs from volume dellemc.powerflex.volume: hostname: "{{ hostname }}" @@ -176,19 +112,6 @@ sdc_state: "unmapped" state: "present" - - name: Unmap SDCs from volume idempotency case - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_id: "{{ vol_id }}" - sdc: - - sdc_ip: '**.**.**.**' - - sdc_id: "663ac0d200000001" - sdc_state: "unmapped" - state: "present" - - name: Rename volume dellemc.powerflex.volume: hostname: "{{ hostname }}" @@ -199,16 +122,6 @@ vol_new_name: "ansible_renamed_volume" state: "present" - - name: Rename volume idempotency case - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_id: "{{ vol_id }}" - vol_new_name: "ansible_renamed_volume" - state: "present" - - name: Delete volume dellemc.powerflex.volume: hostname: "{{ hostname }}" @@ -218,13 +131,3 @@ vol_id: "{{ vol_id }}" delete_snapshots: true state: "absent" - - - name: Delete volume idempotency - dellemc.powerflex.volume: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - vol_id: "{{ vol_id }}" - delete_snapshots: true - state: "absent" diff --git a/playbooks/roles/group_vars/all b/playbooks/roles/group_vars/all index efe280f..98ad1de 100644 --- a/playbooks/roles/group_vars/all +++ b/playbooks/roles/group_vars/all @@ -1,4 +1,6 @@ powerflex_common_file_install_location: "/var/tmp" +powerflex_common_esxi_files_location: "/tmp/" +powerflex_common_win_package_location: "C:\\Windows\\Temp" # powerflex sdc params powerflex_sdc_driver_sync_repo_address: 'ftp://ftp.emc.com/' powerflex_sdc_driver_sync_repo_user: 'QNzgdxXix' @@ -16,6 +18,7 @@ powerflex_sdc_state: present # powerflex mdm role params powerflex_mdm_state: present powerflex_mdm_password: 'Password123' +powerflex_mdm_cert_password: 'Password123!' i_am_sure: 1 powerflex_mdm_virtual_ip: '' # powerflex lia params diff --git a/playbooks/roles/host_vars/node2 b/playbooks/roles/host_vars/node2 index dc1e0cf..bdf5c96 100644 --- a/playbooks/roles/host_vars/node2 +++ b/playbooks/roles/host_vars/node2 @@ -1,7 +1,6 @@ # SDC params powerflex_sdc_name: sdc_test powerflex_sdc_performance_profile: Compact - #TB params powerflex_tb_primary_name: primary_tb powerflex_tb_secondary_name: secondary_tb diff --git a/playbooks/roles/inventory b/playbooks/roles/inventory index 78ff183..9a15c26 100644 --- a/playbooks/roles/inventory +++ b/playbooks/roles/inventory @@ -2,6 +2,15 @@ node0 ansible_host=10.1.1.1 ansible_port=22 ansible_ssh_pass=password ansible_us node1 ansible_host=10.x.x.x ansible_port=22 ansible_ssh_pass=password ansible_user=root node2 ansible_host=10.x.x.y ansible_port=22 ansible_ssh_pass=password ansible_user=root +[activemq] +node0 +node1 + +[lia] +node0 +node1 +node2 + [mdm] node0 node1 @@ -15,11 +24,6 @@ node2 [sdc] node2 -[lia] -node0 -node1 -node2 - [sds] node0 node1 diff --git a/playbooks/roles/site.yml b/playbooks/roles/site.yml index 1c2fd67..7f325d4 100644 --- a/playbooks/roles/site.yml +++ b/playbooks/roles/site.yml @@ -21,6 +21,13 @@ roles: - powerflex_tb +- name: Configure protection domain, fault set and storage pool. + hosts: config + vars_files: + - vars_files/connection.yml + roles: + - powerflex_config + - name: Install and configure PowerFlex Web UI hosts: webui vars_files: @@ -51,5 +58,7 @@ - name: Install PowerFlex SDR hosts: sdr + vars_files: + - vars_files/connection.yml roles: - powerflex_sdr diff --git a/playbooks/roles/site_powerflex45.yml b/playbooks/roles/site_powerflex45.yml new file mode 100644 index 0000000..bd75f6b --- /dev/null +++ b/playbooks/roles/site_powerflex45.yml @@ -0,0 +1,59 @@ +--- +- name: "Install PowerFlex Common" + hosts: all + roles: + - powerflex_common + +- name: Install and configure PowerFlex ActiveMQ + hosts: activemq + vars_files: + - vars_files/connection.yml + roles: + - powerflex_activemq + +- name: Install and configure PowerFlex LIA + hosts: lia + vars_files: + - vars_files/connection.yml + roles: + - powerflex_lia + +- name: Install and configure PowerFlex MDM + hosts: mdm + roles: + - powerflex_mdm + +- name: Install and configure PowerFlex TB + hosts: tb + vars_files: + - vars_files/connection.yml + roles: + - powerflex_tb + +- name: Configure protection domain, fault set and storage pool. + hosts: config + vars_files: + - vars_files/connection.yml + roles: + - powerflex_config + +- name: Install and configure PowerFlex SDC + hosts: sdc + vars_files: + - vars_files/connection.yml + roles: + - powerflex_sdc + +- name: Install and configure PowerFlex SDS + hosts: sds + vars_files: + - vars_files/connection.yml + roles: + - powerflex_sds + +- name: Install PowerFlex SDR + hosts: sdr + vars_files: + - vars_files/connection.yml + roles: + - powerflex_sdr diff --git a/playbooks/roles/uninstall_powerflex.yml b/playbooks/roles/uninstall_powerflex.yml index e70874a..464cca7 100644 --- a/playbooks/roles/uninstall_powerflex.yml +++ b/playbooks/roles/uninstall_powerflex.yml @@ -19,6 +19,8 @@ - name: Uninstall PowerFlex SDR hosts: sdr + vars_files: + - vars_files/connection.yml roles: - powerflex_sdr vars: diff --git a/playbooks/roles/uninstall_powerflex45.yml b/playbooks/roles/uninstall_powerflex45.yml new file mode 100644 index 0000000..4478973 --- /dev/null +++ b/playbooks/roles/uninstall_powerflex45.yml @@ -0,0 +1,59 @@ +--- +- name: Uninstall PowerFlex SDC + hosts: sdc + vars_files: + - vars_files/connection.yml + roles: + - powerflex_sdc + vars: + powerflex_sdc_state: absent + +- name: Uninstall PowerFlex SDS + hosts: sds + vars_files: + - vars_files/connection.yml + roles: + - powerflex_sds + vars: + powerflex_sds_state: absent + +- name: Uninstall PowerFlex SDR + hosts: sdr + vars_files: + - vars_files/connection.yml + roles: + - powerflex_sdr + vars: + powerflex_sdr_state: absent + +- name: Uninstall PowerFlex TB + hosts: tb + vars_files: + - vars_files/connection.yml + roles: + - powerflex_tb + vars: + powerflex_tb_state: absent + +- name: Uninstall PowerFlex MDM + hosts: mdm + roles: + - powerflex_mdm + vars: + powerflex_mdm_state: absent + +- name: Uninstall PowerFlex LIA + hosts: lia + roles: + - powerflex_lia + vars: + powerflex_lia_state: absent + +- name: Uninstall PowerFlex ActiveMQ + hosts: activemq + vars: + powerflex_activemq_state: absent + vars_files: + - vars_files/connection.yml + roles: + - powerflex_activemq diff --git a/plugins/modules/device.py b/plugins/modules/device.py index cfabf8c..e833531 100644 --- a/plugins/modules/device.py +++ b/plugins/modules/device.py @@ -190,23 +190,23 @@ state: "present" - name: Remove a device using device_id dellemc.powerflex.device: - hostname: "{{hostname}}" - username: "{{username}}" - password: "{{password}}" - validate_certs: "{{validate_certs}}" - port: "{{port}}" - device_id: "76eb7e2f00010000" - state: "absent" + hostname: "{{hostname}}" + username: "{{username}}" + password: "{{password}}" + validate_certs: "{{validate_certs}}" + port: "{{port}}" + device_id: "76eb7e2f00010000" + state: "absent" - name: Remove a device using (current_pathname, sds_id) dellemc.powerflex.device: - hostname: "{{hostname}}" - username: "{{username}}" - password: "{{password}}" - validate_certs: "{{validate_certs}}" - port: "{{port}}" - current_pathname: "/dev/sdb" - sds_name: "node1" - state: "absent" + hostname: "{{hostname}}" + username: "{{username}}" + password: "{{password}}" + validate_certs: "{{validate_certs}}" + port: "{{port}}" + current_pathname: "/dev/sdb" + sds_name: "node1" + state: "absent" ''' RETURN = r''' diff --git a/plugins/modules/mdm_cluster.py b/plugins/modules/mdm_cluster.py index a3b2f81..90e0bca 100644 --- a/plugins/modules/mdm_cluster.py +++ b/plugins/modules/mdm_cluster.py @@ -262,7 +262,7 @@ port: "{{port}}" mdm_name: "mdm_1" virtual_ip_interface: - - "ens224" + - "ens224" state: "present" - name: Clear virtual IP interface of the MDM diff --git a/plugins/modules/protection_domain.py b/plugins/modules/protection_domain.py index 5ffdc6b..18cb952 100644 --- a/plugins/modules/protection_domain.py +++ b/plugins/modules/protection_domain.py @@ -537,6 +537,14 @@ def validate_input_params(self): err_msg = msg.format(n_item) self.module.fail_json(msg=err_msg) + if self.module.params['network_limits'] is not None: + if self.module.params['network_limits']['overall_limit'] is not None and \ + self.module.params['network_limits']['overall_limit'] < 0: + error_msg = "Overall limit cannot be negative. " \ + "Provide a valid value " + LOG.info(error_msg) + self.module.fail_json(msg=error_msg) + def is_id_or_new_name_in_create(self): """Checking if protection domain id or new names present in create """ diff --git a/plugins/modules/replication_consistency_group.py b/plugins/modules/replication_consistency_group.py index 48c2d25..b106dfb 100644 --- a/plugins/modules/replication_consistency_group.py +++ b/plugins/modules/replication_consistency_group.py @@ -929,14 +929,14 @@ def get_pause_and_freeze_value(self): if pause is not None: self.module.deprecate( msg="Use 'rcg_state' param instead of 'pause'", - version="2.0.0", + version="3.0.0", collection_name="dellemc.powerflex" ) if freeze is not None: self.module.deprecate( msg="Use 'rcg_state' param instead of 'freeze'", - version="2.0.0", + version="3.0.0", collection_name="dellemc.powerflex" ) @@ -1083,8 +1083,8 @@ def get_powerflex_replication_consistency_group_parameters(): rpo=dict(type='int'), protection_domain_id=dict(), protection_domain_name=dict(), new_rcg_name=dict(), activity_mode=dict(choices=['Active', 'Inactive']), - pause=dict(type='bool', removed_in_version='2.0.0', removed_from_collection='dellemc.powerflex'), - freeze=dict(type='bool', removed_in_version='2.0.0', removed_from_collection='dellemc.powerflex'), + pause=dict(type='bool', removed_in_version='3.0.0', removed_from_collection='dellemc.powerflex'), + freeze=dict(type='bool', removed_in_version='3.0.0', removed_from_collection='dellemc.powerflex'), force=dict(type='bool'), rcg_state=dict(choices=['failover', 'reverse', 'restore', 'switchover', diff --git a/plugins/modules/replication_pair.py b/plugins/modules/replication_pair.py index efee53d..dfe2296 100644 --- a/plugins/modules/replication_pair.py +++ b/plugins/modules/replication_pair.py @@ -176,11 +176,11 @@ copy_type: "OnlineCopy" name: "pair1" remote_peer: - hostname: "{{hostname}}" - username: "{{username}}" - password: "{{password}}" - validate_certs: "{{validate_certs}}" - port: "{{port}}" + hostname: "{{hostname}}" + username: "{{username}}" + password: "{{password}}" + validate_certs: "{{validate_certs}}" + port: "{{port}}" - name: Pause replication pair dellemc.powerflex.replication_pair: diff --git a/plugins/modules/snapshot.py b/plugins/modules/snapshot.py index 2f23992..0cc41c5 100644 --- a/plugins/modules/snapshot.py +++ b/plugins/modules/snapshot.py @@ -171,8 +171,8 @@ validate_certs: "{{validate_certs}}" snapshot_id: "fe6cb28200000007" sdc: - - sdc_ip: "198.10.xxx.xxx" - - sdc_id: "663ac0d200000001" + - sdc_ip: "198.10.xxx.xxx" + - sdc_id: "663ac0d200000001" allow_multiple_mappings: true sdc_state: "mapped" state: "present" @@ -185,12 +185,12 @@ validate_certs: "{{validate_certs}}" snapshot_id: "fe6cb28200000007" sdc: - - sdc_ip: "198.10.xxx.xxx" - iops_limit: 11 - bandwidth_limit: 4096 - - sdc_id: "663ac0d200000001" - iops_limit: 20 - bandwidth_limit: 2048 + - sdc_ip: "198.10.xxx.xxx" + iops_limit: 11 + bandwidth_limit: 4096 + - sdc_id: "663ac0d200000001" + iops_limit: 20 + bandwidth_limit: 2048 allow_multiple_mappings: true sdc_state: "mapped" state: "present" diff --git a/plugins/modules/snapshot_policy.py b/plugins/modules/snapshot_policy.py index 1cfec86..af2084e 100644 --- a/plugins/modules/snapshot_policy.py +++ b/plugins/modules/snapshot_policy.py @@ -127,7 +127,7 @@ validate_certs: "{{validate_certs}}" snapshot_policy_name: "snapshot_policy_name_1" access_mode: "READ_WRITE" - secure_snapshots: False + secure_snapshots: false auto_snapshot_creation_cadence: time: 1 unit: "Hour" @@ -198,7 +198,7 @@ state: "absent" - id: "source_volume_id_2" auto_snap_removal_action: 'Remove' - detach_locked_auto_snapshots: True + detach_locked_auto_snapshots: true state: "absent" - name: Pause a snapshot policy @@ -208,7 +208,7 @@ password: "{{password}}" validate_certs: "{{validate_certs}}" snapshot_policy_name: "{{snapshot_policy_name}}" - pause: True + pause: true - name: Resume a snapshot policy dellemc.powerflex.snapshot_policy: @@ -217,7 +217,7 @@ password: "{{password}}" validate_certs: "{{validate_certs}}" snapshot_policy_name: "{{snapshot_policy_name}}" - pause: False + pause: false - name: Delete a snapshot policy dellemc.powerflex.snapshot_policy: @@ -227,7 +227,6 @@ validate_certs: "{{validate_certs}}" snapshot_policy_name: "snapshot_policy_name" state: "absent" - ''' RETURN = r''' diff --git a/roles/README.md b/roles/README.md index e1d11c5..e6f8c42 100644 --- a/roles/README.md +++ b/roles/README.md @@ -1,6 +1,8 @@ +## Supported Roles + #dellemc.powerflex roles directory -Here are the list of roles supported. +Here is the list of supported roles. ``` . @@ -12,4 +14,104 @@ Here are the list of roles supported. ├── powerflex_lia ├── powerflex_tb ├── powerflex_sds -``` \ No newline at end of file +├── powerflex_config +├── powerflex_activeMQ + +``` + +## Role Descriptions + +Below is the brief description of each role + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Role NameDescription
powerflex_commonRole to manage the common operations of Powerflex.
powerflex_gatewayRole to manage the installation and uninstallation of Powerflex Gateway.
powerflex_liaRole to manage the installation and uninstallation of Powerflex LIA.
powerflex_mdmRole to manage the installation and uninstallation of Powerflex MDM.
powerflex_sdcRole to manage the installation and uninstallation of Powerflex SDC.
powerflex_sdrRole to manage installation and uninstallation PowerFlex SDR.
powerflex_sdsRole to manage the installation and uninstallation of Powerflex SDS.
powerflex_tbRole to manage the installation and uninstallation of Powerflex TB.
powerflex_webuiRole to manage the installation and uninstallation of Powerflex Web UI.
powerflex_configRole to configure the protection domain, fault set and storage pool.
powerflex_activeMQRole to manage the installation and uninstallation of Powerflex ActiveMQ.
+ +## Acronyms and their full forms +Below is the list of full form of the acronyms which are refered throughout the documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AcronymFull Form
LIALightweight Installation Agent.
MDMMetadata Manager.
SDCStorage Data Client.
SDRStorage Data Replicator.
SDSStorage Data Server.
TBTie Breaker.
diff --git a/roles/powerflex_activemq/README.md b/roles/powerflex_activemq/README.md new file mode 100644 index 0000000..bdaf5ef --- /dev/null +++ b/roles/powerflex_activemq/README.md @@ -0,0 +1,155 @@ +# powerflex_activemq + +Role to manage the installation and uninstallation of Powerflex ActiveMQ. + +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Notes](#notes) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + +## Requirements + +``` +ansible +python +``` + +## Ansible collections + +Collections required to use the role. + +``` +dellemc.powerflex +``` + +## Role Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameRequiredDescriptionChoicesTypeDefault Value
hostnametrueIP or FQDN of the PowerFlex host.str
usernametrueThe username of the PowerFlex host.str
passwordtrueThe password of the PowerFlex host.str
portfalseThe port of the PowerFlex host.int443
validate_certsfalseIf C(false), the SSL certificates will not be validated.
Configure C(false) only on personally controlled sites where self-signed certificates are used.
boolfalse
timeoutfalseTime after which connection will get terminated.int120
powerflex_common_file_install_locationtrueLocation of installation and rpm gpg files to be installed. +
The required, compatible installation software package based on the operating system of the node. The files can be downloaded from the Dell Product support page for PowerFlex software.
path/var/tmp
powerflex_activemq_statefalseSpecify state of ActiveMQ. +
present will install the ActiveMQ and absent will uninstall the ActiveMQ.
absent, presentstrpresent
+ +## Examples +---- +``` + - name: Install and configure PowerFlex ActiveMQ + ansible.builtin.import_role: + name: powerflex_activemq + vars: + hostname: "{{ hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: "{{ validate_certs }}" + port: "{{ port }}" + powerflex_activemq_state: present + + - name: Uninstall powerflex ActiveMQ + ansible.builtin.import_role: + name: powerflex_activemq + vars: + powerflex_activemq_state: absent + +``` +## Notes +- Supported in PowerFlex version 4.x and above + +## Usage instructions +---- +### To install all dependency packages, including ActiveMQ, on node: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` + +### To uninstall ActiveMQ: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` + +Sample playbooks and inventory can be found in the playbooks directory. + +## Author Information +------------------ + +Dell Technologies
+Pavan Mudunuri (ansible.team@Dell.com) 2023 diff --git a/roles/powerflex_activemq/defaults/main.yml b/roles/powerflex_activemq/defaults/main.yml new file mode 100644 index 0000000..646a6bf --- /dev/null +++ b/roles/powerflex_activemq/defaults/main.yml @@ -0,0 +1,6 @@ +--- +file_glob_name: activemq +file_gpg_name: RPM-GPG-KEY-ScaleIO +powerflex_role_environment: + MDM_IP: "{{ powerflex_activemq_mdm_ips }}" +powerflex_activemq_state: 'present' diff --git a/roles/powerflex_activemq/meta/argument_specs.yml b/roles/powerflex_activemq/meta/argument_specs.yml new file mode 100644 index 0000000..4a793e5 --- /dev/null +++ b/roles/powerflex_activemq/meta/argument_specs.yml @@ -0,0 +1,48 @@ +--- +argument_specs: + main: + short_description: Role to manage the installation and uninstallation of Powerflex ActiveMQ. + description: + - Role to manage the installation and uninstallation of Powerflex ActiveMQ. + options: + hostname: + required: true + type: str + description: IP or FQDN of the PowerFlex host. + username: + required: true + type: str + description: The username of the PowerFlex host. + password: + required: true + type: str + description: The password of the PowerFlex host. + port: + type: int + description: Port of the PowerFlex host. + default: 443 + validate_certs: + description: + - If C(false), the SSL certificates will not be validated. + - Configure C(false) only on personally controlled sites where self-signed certificates are used. + type: bool + default: false + timeout: + description: Time after which connection will get terminated. + type: int + default: 120 + powerflex_common_file_install_location: + description: + - Location of installation, compatible installation software package + based on the operating system of the node. + - The files can be downloaded from the Dell Product support page for PowerFlex software. + type: path + default: /var/tmp + powerflex_activemq_state: + description: + - Specifies the state of the ActiveMQ. + - present will install the ActiveMQ if not already installed. + - absent will uninstall the ActiveMQ if installed. + type: str + choices: ['absent', 'present'] + default: present diff --git a/roles/powerflex_activemq/meta/main.yml b/roles/powerflex_activemq/meta/main.yml new file mode 100644 index 0000000..4d9fa61 --- /dev/null +++ b/roles/powerflex_activemq/meta/main.yml @@ -0,0 +1,25 @@ +--- +galaxy_info: + author: Pavan Mudunuri + description: Role to manage the installation and uninstallation of Powerflex ActiveMQ. + company: Dell Technologies + + license: GPL-3.0-only + + min_ansible_version: "2.13" + + platforms: + - name: EL + versions: + - "9" + - "8" + - name: Ubuntu + versions: + - jammy + + - name: SLES + versions: + - "15SP3" + - "15SP4" + + galaxy_tags: [] diff --git a/roles/powerflex_activemq/molecule/activemq_install/converge.yml b/roles/powerflex_activemq/molecule/activemq_install/converge.yml new file mode 100644 index 0000000..be4d31e --- /dev/null +++ b/roles/powerflex_activemq/molecule/activemq_install/converge.yml @@ -0,0 +1,31 @@ +--- +- name: Molecule Test for installation of ActiveMQ + hosts: activemq + vars_files: + - ../../../../playbooks/roles/vars_files/connection.yml + + tasks: + - name: Install and configure Powerflex ActiveMQ + ansible.builtin.import_role: + name: powerflex_activemq + vars: + powerflex_activemq_state: present + + - name: Verifying install package in check mode + ansible.builtin.assert: + that: + - powerflex_common_install_package_output.msg == "Check mode: No changes made" + when: ansible_check_mode + + - name: Verifying installation package in normal mode + ansible.builtin.assert: + that: + - " 'Installed' in powerflex_common_install_package_output.results[0]" + when: not ansible_check_mode and powerflex_common_install_package_output.changed + + - name: Verifying installation package in Idempotency mode + ansible.builtin.assert: + that: > + "'Nothing to do' in powerflex_common_install_package_output.results[0]" or + "'is already installed' in powerflex_common_install_package_output.results[0]" + when: not ansible_check_mode and not powerflex_common_install_package_output.changed diff --git a/roles/powerflex_activemq/molecule/activemq_install/molecule.yml b/roles/powerflex_activemq/molecule/activemq_install/molecule.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/roles/powerflex_activemq/molecule/activemq_install/molecule.yml @@ -0,0 +1 @@ +--- diff --git a/roles/powerflex_activemq/molecule/activemq_uninstallation/converge.yml b/roles/powerflex_activemq/molecule/activemq_uninstallation/converge.yml new file mode 100644 index 0000000..3507299 --- /dev/null +++ b/roles/powerflex_activemq/molecule/activemq_uninstallation/converge.yml @@ -0,0 +1,67 @@ +--- +- name: Molecule Test for uninstallation of ActiveMQ + hosts: activemq + vars_files: + - ../../../../playbooks/roles/vars_files/connection.yml + + tasks: + - name: Uninstall powerflex ActiveMQ + ansible.builtin.import_role: + name: powerflex_activemq + vars: + powerflex_activemq_state: absent + + - name: Verifying uninstall package in normal mode + ansible.builtin.assert: + that: + - "'Removed:' in powerflex_activemq_uninstall_output.results[0].results[0]" + when: + - not ansible_check_mode + - powerflex_activemq_uninstall_output.changed + - ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") + + - name: Verifying uninstall package in check mode + ansible.builtin.assert: + that: + - powerflex_activemq_uninstall_output.msg == "Check mode: No changes made" + when: + - ansible_check_mode + - ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") + + - name: Verifying uninstall package in Idempotency + ansible.builtin.assert: + that: > + "'Nothing to do' in powerflex_activemq_uninstall_output.results[0].msg" or + "'EMC-ScaleIO-activemq is not installed' in powerflex_activemq_uninstall_output.results[0].results[0]" + when: + - not ansible_check_mode + - not powerflex_activemq_uninstall_output.changed + - ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") + + - name: Verifying uninstall package in check mode for ubuntu + ansible.builtin.assert: + that: + - powerflex_activemq_uninstall_deb_output.results[0].msg == "Check mode: No changes made" + - powerflex_activemq_uninstall_deb_output.changed + when: + - ansible_check_mode + - ansible_distribution == "Ubuntu" + + - name: Verifying uninstall package in normal mode for ubuntu + ansible.builtin.assert: + that: + - "'Removed:' in powerflex_activemq_uninstall_deb_output.results[0].results[0]" + when: + - not ansible_check_mode + - powerflex_activemq_uninstall_deb_output.changed + - ansible_distribution == "Ubuntu" + + - name: Verifying uninstall package in Idempotency for ubuntu + ansible.builtin.assert: + that: > + "'Nothing to do' in powerflex_activemq_uninstall_deb_output.results[0].msg" or + "'is not installed' in powerflex_activemq_uninstall_deb_output.results[0].results[0]" + when: + - not ansible_check_mode + - not powerflex_activemq_uninstall_deb_output.changed + - ansible_distribution == "Ubuntu" diff --git a/roles/powerflex_activemq/molecule/activemq_uninstallation/molecule.yml b/roles/powerflex_activemq/molecule/activemq_uninstallation/molecule.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/roles/powerflex_activemq/molecule/activemq_uninstallation/molecule.yml @@ -0,0 +1 @@ +--- diff --git a/roles/powerflex_activemq/tasks/install_activemq.yml b/roles/powerflex_activemq/tasks/install_activemq.yml new file mode 100644 index 0000000..8b0dd44 --- /dev/null +++ b/roles/powerflex_activemq/tasks/install_activemq.yml @@ -0,0 +1,30 @@ +--- +- name: Set facts for MDM counts + ansible.builtin.set_fact: + mdm_count: "{{ groups['mdm'] | length }}" + +- name: Set facts for powerflex_activemq_primary_ip + ansible.builtin.set_fact: + powerflex_activemq_primary_ip: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }}" + +- name: Set facts for powerflex_activemq_secondary_ip + ansible.builtin.set_fact: + powerflex_activemq_secondary_ip: "{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" + +- name: Set facts for powerflex_activemq_tertiary_ip + ansible.builtin.set_fact: + powerflex_activemq_tertiary_ip: "{{ hostvars[groups['mdm'][2]]['ansible_host'] }}" + when: mdm_count | int > 2 + +- name: Set facts for powerflex_activemq_mdm_ips if mdm_count is 2 + ansible.builtin.set_fact: + powerflex_activemq_mdm_ips: "{{ powerflex_activemq_primary_ip }},{{ powerflex_activemq_secondary_ip }}" + when: mdm_count | int == 2 + +- name: Set facts for powerflex_activemq_mdm_ips if mdm_count is more than 2 + ansible.builtin.set_fact: + powerflex_activemq_mdm_ips: "{{ powerflex_activemq_primary_ip }},{{ powerflex_activemq_secondary_ip }},{{ powerflex_activemq_tertiary_ip }}" + when: mdm_count | int > 2 + +- name: Include install_powerflex.yml + ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml diff --git a/roles/powerflex_activemq/tasks/main.yml b/roles/powerflex_activemq/tasks/main.yml new file mode 100644 index 0000000..1f3a708 --- /dev/null +++ b/roles/powerflex_activemq/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: Install ActiveMQ + ansible.builtin.include_tasks: install_activemq.yml + when: powerflex_activemq_state == 'present' + +- name: Uninstall ActiveMQ + ansible.builtin.include_tasks: uninstall_activemq.yml + when: powerflex_activemq_state == 'absent' diff --git a/roles/powerflex_activemq/tasks/uninstall_activemq.yml b/roles/powerflex_activemq/tasks/uninstall_activemq.yml new file mode 100644 index 0000000..1f45e94 --- /dev/null +++ b/roles/powerflex_activemq/tasks/uninstall_activemq.yml @@ -0,0 +1,20 @@ +--- +- name: Uninstall package + register: powerflex_activemq_uninstall_output + environment: + I_AM_SURE: "{{ i_am_sure | int }}" + ansible.builtin.package: + name: "{{ item }}" + state: "absent" + with_items: + - EMC-ScaleIO-activemq + when: ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") + +- name: Uninstall deb package + register: powerflex_activemq_uninstall_deb_output + ansible.builtin.apt: + name: "{{ item }}" + state: absent + with_items: + - emc-scaleio-activemq + when: ansible_distribution == "Ubuntu" diff --git a/roles/powerflex_activemq/vars/main.yml b/roles/powerflex_activemq/vars/main.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/roles/powerflex_activemq/vars/main.yml @@ -0,0 +1 @@ +--- diff --git a/roles/powerflex_common/defaults/main.yml b/roles/powerflex_common/defaults/main.yml index 3b4dc28..b0ea37e 100644 --- a/roles/powerflex_common/defaults/main.yml +++ b/roles/powerflex_common/defaults/main.yml @@ -1,2 +1,4 @@ --- powerflex_common_file_install_location: "/var/tmp" +powerflex_common_esxi_files_location: "/tmp/" +powerflex_common_win_package_location: "C:\\Windows\\Temp" diff --git a/roles/powerflex_common/tasks/install_powerflex_java_CentOS.yml b/roles/powerflex_common/tasks/install_java_CentOS.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_java_CentOS.yml rename to roles/powerflex_common/tasks/install_java_CentOS.yml diff --git a/roles/powerflex_common/tasks/install_powerflex_java_RedHat.yml b/roles/powerflex_common/tasks/install_java_RedHat.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_java_RedHat.yml rename to roles/powerflex_common/tasks/install_java_RedHat.yml diff --git a/roles/powerflex_common/tasks/install_powerflex_java_SLES.yml b/roles/powerflex_common/tasks/install_java_Rocky.yml similarity index 70% rename from roles/powerflex_common/tasks/install_powerflex_java_SLES.yml rename to roles/powerflex_common/tasks/install_java_Rocky.yml index 5323819..3392203 100644 --- a/roles/powerflex_common/tasks/install_powerflex_java_SLES.yml +++ b/roles/powerflex_common/tasks/install_java_Rocky.yml @@ -1,5 +1,5 @@ --- - name: Install pre-requisite java ansible.builtin.package: - name: "java-1_8_0-openjdk-devel" + name: "java-1.8.0-openjdk-devel" state: "present" diff --git a/roles/powerflex_common/tasks/install_java_SLES.yml b/roles/powerflex_common/tasks/install_java_SLES.yml new file mode 100644 index 0000000..4842869 --- /dev/null +++ b/roles/powerflex_common/tasks/install_java_SLES.yml @@ -0,0 +1,5 @@ +--- +- name: Install pre-requisite java + ansible.builtin.package: + name: "java-11-openjdk-headless" + state: "present" diff --git a/roles/powerflex_common/tasks/install_powerflex_java_Ubuntu.yml b/roles/powerflex_common/tasks/install_java_Ubuntu.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_java_Ubuntu.yml rename to roles/powerflex_common/tasks/install_java_Ubuntu.yml diff --git a/roles/powerflex_common/tasks/install_powerflex_CentOS.yml b/roles/powerflex_common/tasks/install_packages_CentOS.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_CentOS.yml rename to roles/powerflex_common/tasks/install_packages_CentOS.yml diff --git a/roles/powerflex_common/tasks/install_powerflex_RedHat.yml b/roles/powerflex_common/tasks/install_packages_RedHat.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_RedHat.yml rename to roles/powerflex_common/tasks/install_packages_RedHat.yml diff --git a/roles/powerflex_common/tasks/install_powerflex_SLES.yml b/roles/powerflex_common/tasks/install_packages_Rocky.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_SLES.yml rename to roles/powerflex_common/tasks/install_packages_Rocky.yml diff --git a/roles/powerflex_common/tasks/install_packages_SLES.yml b/roles/powerflex_common/tasks/install_packages_SLES.yml new file mode 100644 index 0000000..380c9e8 --- /dev/null +++ b/roles/powerflex_common/tasks/install_packages_SLES.yml @@ -0,0 +1,36 @@ +--- +- name: Copy files + ansible.builtin.copy: + src: "{{ item }}" + dest: "/var/tmp/" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.rpm" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the rpm file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.rpm" + +- name: List the rpm gpg file + register: powerflex_common_package_gpg + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "{{ file_gpg_name }}*" + +- name: Import gpg key + ansible.builtin.rpm_key: + state: present + key: "{{ powerflex_common_package_gpg.files[0].path }}" + when: powerflex_common_package_gpg.files | length > 0 + +- name: Install package + register: powerflex_common_install_package_output + environment: "{{ powerflex_role_environment }}" + ansible.builtin.package: + name: "{{ powerflex_common_package_file.files[0].path }}" + state: "present" + disable_gpg_check: "{{ powerflex_gateway_disable_gpg_check | default(false) }}" diff --git a/roles/powerflex_common/tasks/install_powerflex_Ubuntu.yml b/roles/powerflex_common/tasks/install_packages_Ubuntu.yml similarity index 100% rename from roles/powerflex_common/tasks/install_powerflex_Ubuntu.yml rename to roles/powerflex_common/tasks/install_packages_Ubuntu.yml diff --git a/roles/powerflex_common/tasks/install_packages_VMkernel.yml b/roles/powerflex_common/tasks/install_packages_VMkernel.yml new file mode 100644 index 0000000..3291fe8 --- /dev/null +++ b/roles/powerflex_common/tasks/install_packages_VMkernel.yml @@ -0,0 +1,50 @@ +--- +- name: Get the acceptance level of the ESXi node + register: powerflex_common_get_acceptance_output + ansible.builtin.shell: > + esxcli software acceptance get + changed_when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' + +- name: Set the acceptance level to PartnerSupported + register: powerflex_common_set_acceptance_output + ansible.builtin.shell: > + esxcli software acceptance set --level=PartnerSupported + when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' + changed_when: powerflex_common_get_acceptance_output.stdout != 'PartnerSupported' + +- name: Copy Esxi component and rpm files + ansible.builtin.copy: + src: "{{ item }}" + dest: "{{ powerflex_common_esxi_files_location }}" + mode: "0644" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*" + - "{{ powerflex_common_file_install_location }}/{{ file_gpg_name }}*" + +- name: List the zip file + register: powerflex_common_package_file + ansible.builtin.find: + paths: "{{ powerflex_common_esxi_files_location }}" + patterns: "*{{ file_glob_name }}*.zip" + +- name: Install SDC package for ESXi + register: powerflex_common_install_package_output + ansible.builtin.shell: > + esxcli software vib install -d {{ powerflex_common_package_file.files[0].path }} --no-sig-check + ignore_errors: true + changed_when: "'Reboot Required: true' in powerflex_common_install_package_output.stdout" + +- name: Reboot ESXi host + register: powerflex_common_reboot_output + ansible.builtin.reboot: + reboot_timeout: 500 + msg: "Rebooting the ESXi host." + when: "'Reboot Required: true' in powerflex_common_install_package_output.stdout" + changed_when: powerflex_common_reboot_output.rebooted + +- name: Ensure the driver is loaded for SDC after reboot + register: powerflex_common_loaded_driver_output + ansible.builtin.shell: > + set -o pipefail && esxcli software vib list | grep sdc + changed_when: powerflex_common_loaded_driver_output.stdout_lines | length == 0 diff --git a/roles/powerflex_common/tasks/install_packages_WindowsOS.yml b/roles/powerflex_common/tasks/install_packages_WindowsOS.yml new file mode 100644 index 0000000..6b8e4b8 --- /dev/null +++ b/roles/powerflex_common/tasks/install_packages_WindowsOS.yml @@ -0,0 +1,20 @@ +--- +- name: Copy files + ansible.windows.win_copy: + src: "{{ item }}" + dest: "{{ powerflex_common_win_package_location }}" + register: powerflex_common_file + with_fileglob: + - "{{ powerflex_common_file_install_location }}/*{{ file_glob_name }}*.msi" + +- name: List the msi file + ansible.windows.win_find: + paths: "{{ powerflex_common_win_package_location }}" + patterns: "*{{ file_glob_name }}*.msi" + register: powerflex_common_package_file + +- name: Install package + register: powerflex_common_install_package_output + ansible.windows.win_command: > + msiexec.exe /i "{{ powerflex_common_package_file.files[0].path }}" MDM_IP="{{ powerflex_role_environment.MDM_IP }}" /q + ignore_errors: true diff --git a/roles/powerflex_common/tasks/install_powerflex.yml b/roles/powerflex_common/tasks/install_powerflex.yml index cab0440..98ae4b0 100644 --- a/roles/powerflex_common/tasks/install_powerflex.yml +++ b/roles/powerflex_common/tasks/install_powerflex.yml @@ -1,3 +1,8 @@ --- +- name: Set fact # noqa var-naming[no-role-prefix] + ansible.builtin.set_fact: + ansible_distribution: "WindowsOS" + when: " 'Windows' in ansible_distribution" + - name: Include installation file based on distribution - ansible.builtin.include_tasks: "install_powerflex_{{ ansible_distribution }}.yml" + ansible.builtin.include_tasks: "install_packages_{{ ansible_distribution }}.yml" diff --git a/roles/powerflex_common/tasks/main.yml b/roles/powerflex_common/tasks/main.yml index 1ddfebc..b83b1c1 100644 --- a/roles/powerflex_common/tasks/main.yml +++ b/roles/powerflex_common/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: Set fact # noqa var-naming[no-role-prefix] + ansible.builtin.set_fact: + ansible_distribution: "WindowsOS" + when: " 'Windows' in ansible_distribution" + - name: Include vars ansible.builtin.include_vars: "../vars/{{ ansible_distribution }}.yml" diff --git a/roles/powerflex_common/vars/Rocky.yml b/roles/powerflex_common/vars/Rocky.yml new file mode 100644 index 0000000..03cedf3 --- /dev/null +++ b/roles/powerflex_common/vars/Rocky.yml @@ -0,0 +1,6 @@ +--- +powerflex_common_packages: + - numactl + - libaio + - python3 + - binutils diff --git a/roles/powerflex_common/vars/SLES.yml b/roles/powerflex_common/vars/SLES.yml index cadab05..0f15a62 100644 --- a/roles/powerflex_common/vars/SLES.yml +++ b/roles/powerflex_common/vars/SLES.yml @@ -1,4 +1,4 @@ --- powerflex_common_packages: - - numactl - - libaio + - python3 + - libapr1 diff --git a/roles/powerflex_common/vars/VMkernel.yml b/roles/powerflex_common/vars/VMkernel.yml new file mode 100644 index 0000000..3cc003a --- /dev/null +++ b/roles/powerflex_common/vars/VMkernel.yml @@ -0,0 +1,2 @@ +--- +powerflex_common_packages: [] diff --git a/roles/powerflex_common/vars/WindowsOS.yml b/roles/powerflex_common/vars/WindowsOS.yml new file mode 100644 index 0000000..3cc003a --- /dev/null +++ b/roles/powerflex_common/vars/WindowsOS.yml @@ -0,0 +1,2 @@ +--- +powerflex_common_packages: [] diff --git a/roles/powerflex_config/README.md b/roles/powerflex_config/README.md new file mode 100644 index 0000000..987773d --- /dev/null +++ b/roles/powerflex_config/README.md @@ -0,0 +1,165 @@ +# powerflex_config + +Role to configure the protection domain, fault set and storage pool. + +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Usage instructions](#usage-instructions) +* [Notes](#notes) +* [Author Information](#author-information) + +## Requirements + +``` +ansible +python +``` + +## Ansible collections + +Collections required to use the role. + +``` +dellemc.powerflex +``` + +## Role Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + +
NameRequiredDescriptionChoicesTypeDefault Value
hostnametrueIP or FQDN of the PowerFlex host.str
usernametrueThe username of the PowerFlex host.str
passwordtrueThe password of the PowerFlex host.str
portfalsePort of the PowerFlex host.int443
validate_certsfalseIf C(false), the SSL certificates will not be validated.
Configure C(false) only on personally controlled sites where self-signed certificates are used.
boolfalse
powerflex_protection_domain_namefalseName of the protection domain.
strconfig_protection_domain
powerflex_fault_setsfalseList of fault sets.
list['fs1','fs2','fs3']
powerflex_media_typefalseMedia type of the storage pool.
'SSD', 'HDD', 'TRANSITIONAL'strSSD
powerflex_storage_pool_namefalseName of the storage pool.
strconfig_storage_pool
+ +## Examples +---- +``` + - name: Configuration of protection domain, fault set and storage pool. + ansible.builtin.import_role: + name: "powerflex_config" + vars: + hostname: "{{ hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: "{{ validate_certs }}" + port: "{{ port }}" + powerflex_protection_domain_name: "protection_domain" + powerflex_fault_sets: + - 'fs1' + - 'fs2' + - 'fs3' + powerflex_media_type: 'SSD' + powerflex_storage_pool_name: "storage_pool" + +``` + +## Usage instructions +---- +### To configure the protection domain and storage pool: +- PowerFlex 3.6: + ``` + ansible-playbook -i inventory site.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` + +Sample playbooks and inventory can be found in the playbooks directory. + +## Notes +---- + +- As a pre-requisite, the Gateway must be installed. +- TRANSITIONAL media type is supported only during modification. + +## Author Information +------------------ + +Dell Technologies
+Felix Stephen A (ansible.team@Dell.com) 2023 diff --git a/roles/powerflex_config/defaults/main.yml b/roles/powerflex_config/defaults/main.yml new file mode 100644 index 0000000..ce6cdaa --- /dev/null +++ b/roles/powerflex_config/defaults/main.yml @@ -0,0 +1,6 @@ +--- +# defaults file for powerflex_config +powerflex_protection_domain_name: "config_protection_domain" +powerflex_fault_sets: ['fs1', 'fs2', 'fs3'] +powerflex_media_type: 'SSD' # When version is R3 +powerflex_storage_pool_name: "tb_storage_pool" diff --git a/roles/powerflex_config/meta/argument_specs.yml b/roles/powerflex_config/meta/argument_specs.yml new file mode 100644 index 0000000..bd94c30 --- /dev/null +++ b/roles/powerflex_config/meta/argument_specs.yml @@ -0,0 +1,50 @@ +--- +argument_specs: + main: + short_description: Role to configure the protection domain, fault set and storage pool. + description: + - Role to configure the protection domain, fault set and storage pool. + options: + hostname: + required: true + type: str + description: IP or FQDN of the PowerFlex gateway. + username: + required: true + type: str + description: The username of the PowerFlex gateway. + password: + required: true + type: str + description: The password of the PowerFlex gateway. + port: + type: int + description: Port of the PowerFlex gateway. + default: 443 + validate_certs: + description: + - If C(false), the SSL certificates will not be validated. + - Configure C(false) only on personally controlled sites where self-signed certificates are used. + type: bool + default: false + timeout: + description: Timeout. + type: int + default: 120 + powerflex_protection_domain_name: + type: str + description: Name of the protection domain. + default: 'config_protection_domain' + powerflex_fault_sets: + description: List of fault sets. + type: list + default: ['fs1', 'fs2', 'fs3'] + powerflex_media_type: + description: Media type of the storage pool. + type: str + choices: ['SSD', 'HDD', 'TRANSITIONAL'] + default: 'SSD' + powerflex_storage_pool_name: + description: Name of the storage pool. + type: str + default: 'config_storage_pool' diff --git a/roles/powerflex_config/meta/main.yml b/roles/powerflex_config/meta/main.yml new file mode 100644 index 0000000..50b700c --- /dev/null +++ b/roles/powerflex_config/meta/main.yml @@ -0,0 +1,23 @@ +--- +galaxy_info: + author: Felix Stephen A + description: Role to configure the protection domain, fault set and storage pool. + company: Dell Technologies + license: GPL-3.0-only + + min_ansible_version: "2.13" + platforms: + - name: EL + versions: + - "9" + - "8" + - name: Ubuntu + versions: + - jammy + + - name: SLES + versions: + - "15SP3" + - "15SP4" + + galaxy_tags: [] diff --git a/roles/powerflex_config/molecule/configure_protection_domain/converge.yml b/roles/powerflex_config/molecule/configure_protection_domain/converge.yml new file mode 100644 index 0000000..1fb1c24 --- /dev/null +++ b/roles/powerflex_config/molecule/configure_protection_domain/converge.yml @@ -0,0 +1,47 @@ +--- +- name: Molecule Test for Configuring Protection Domain + hosts: mdm + vars_files: + - ../../../../playbooks/roles/vars_files/connection.yml + + tasks: + - name: Run Config role + ansible.builtin.import_role: + name: "powerflex_config" + register: powerflex_config_result + + - name: "Verifying protection domain creation" + ansible.builtin.assert: + that: + - powerflex_config_add_pd_output.protection_domain_details.name == powerflex_protection_domain_name + when: not ansible_check_mode and powerflex_config_add_pd_output.changed + + - name: "Verifying storage pool R2 creation" + ansible.builtin.assert: + that: + - powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name + when: not ansible_check_mode and powerflex_config_storage_pool_output.changed + + - name: "Verifying storage pool R3 creation" + ansible.builtin.assert: + that: + - powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name + when: not ansible_check_mode and powerflex_config_storage_pool_output.changed and powerflex_media_type is not none + + - name: "Verifying protection domain creation in Idempotency" + ansible.builtin.assert: + that: + - powerflex_config_add_pd_output.protection_domain_details.name == powerflex_protection_domain_name + when: not ansible_check_mode and powerflex_config_add_pd_output.changed + + - name: "Verifying storage pool R2 creation in Idempotency" + ansible.builtin.assert: + that: + powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name + when: not ansible_check_mode and powerflex_config_storage_pool_output.changed + + - name: "Verifying storage pool R3 creation in Idempotency" + ansible.builtin.assert: + that: + - powerflex_config_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name + when: not ansible_check_mode and powerflex_config_storage_pool_output.changed and powerflex_media_type is not none diff --git a/roles/powerflex_config/molecule/configure_protection_domain/molecule.yml b/roles/powerflex_config/molecule/configure_protection_domain/molecule.yml new file mode 100644 index 0000000..ed97d53 --- /dev/null +++ b/roles/powerflex_config/molecule/configure_protection_domain/molecule.yml @@ -0,0 +1 @@ +--- diff --git a/roles/powerflex_config/tasks/main.yml b/roles/powerflex_config/tasks/main.yml new file mode 100644 index 0000000..f04b4fa --- /dev/null +++ b/roles/powerflex_config/tasks/main.yml @@ -0,0 +1,60 @@ +--- + +- name: Set fact - PowerFlex config MDM primary hostname. + ansible.builtin.set_fact: + powerflex_config_mdm_primary_hostname: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" + +- name: Login to primary MDM. + ansible.builtin.command: scli --login --username {{ username }} --password "{{ password }}" + run_once: true + register: powerflex_config_login_output + changed_when: powerflex_config_login_output.rc == 0 + delegate_to: "{{ powerflex_config_mdm_primary_hostname }}" + +- name: Create the protection domain + dellemc.powerflex.protection_domain: + hostname: "{{ hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: "{{ validate_certs }}" + port: "{{ port }}" + protection_domain_name: "{{ powerflex_protection_domain_name }}" + is_active: "{{ is_active | default(omit) }}" + network_limits: "{{ network_limits | default(omit) }}" + rf_cache_limits: "{{ rf_cache_limits | default(omit) }}" + state: "present" + register: powerflex_config_add_pd_output + delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" + +- name: Add fault set + ansible.builtin.command: scli --add_fault_set --protection_domain_name "{{ powerflex_protection_domain_name }}" --fault_set_name "{{ item }}" + with_items: "{{ powerflex_fault_sets }}" + run_once: true + delegate_to: "{{ powerflex_config_mdm_primary_hostname }}" + register: powerflex_config_add_fs_output + ignore_errors: true + changed_when: powerflex_config_add_fs_output.rc == 0 + when: + - powerflex_fault_sets is defined + +- name: Create a new storage pool. + dellemc.powerflex.storagepool: + hostname: "{{ hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: "{{ validate_certs }}" + storage_pool_name: "{{ powerflex_storage_pool_name }}" + protection_domain_name: "{{ powerflex_protection_domain_name }}" + media_type: "{{ powerflex_media_type | default(omit) }}" + state: "present" + register: powerflex_config_storage_pool_output + delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" + +- name: Enable zero-padding + ansible.builtin.command: | + scli --modify_zero_padding_policy --protection_domain_name + {{ powerflex_protection_domain_name }} --storage_pool_name {{ powerflex_storage_pool_name }} --enable_zero_padding + run_once: true + register: powerflex_config_enable_zero_padding_output + changed_when: powerflex_config_enable_zero_padding_output.rc == 0 + delegate_to: "{{ powerflex_config_mdm_primary_hostname }}" diff --git a/roles/powerflex_config/vars/main.yml b/roles/powerflex_config/vars/main.yml new file mode 100644 index 0000000..ac3d9b9 --- /dev/null +++ b/roles/powerflex_config/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for powerflex_config diff --git a/roles/powerflex_gateway/README.md b/roles/powerflex_gateway/README.md index 48ab9a2..eac43ab 100644 --- a/roles/powerflex_gateway/README.md +++ b/roles/powerflex_gateway/README.md @@ -2,6 +2,16 @@ Role to manage the installation and uninstallation of Powerflex Gateway. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Notes](#notes) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` @@ -126,6 +136,9 @@ dellemc.powerflex ``` +## Notes +- Supported only in PowerFlex version 3.6. + ## Usage instructions ---- ### To install all dependency packages, including gateway, on node: diff --git a/roles/powerflex_gateway/tasks/install_gateway.yml b/roles/powerflex_gateway/tasks/install_gateway.yml index cf921bc..58bbd1a 100644 --- a/roles/powerflex_gateway/tasks/install_gateway.yml +++ b/roles/powerflex_gateway/tasks/install_gateway.yml @@ -4,7 +4,7 @@ powerflex_mdm_ips: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }},{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" - name: Install java - ansible.builtin.include_tasks: "../../powerflex_common/tasks/install_powerflex_java_{{ ansible_distribution }}.yml" + ansible.builtin.include_tasks: "../../powerflex_common/tasks/install_java_{{ ansible_distribution }}.yml" when: not powerflex_gateway_skip_java - name: Set gateway admin password @@ -18,7 +18,7 @@ ansible.builtin.include_tasks: install_keepalived.yml when: powerflex_gateway_is_redundant == "true" -- name: Configure gateway with mdm addresses +- name: Configure gateway with MDM addresses ansible.builtin.lineinfile: name: "{{ powerflex_gateway_user_properties_file }}" regexp: '^mdm.ip.addresses' diff --git a/roles/powerflex_lia/README.md b/roles/powerflex_lia/README.md index 36fbe20..2ae19c9 100644 --- a/roles/powerflex_lia/README.md +++ b/roles/powerflex_lia/README.md @@ -2,6 +2,15 @@ Role to manage the installation and uninstallation of Powerflex LIA. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` @@ -133,10 +142,24 @@ dellemc.powerflex ## Usage instructions ---- ### To install all dependency packages, including LIA, on node: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory site.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` ### To uninstall LIA: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory uninstall_powerflex.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` Sample playbooks and inventory can be found in the playbooks directory. diff --git a/roles/powerflex_lia/tasks/install_lia.yml b/roles/powerflex_lia/tasks/install_lia.yml index 3e451c0..4b987b8 100644 --- a/roles/powerflex_lia/tasks/install_lia.yml +++ b/roles/powerflex_lia/tasks/install_lia.yml @@ -1,17 +1,22 @@ --- -- name: Get configured MDM IP addresses - dellemc.powerflex.mdm_cluster: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - state: "present" - register: powerflex_lia_result - delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" +- name: Set facts for MDM counts + ansible.builtin.set_fact: + mdm_count: "{{ groups['mdm'] | length }}" + +- name: Set facts for powerflex_lia_tertiary_ip + ansible.builtin.set_fact: + powerflex_lia_tertiary_ip: "{{ hostvars[groups['mdm'][2]]['ansible_host'] }}" + when: mdm_count | int > 2 + +- name: Set facts for powerflex_lia_mdm_ips if mdm_count is 2 + ansible.builtin.set_fact: + powerflex_lia_mdm_ips: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }},{{ hostvars[groups['mdm'][1]]['ansible_host'] }}" + when: mdm_count | int == 2 -- name: Set fact - powerflex_lia_mdm_ips +- name: Set facts for powerflex_lia_mdm_ips if mdm_count is more than 2 ansible.builtin.set_fact: - powerflex_lia_mdm_ips: "{{ powerflex_lia_result.mdm_cluster_details.mdmAddresses | join(',') }}" + powerflex_lia_mdm_ips: "{{ hostvars[groups['mdm'][0]]['ansible_host'] }},{{ hostvars[groups['mdm'][1]]['ansible_host'] }},{{ powerflex_lia_tertiary_ip }}" + when: mdm_count | int > 2 - name: Include install_powerflex.yml ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml diff --git a/roles/powerflex_mdm/README.md b/roles/powerflex_mdm/README.md index 248312a..aa54a27 100644 --- a/roles/powerflex_mdm/README.md +++ b/roles/powerflex_mdm/README.md @@ -2,6 +2,16 @@ Role to manage the installation and uninstallation of Powerflex MDM. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Usage instructions](#usage-instructions) +* [Notes](#notes) +* [Author Information](#author-information) + ## Requirements ``` @@ -15,6 +25,8 @@ Collections required to use the role. ``` dellemc.powerflex +ansible.posix +community.general ``` ## Role Variables @@ -65,6 +77,15 @@ dellemc.powerflex str + + powerflex_mdm_cert_password + false + The password to generate the certificate cli. +
Required while installing MDM for Powerlex 4.x.
+ + str + Password123! + @@ -90,19 +111,32 @@ dellemc.powerflex ## Usage instructions ---- ### To install all dependency packages, including mdm, on node: +- PowerFlex 3.6: ``` ansible-playbook -i inventory site.yml ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` ### To uninstall mdm: +- PowerFlex 3.6: ``` ansible-playbook -i inventory uninstall_powerflex.yml ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` Sample playbooks and inventory can be found in the playbooks directory. +## Notes +- The ```community.general``` collection must be installed for MDM installation on SLES OS. + ## Author Information ------------------ -Dell Technologies +Dell Technologies
Bhavneet Sharma (ansible.team@Dell.com) 2023 diff --git a/roles/powerflex_mdm/meta/argument_spec.yml b/roles/powerflex_mdm/meta/argument_spec.yml index e280c72..be80c19 100644 --- a/roles/powerflex_mdm/meta/argument_spec.yml +++ b/roles/powerflex_mdm/meta/argument_spec.yml @@ -21,3 +21,8 @@ argument_specs: powerflex_mdm_virtual_ip: type: str description: Virtual IP address of MDM. + powerflex_mdm_cert_password: + type: str + description: + - Password to generate cli certificate for MDM. + - Required while installing MDM for Powerlex 4.x. diff --git a/roles/powerflex_mdm/tasks/add_certs.yml b/roles/powerflex_mdm/tasks/add_certs.yml new file mode 100644 index 0000000..f517d52 --- /dev/null +++ b/roles/powerflex_mdm/tasks/add_certs.yml @@ -0,0 +1,168 @@ +--- +- name: Generate CA certificate + register: powerflex_mdm_generate_mgmt_ca_cert + ansible.builtin.command: python3 certificate_generator_MDM_USER.py --generate_ca mgmt_ca.pem + args: + chdir: /opt/emc/scaleio/mdm/cfg + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + changed_when: powerflex_mdm_generate_mgmt_ca_cert.rc == 0 + +- name: Create CLI certificate + register: powerflex_mdm_generate_cli_cert + ansible.builtin.command: > + python3 certificate_generator_MDM_USER.py --generate_cli cli_certificate.p12 -CA mgmt_ca.pem --password {{ powerflex_mdm_cert_password }} + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + args: + chdir: /opt/emc/scaleio/mdm/cfg + changed_when: powerflex_mdm_generate_cli_cert.rc == 0 + +- name: Create MDM certificate + register: powerflex_mdm_generate_mdm_cert + ansible.builtin.command: python3 certificate_generator_MDM_USER.py --generate_mdm mdm_certificate.pem -CA mgmt_ca.pem + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + args: + chdir: /opt/emc/scaleio/mdm/cfg + changed_when: powerflex_mdm_generate_mdm_cert.rc == 0 + +- name: Create additional MDM certificates + register: powerflex_mdm_generate_additional_mdm_cert + ansible.builtin.command: python3 certificate_generator_MDM_USER.py --generate_mdm sec_mdm_certificate.pem -CA mgmt_ca.pem + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + args: + chdir: /opt/emc/scaleio/mdm/cfg + changed_when: powerflex_mdm_generate_additional_mdm_cert.rc == 0 + +- name: Fetch all certs to localhost + register: powerflex_mdm_fetch_certs + ansible.builtin.fetch: + src: /opt/emc/scaleio/mdm/cfg/{{ item }} + dest: /tmp/ + flat: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + with_items: + - sec_mdm_certificate.pem + - cli_certificate.p12 + - mgmt_ca.pem + +- name: Copy MDM certificates to Secondary manager MDM node + register: powerflex_mdm_copy_additional_certs_to_secondary + ansible.builtin.copy: + src: /tmp/sec_mdm_certificate.pem + dest: /opt/emc/scaleio/mdm/cfg/mdm_certificate.pem + mode: preserve + delegate_to: "{{ powerflex_mdm_secondary_hostname }}" + when: powerflex_mdm_secondary_ip is defined + +- name: Copy CLI certificates to Secondary manager MDM node + register: powerflex_mdm_copy_cli_certs_to_secondary + ansible.builtin.copy: + src: /tmp/cli_certificate.p12 + dest: /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 + mode: preserve + delegate_to: "{{ powerflex_mdm_secondary_hostname }}" + when: powerflex_mdm_secondary_ip is defined + +- name: Copy mgmt_ca.pem certificates to Secondary manager MDM node + register: powerflex_mdm_copy_mgmt_certs_to_secondary + ansible.builtin.copy: + src: /tmp/mgmt_ca.pem + dest: /opt/emc/scaleio/mdm/cfg/mgmt_ca.pem + mode: preserve + delegate_to: "{{ powerflex_mdm_secondary_hostname }}" + when: powerflex_mdm_secondary_ip is defined + +- name: Copy MDM certificates to Tertiary manager MDM node + register: powerflex_mdm_copy_additional_certs_to_tertiary + ansible.builtin.copy: + src: /tmp/sec_mdm_certificate.pem + dest: /opt/emc/scaleio/mdm/cfg/mdm_certificate.pem + mode: preserve + delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" + when: powerflex_mdm_tertiary_ip is defined + +- name: Copy CLI certificates to Tertiary manager MDM node + register: powerflex_mdm_copy_cli_certs_to_tertiary + ansible.builtin.copy: + src: /tmp/cli_certificate.p12 + dest: /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 + mode: preserve + delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" + when: powerflex_mdm_tertiary_ip is defined + +- name: Copy mgmt_ca.pem certificates to Tertiary manager MDM node + register: powerflex_mdm_copy_mgmt_certs_to_tertiary + ansible.builtin.copy: + src: /tmp/mgmt_ca.pem + dest: /opt/emc/scaleio/mdm/cfg/mgmt_ca.pem + mode: preserve + delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" + when: powerflex_mdm_tertiary_ip is defined + +- name: Add CA certificate on primary MDM + register: powerflex_mdm_add_mgmt_cert_to_ca_primary + ansible.builtin.command: scli --add_certificate --certificate_file mgmt_ca.pem + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + args: + chdir: /opt/emc/scaleio/mdm/cfg + changed_when: powerflex_mdm_add_mgmt_cert_to_ca_primary.rc == 0 + +- name: Add CA certificate on secondary MDM + register: powerflex_mdm_add_mgmt_cert_to_ca_secondary + ansible.builtin.command: scli --add_certificate --certificate_file mgmt_ca.pem + delegate_to: "{{ powerflex_mdm_secondary_hostname }}" + when: powerflex_mdm_secondary_ip is defined + args: + chdir: /opt/emc/scaleio/mdm/cfg + changed_when: powerflex_mdm_add_mgmt_cert_to_ca_secondary.rc == 0 + +- name: Add CA certificate on tertiary MDM + register: powerflex_mdm_add_mgmt_cert_to_ca_tertiary + ansible.builtin.command: scli --add_certificate --certificate_file mgmt_ca.pem + delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" + when: powerflex_mdm_tertiary_ip is defined + args: + chdir: /opt/emc/scaleio/mdm/cfg + changed_when: powerflex_mdm_add_mgmt_cert_to_ca_tertiary.rc == 0 + +- name: Start MDM service on primary MDM + register: powerflex_mdm_start_service_primary + ansible.builtin.service: + name: "mdm.service" + state: "restarted" + enabled: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + +- name: Start MDM service on secondary MDM + register: powerflex_mdm_start_service_secondary + ansible.builtin.service: + name: "mdm.service" + state: "restarted" + enabled: true + delegate_to: "{{ powerflex_mdm_secondary_hostname }}" + when: powerflex_mdm_secondary_ip is defined + +- name: Start MDM service on tertiary MDM + register: powerflex_mdm_start_service_tertiary + ansible.builtin.service: + name: "mdm.service" + state: "restarted" + enabled: true + delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" + when: powerflex_mdm_tertiary_ip is defined + +- name: Check MDM service status + register: powerflex_mdm_check_service + ansible.builtin.command: systemctl status mdm.service + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + changed_when: powerflex_mdm_check_service.rc == 0 + +- name: Delete certificates from localhost + register: powerflex_mdm_delete_localhost_certs + ansible.builtin.file: + path: /tmp/{{ item }} + state: absent + with_items: + - sec_mdm_certificate.pem + - cli_certificate.p12 + - mgmt_ca.pem + delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" diff --git a/roles/powerflex_mdm/tasks/install_mdm.yml b/roles/powerflex_mdm/tasks/install_mdm.yml index e326dcf..76bbba5 100644 --- a/roles/powerflex_mdm/tasks/install_mdm.yml +++ b/roles/powerflex_mdm/tasks/install_mdm.yml @@ -11,130 +11,22 @@ value: 209715200 when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" -- name: Include install_powerflex.yml - ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml - -- name: Wait for mdm to be active - ansible.builtin.wait_for: - port: 9011 - state: started - run_once: true - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - -- name: Add primary mdm with virtual ip - ansible.builtin.command: > - scli --create_mdm_cluster - --master_mdm_ip {{ powerflex_mdm_primary_ip }} - --master_mdm_management_ip {{ powerflex_mdm_primary_ip }} - --master_mdm_name {{ powerflex_mdm_primary_hostname }} - --master_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} - --cluster_virtual_ip {{ powerflex_mdm_virtual_ip }} - --accept_license --approve_certificate - run_once: true - register: powerflex_mdm_add_primary_output - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - until: ("{{ powerflex_mdm_add_primary_output.rc }} == 0") or ("{{ powerflex_mdm_add_primary_output.rc }} == 7") - ignore_errors: true - when: - - powerflex_mdm_virtual_ip is defined - - powerflex_mdm_virtual_ip | length > 0 - changed_when: powerflex_mdm_add_primary_output.rc == 0 - -- name: Add primary mdm without virtual ip - ansible.builtin.command: > - scli --create_mdm_cluster - --master_mdm_ip {{ powerflex_mdm_primary_ip }} - --master_mdm_management_ip {{ powerflex_mdm_primary_ip }} - --master_mdm_name {{ powerflex_mdm_primary_hostname }} - --master_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} - --accept_license --approve_certificate - run_once: true - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - until: ("{{ powerflex_mdm_add_primary_output.rc }} == 0") or ("{{ powerflex_mdm_add_primary_output.rc }} == 7") - register: powerflex_mdm_add_primary_output - ignore_errors: true - when: - - powerflex_mdm_virtual_ip | length == 0 - changed_when: powerflex_mdm_add_primary_output.rc == 0 - -- name: Wait for mdm to be active - ansible.builtin.wait_for: - port: 6611 - state: started - run_once: true - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - -- name: Initial login - ansible.builtin.command: scli --login --username admin --password admin - run_once: true - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - ignore_errors: true - register: powerflex_mdm_initial_login - changed_when: powerflex_mdm_initial_login.rc == 0 - -- name: Login with new password - ansible.builtin.command: > - scli --login --username admin --password "{{ powerflex_mdm_password }}" - run_once: true - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - when: powerflex_mdm_initial_login.rc == 7 - changed_when: powerflex_mdm_initial_login.rc == 0 - -- name: Set password - ansible.builtin.command: > - scli --set_password --old_password admin - --new_password "{{ powerflex_mdm_password }}" - run_once: true - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - when: powerflex_mdm_initial_login.rc == 0 - changed_when: powerflex_mdm_initial_login.rc == 0 - -- name: Secondary node login - ansible.builtin.command: > - scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} - --username admin --password {{ powerflex_mdm_password }} --approve_certificate - run_once: true - register: powerflex_mdm_secondary_login - changed_when: powerflex_mdm_secondary_login.rc == 0 - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - -- name: Add secondary mdm - ansible.builtin.command: > - scli --add_standby_mdm - --new_mdm_ip {{ powerflex_mdm_secondary_ip }} - --mdm_role manager - --new_mdm_name {{ powerflex_mdm_secondary_hostname }} - --new_mdm_management_ip {{ powerflex_mdm_secondary_ip }} - --new_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} - --approve_certificate - run_once: true - register: powerflex_mdm_add_secondary_output - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - ignore_errors: true - changed_when: powerflex_mdm_add_secondary_output.rc == 0 - -- name: Tertiary node login - ansible.builtin.command: > - scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} --username admin - --password {{ powerflex_mdm_password }} --approve_certificate - run_once: true - delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" - when: powerflex_mdm_tertiary_ip is defined - register: powerflex_mdm_tertiary_login - changed_when: powerflex_mdm_tertiary_login.rc == 0 - -- name: Add tertiary mdm - ansible.builtin.command: > - scli --add_standby_mdm - --new_mdm_ip {{ powerflex_mdm_tertiary_ip }} - --mdm_role manager - --new_mdm_name {{ powerflex_mdm_tertiary_hostname }} - --new_mdm_management_ip {{ powerflex_mdm_tertiary_ip }} - --new_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} - --approve_certificate - run_once: true - register: powerflex_mdm_add_tertiary_output - delegate_to: "{{ powerflex_mdm_primary_hostname }}" - ignore_errors: true - when: powerflex_mdm_tertiary_ip is defined - changed_when: powerflex_mdm_add_tertiary_output.rc == 0 +- name: List the rpm file + register: powerflex_mdm_package_file_version + ansible.builtin.find: + paths: "{{ powerflex_common_file_install_location }}" + patterns: "*{{ file_glob_name }}*.rpm" + delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" + +- name: Extract file versions + ansible.builtin.set_fact: + version: "{{ powerflex_mdm_package_file_version.files[0].path | regex_search('mdm-(\\d+)', '\\1') }}" + when: powerflex_mdm_package_file_version.files | length > 0 + +- name: Install MDM for PowerFlex below 4.x + ansible.builtin.include_tasks: install_powerflex3x_mdm.yml + when: version[0] < "4" + +- name: Install MDM for PowerFlex 4.x + ansible.builtin.include_tasks: install_powerflex4x_mdm.yml + when: version[0] >= "4" diff --git a/roles/powerflex_mdm/tasks/install_powerflex3x_mdm.yml b/roles/powerflex_mdm/tasks/install_powerflex3x_mdm.yml new file mode 100644 index 0000000..178bd86 --- /dev/null +++ b/roles/powerflex_mdm/tasks/install_powerflex3x_mdm.yml @@ -0,0 +1,128 @@ +--- +- name: Include install_powerflex.yml + ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml + +- name: Wait for MDM to be active + ansible.builtin.wait_for: + port: 9011 + state: started + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + +- name: Add primary MDM with virtual ip + ansible.builtin.command: > + scli --create_mdm_cluster + --master_mdm_ip {{ powerflex_mdm_primary_ip }} + --master_mdm_management_ip {{ powerflex_mdm_primary_ip }} + --master_mdm_name {{ powerflex_mdm_primary_hostname }} + --master_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --cluster_virtual_ip {{ powerflex_mdm_virtual_ip }} + --accept_license --approve_certificate + run_once: true + register: powerflex_mdm_add_primary_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + until: ("{{ powerflex_mdm_add_primary_output.rc }} == 0") or ("{{ powerflex_mdm_add_primary_output.rc }} == 7") + ignore_errors: true + when: + - powerflex_mdm_virtual_ip is defined + - powerflex_mdm_virtual_ip | length > 0 + changed_when: powerflex_mdm_add_primary_output.rc == 0 + +- name: Add primary MDM without virtual ip + ansible.builtin.command: > + scli --create_mdm_cluster + --master_mdm_ip {{ powerflex_mdm_primary_ip }} + --master_mdm_management_ip {{ powerflex_mdm_primary_ip }} + --master_mdm_name {{ powerflex_mdm_primary_hostname }} + --master_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --accept_license --approve_certificate + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + until: ("{{ powerflex_mdm_add_primary_output.rc }} == 0") or ("{{ powerflex_mdm_add_primary_output.rc }} == 7") + register: powerflex_mdm_add_primary_output + ignore_errors: true + when: + - powerflex_mdm_virtual_ip | length == 0 + changed_when: powerflex_mdm_add_primary_output.rc == 0 + +- name: Wait for MDM to be active + ansible.builtin.wait_for: + port: 6611 + state: started + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + +- name: Initial login to primary MDM + ansible.builtin.command: scli --login --username admin --password admin + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + ignore_errors: true + register: powerflex_mdm_initial_login + changed_when: powerflex_mdm_initial_login.rc == 0 + +- name: Login with new password primary MDM + ansible.builtin.command: > + scli --login --username admin --password "{{ powerflex_mdm_password }}" + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + when: powerflex_mdm_initial_login.rc == 7 + changed_when: powerflex_mdm_initial_login.rc == 0 + +- name: Set password for MDM cluster + ansible.builtin.command: > + scli --set_password --old_password admin + --new_password "{{ powerflex_mdm_password }}" + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + when: powerflex_mdm_initial_login.rc == 0 + changed_when: powerflex_mdm_initial_login.rc == 0 + +- name: Secondary node login + ansible.builtin.command: > + scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} + --username admin --password {{ powerflex_mdm_password }} --approve_certificate + run_once: true + register: powerflex_mdm_secondary_login + changed_when: powerflex_mdm_secondary_login.rc == 0 + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + +- name: Add secondary MDM + ansible.builtin.command: > + scli --add_standby_mdm + --new_mdm_ip {{ powerflex_mdm_secondary_ip }} + --mdm_role manager + --new_mdm_name {{ powerflex_mdm_secondary_hostname }} + --new_mdm_management_ip {{ powerflex_mdm_secondary_ip }} + --new_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --approve_certificate + run_once: true + register: powerflex_mdm_add_secondary_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + ignore_errors: true + changed_when: powerflex_mdm_add_secondary_output.rc == 0 + +- name: Tertiary node login + ansible.builtin.command: > + scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} --username admin + --password {{ powerflex_mdm_password }} --approve_certificate + run_once: true + delegate_to: "{{ powerflex_mdm_tertiary_hostname }}" + when: powerflex_mdm_tertiary_ip is defined + register: powerflex_mdm_tertiary_login + changed_when: powerflex_mdm_tertiary_login.rc == 0 + +- name: Add tertiary MDM + ansible.builtin.command: > + scli --add_standby_mdm + --new_mdm_ip {{ powerflex_mdm_tertiary_ip }} + --mdm_role manager + --new_mdm_name {{ powerflex_mdm_tertiary_hostname }} + --new_mdm_management_ip {{ powerflex_mdm_tertiary_ip }} + --new_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --approve_certificate + run_once: true + register: powerflex_mdm_add_tertiary_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + ignore_errors: true + when: powerflex_mdm_tertiary_ip is defined + changed_when: powerflex_mdm_add_tertiary_output.rc == 0 diff --git a/roles/powerflex_mdm/tasks/install_powerflex4x_mdm.yml b/roles/powerflex_mdm/tasks/install_powerflex4x_mdm.yml new file mode 100644 index 0000000..6716433 --- /dev/null +++ b/roles/powerflex_mdm/tasks/install_powerflex4x_mdm.yml @@ -0,0 +1,101 @@ +--- +- name: Install java + ansible.builtin.include_tasks: "../../powerflex_common/tasks/install_java_{{ ansible_distribution }}.yml" + +- name: Include install_powerflex.yml + ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml + +- name: Include the add_certs.yml + ansible.builtin.include_tasks: add_certs.yml + +- name: Add primary MDM with virtual ip + ansible.builtin.command: > + scli --create_mdm_cluster + --primary_mdm_ip {{ powerflex_mdm_primary_ip }} + --primary_mdm_management_ip {{ powerflex_mdm_primary_ip }} + --primary_mdm_name {{ powerflex_mdm_primary_hostname }} + --primary_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --cluster_virtual_ip {{ powerflex_mdm_virtual_ip }} + --accept_license --approve_certificate + run_once: true + register: powerflex_mdm_add_primary_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + until: ("{{ powerflex_mdm_add_primary_output.rc }} == 0") or ("{{ powerflex_mdm_add_primary_output.rc }} == 7") + ignore_errors: true + when: + - powerflex_mdm_virtual_ip is defined + - powerflex_mdm_virtual_ip | length > 0 + changed_when: powerflex_mdm_add_primary_output.rc == 0 + +- name: Add primary MDM without virtual ip + ansible.builtin.command: > + scli --create_mdm_cluster + --primary_mdm_ip {{ powerflex_mdm_primary_ip }} + --primary_mdm_management_ip {{ powerflex_mdm_primary_ip }} + --primary_mdm_name {{ powerflex_mdm_primary_hostname }} + --primary_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --accept_license --approve_certificate + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + until: ("{{ powerflex_mdm_add_primary_output.rc }} == 0") or ("{{ powerflex_mdm_add_primary_output.rc }} == 7") + register: powerflex_mdm_add_primary_output + ignore_errors: true + when: + - powerflex_mdm_virtual_ip | length == 0 + changed_when: powerflex_mdm_add_primary_output.rc == 0 + +- name: Wait for MDM to be active + ansible.builtin.wait_for: + port: 8611 + state: started + run_once: true + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + +- name: Login to primary MDM node + register: powerflex_mdm_secondary_login + ansible.builtin.command: > + scli --login --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ powerflex_mdm_cert_password }} + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + run_once: true + when: powerflex_mdm_secondary_ip is defined + changed_when: powerflex_mdm_secondary_login.rc == 0 + +- name: Add secondary MDM + ansible.builtin.command: > + scli --add_standby_mdm + --new_mdm_ip {{ powerflex_mdm_secondary_ip }} + --mdm_role manager + --new_mdm_name {{ powerflex_mdm_secondary_hostname }} + --new_mdm_management_ip {{ powerflex_mdm_secondary_ip }} + --new_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --approve_certificate + run_once: true + register: powerflex_mdm_add_secondary_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + ignore_errors: true + changed_when: powerflex_mdm_add_secondary_output.rc == 0 + +- name: Login to Primary MDM node + register: powerflex_mdm_tertiary_login + ansible.builtin.command: > + scli --login --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ powerflex_mdm_cert_password }} + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + run_once: true + when: powerflex_mdm_tertiary_ip is defined + changed_when: powerflex_mdm_tertiary_login.rc == 0 + +- name: Add tertiary MDM + ansible.builtin.command: > + scli --add_standby_mdm + --new_mdm_ip {{ powerflex_mdm_tertiary_ip }} + --mdm_role manager + --new_mdm_name {{ powerflex_mdm_tertiary_hostname }} + --new_mdm_management_ip {{ powerflex_mdm_tertiary_ip }} + --new_mdm_virtual_ip_interface {{ ansible_default_ipv4.interface }} + --approve_certificate + run_once: true + register: powerflex_mdm_add_tertiary_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + ignore_errors: true + when: powerflex_mdm_tertiary_ip is defined + changed_when: powerflex_mdm_add_tertiary_output.rc == 0 diff --git a/roles/powerflex_mdm/tasks/remove_mdm.yml b/roles/powerflex_mdm/tasks/remove_mdm.yml index cbf0a1c..35c8f57 100644 --- a/roles/powerflex_mdm/tasks/remove_mdm.yml +++ b/roles/powerflex_mdm/tasks/remove_mdm.yml @@ -2,6 +2,17 @@ - name: Include the mdm_set_facts.yml ansible.builtin.include_tasks: mdm_set_facts.yml +- name: List the rpm file + register: powerflex_mdm_package_file_version + ansible.builtin.find: + paths: "/var/tmp/" + patterns: "*{{ file_glob_name }}*.rpm" + +- name: Extract file versions + ansible.builtin.set_fact: + version: "{{ powerflex_mdm_package_file_version.files[0].path | regex_search('mdm-(\\d+)', '\\1') }}" + when: powerflex_mdm_package_file_version.files | length > 0 + - name: MDM Cluster login ansible.builtin.command: > scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} @@ -11,8 +22,19 @@ register: powerflex_mdm_cluster_login changed_when: powerflex_mdm_cluster_login.rc == 0 delegate_to: "{{ powerflex_mdm_primary_hostname }}" + when: version[0] < "4" + +- name: Login to primary MDM node + register: powerflex_mdm_primary_login + ansible.builtin.command: > + scli --login --p12_path /opt/emc/scaleio/mdm/cfg/cli_certificate.p12 --p12_password {{ powerflex_mdm_cert_password }} + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + run_once: true + ignore_errors: true + changed_when: powerflex_mdm_primary_login.rc == 0 + when: version[0] >= "4" -- name: Remove secondary mdm +- name: Remove secondary MDM ansible.builtin.command: > scli --remove_standby_mdm --remove_mdm_ip {{ powerflex_mdm_secondary_ip }} run_once: true @@ -22,7 +44,7 @@ when: powerflex_mdm_secondary_ip is defined changed_when: powerflex_mdm_remove_secondary.rc == 0 -- name: Remove tertiary mdm +- name: Remove tertiary MDM ansible.builtin.command: > scli --remove_standby_mdm --remove_mdm_ip {{ powerflex_mdm_tertiary_ip }} run_once: true diff --git a/roles/powerflex_mdm/vars/SLES.yml b/roles/powerflex_mdm/vars/SLES.yml index cafe7af..f71b51d 100644 --- a/roles/powerflex_mdm/vars/SLES.yml +++ b/roles/powerflex_mdm/vars/SLES.yml @@ -1,3 +1,3 @@ --- powerflex_mdm_packages: - - python + - python3 diff --git a/roles/powerflex_sdc/README.md b/roles/powerflex_sdc/README.md index cb44fe8..5006cb6 100644 --- a/roles/powerflex_sdc/README.md +++ b/roles/powerflex_sdc/README.md @@ -2,11 +2,22 @@ Role to manage the installation and uninstallation of Powerflex SDC. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Notes](#notes) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` ansible python +pywinrm==0.4.3 ``` ## Ansible collections @@ -15,6 +26,7 @@ Collections required to use the role. ``` dellemc.powerflex +ansible.windows ``` ## Role Variables @@ -89,6 +101,15 @@ dellemc.powerflex str /var/tmp + + powerflex_common_win_package_location + false + Location of SDC windows package on the node. +
SDC windows package will be copied to this location on installation. + + str + C:\\Windows\\Temp + powerflex_sdc_driver_sync_repo_address false @@ -201,6 +222,18 @@ dellemc.powerflex str Compact + + powerflex_sdc_esxi_guid + false + Specifies the unique GUID for the ESXi SDC node. +
It is required only with ESXi node. +
To configure ESXi node as SDC, generate one GUID per server. +
Tools that are freely available online can generate these strings. +
If the value is different, then update in main.yml of defaults. + + str + d422ecab-af6f-4e0c-a059-333ac89cfb42 + powerflex_sdc_state false @@ -242,18 +275,37 @@ dellemc.powerflex ``` +## Notes +- Generate GUID using https://www.guidgenerator.com/online-guid-generator.aspx. Use the default GUID settings. +- While adding ESXi server as SDC, this procedure requires two server reboots. + ## Usage instructions ---- ### To install all dependency packages, including SDC, on node: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory site.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` ### To uninstall SDC: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory uninstall_powerflex.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` Sample playbooks and inventory can be found in the playbooks directory. ## Author Information ------------------ -Dell Technologies -Jennifer John (ansible.team@Dell.com) 2023 +Dell Technologies
+Jennifer John (ansible.team@Dell.com) 2023
+Bhavneet Sharma (ansible.team@Dell.com) 2023 diff --git a/roles/powerflex_sdc/defaults/main.yml b/roles/powerflex_sdc/defaults/main.yml index 5b8968a..5801c0c 100644 --- a/roles/powerflex_sdc/defaults/main.yml +++ b/roles/powerflex_sdc/defaults/main.yml @@ -1,4 +1,5 @@ --- +powerflex_common_win_package_location: "C:\\Windows\\Temp" powerflex_sdc_driver_sync_repo_address: 'ftp://ftp.emc.com/' powerflex_sdc_driver_sync_repo_user: 'QNzgdxXix' powerflex_sdc_driver_sync_repo_password: 'Aw3wFAwAq3' @@ -16,4 +17,5 @@ powerflex_sdc_name: sdc_test powerflex_sdc_performance_profile: Compact file_glob_name: sdc i_am_sure: 1 +powerflex_sdc_esxi_guid: "d422ecab-af6f-4e0c-a059-333ac89cfb42" powerflex_role_environment: diff --git a/roles/powerflex_sdc/molecule/sdc_installation/converge.yml b/roles/powerflex_sdc/molecule/sdc_installation/converge.yml index 979406f..4687e5f 100644 --- a/roles/powerflex_sdc/molecule/sdc_installation/converge.yml +++ b/roles/powerflex_sdc/molecule/sdc_installation/converge.yml @@ -16,12 +16,33 @@ ansible.builtin.assert: that: - " 'Installed' in powerflex_common_install_package_output.results[0]" - when: not ansible_check_mode and powerflex_common_install_package_output.changed + when: + - not ansible_check_mode and powerflex_common_install_package_output.changed + - " 'WindowsOS' not in ansible_distribution " + - " 'VMkernel' not in ansible_distribution " + + - name: "Verifying installation package on windows" + ansible.builtin.assert: + that: + - powerflex_common_install_package_output.rc == 0 + when: + - " 'WindowsOS' in ansible_distribution " + - not ansible_check_mode and powerflex_common_install_package_output.changed + + - name: "Verifying installation package on ESXi" + ansible.builtin.assert: + that: + - powerflex_common_install_package_output.rc == 0 + when: + - " 'VMkernel' in ansible_distribution " + - not ansible_check_mode and powerflex_common_install_package_output.changed + - name: "Verifying performance profile value" ansible.builtin.assert: that: - powerflex_sdc_performance_profile_output.sdc_details.perfProfile == "{{ powerflex_sdc_performance_profile }}" when: not ansible_check_mode and powerflex_sdc_performance_profile_output.changed + - name: "Verifying rename value" ansible.builtin.assert: that: @@ -33,6 +54,7 @@ that: - powerflex_sdc_performance_profile_output.sdc_details.perfProfile == "{{ powerflex_sdc_performance_profile }}" when: not ansible_check_mode and not powerflex_sdc_performance_profile_output.changed + - name: "Verifying rename value in Idempotency" ansible.builtin.assert: that: diff --git a/roles/powerflex_sdc/molecule/sdc_uninstallation/converge.yml b/roles/powerflex_sdc/molecule/sdc_uninstallation/converge.yml index be15723..a11ce0e 100644 --- a/roles/powerflex_sdc/molecule/sdc_uninstallation/converge.yml +++ b/roles/powerflex_sdc/molecule/sdc_uninstallation/converge.yml @@ -29,7 +29,26 @@ ansible.builtin.assert: that: - powerflex_sdc_uninstall_output.results[0].msg == 'Nothing to do' - when: not ansible_check_mode and not powerflex_sdc_uninstall_output.changed + when: + - not ansible_check_mode and not powerflex_sdc_uninstall_output.changed + - " 'WindowsOS' not in ansible_distribution " + - " 'VMkernel' not in ansible_distribution " + + - name: "Verifying uninstall package in Idempotency for Windows node" + ansible.builtin.assert: + that: + - powerflex_sdc_uninstall_output.msg == 'All items skipped' + when: + - not ansible_check_mode and not powerflex_sdc_uninstall_output.changed + - " 'WindowsOS' in ansible_distribution " + + - name: "Verifying uninstall package in Idempotency for ESXi node" + ansible.builtin.assert: + that: + - powerflex_sdc_uninstall_output.msg == 'All items skipped' + when: + - not ansible_check_mode and not powerflex_sdc_uninstall_output.changed + - " 'VMkernel' in ansible_distribution " - name: "Verifying remove the sdc in Idempotency" ansible.builtin.assert: diff --git a/roles/powerflex_sdc/molecule/wrong_sdc_credentials/converge.yml b/roles/powerflex_sdc/molecule/wrong_sdc_credentials/converge.yml index c015200..86583fd 100644 --- a/roles/powerflex_sdc/molecule/wrong_sdc_credentials/converge.yml +++ b/roles/powerflex_sdc/molecule/wrong_sdc_credentials/converge.yml @@ -17,4 +17,4 @@ - name: "Verifying failure of install package with wrong credentials" ansible.builtin.assert: that: - - " 'Invalid/incorrect password' in powerflex_sdc_driver_sync_output.msg" + - " 'failed. The error was: error while evaluating conditional' in powerflex_sdc_driver_sync_output.msg" diff --git a/roles/powerflex_sdc/molecule/wrong_sdc_ip/converge.yml b/roles/powerflex_sdc/molecule/wrong_sdc_ip/converge.yml index 394c145..1ebda8c 100644 --- a/roles/powerflex_sdc/molecule/wrong_sdc_ip/converge.yml +++ b/roles/powerflex_sdc/molecule/wrong_sdc_ip/converge.yml @@ -17,4 +17,4 @@ - name: "Verifying failure of install package with wrong SDC IP" ansible.builtin.assert: that: - - " 'Failed to connect' in powerflex_sdc_driver_sync_output.msg" + " 'failed. The error was: error while evaluating conditional' in powerflex_sdc_driver_sync_output.msg" diff --git a/roles/powerflex_sdc/tasks/install_sdc.yml b/roles/powerflex_sdc/tasks/install_sdc.yml index 8e77778..9b75321 100644 --- a/roles/powerflex_sdc/tasks/install_sdc.yml +++ b/roles/powerflex_sdc/tasks/install_sdc.yml @@ -6,16 +6,20 @@ password: "{{ password }}" validate_certs: "{{ validate_certs }}" state: "present" - register: powerflex_sdc_result + register: powerflex_sdc_mdm_ip_result delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" - name: Set fact - powerflex_sdc_mdm_ips ansible.builtin.set_fact: - powerflex_sdc_mdm_ips: "{{ powerflex_sdc_result.mdm_cluster_details.mdmAddresses | join(',') }}" + powerflex_sdc_mdm_ips: "{{ powerflex_sdc_mdm_ip_result.mdm_cluster_details.mdmAddresses | join(',') }}" - name: Include install_powerflex.yml ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml +- name: Register SDC and Set MDM IP addresses by register_esxi_sdc.yml + ansible.builtin.include_tasks: register_esxi_sdc.yml + when: ansible_distribution == "VMkernel" + - name: Include configure_sdc.yml ansible.builtin.include_tasks: configure_sdc.yml @@ -29,6 +33,7 @@ when: - powerflex_sdc_driver_sync_user_private_rsa_key_src is defined - powerflex_sdc_driver_sync_user_private_rsa_key_src | length > 0 + - " 'WindowsOS' not in ansible_distribution" - name: Copy powerflex_sdc_driver_sync_repo_public_rsa_key_src for driver_sync.conf ansible.builtin.copy: @@ -40,6 +45,7 @@ when: - powerflex_sdc_driver_sync_repo_public_rsa_key_src is defined - powerflex_sdc_driver_sync_repo_public_rsa_key_src | length > 0 + - " 'WindowsOS' not in ansible_distribution" - name: Copy powerflex_sdc_driver_sync_emc_public_gpg_key_src for driver_sync.conf ansible.builtin.copy: @@ -53,6 +59,7 @@ when: - powerflex_sdc_driver_sync_emc_public_gpg_key_src is defined - powerflex_sdc_driver_sync_emc_public_gpg_key_src | length > 0 + - " 'WindowsOS' not in ansible_distribution" - name: Copy driver_sync.conf template in place register: powerflex_sdc_driver_sync_output @@ -63,3 +70,6 @@ owner: "root" group: "root" notify: restart scini + when: + - ansible_distribution != "VMkernel" + - " 'WindowsOS' not in ansible_distribution" diff --git a/roles/powerflex_sdc/tasks/register_esxi_sdc.yml b/roles/powerflex_sdc/tasks/register_esxi_sdc.yml new file mode 100644 index 0000000..0b06fc8 --- /dev/null +++ b/roles/powerflex_sdc/tasks/register_esxi_sdc.yml @@ -0,0 +1,47 @@ +--- +- name: Register SDC and Set MDM IP addresses + register: powerflex_sdc_register_set_sdc_mdm + ansible.builtin.shell: > + esxcli system module parameters set -m scini -p "IoctlIniGuidStr={{ powerflex_sdc_esxi_guid }} + IoctlMdmIPStr={{ powerflex_sdc_mdm_ips }} bBlkDevIsPdlActive=1 blkDevPdlTimeoutMillis=60000" + changed_when: powerflex_sdc_register_set_sdc_mdm.rc == 0 + +- name: Reboot ESXi host + register: powerflex_sdc_reboot_node + ansible.builtin.reboot: + reboot_timeout: 500 + msg: "Rebooting the ESXi host." + when: + - powerflex_sdc_register_set_sdc_mdm.rc == 0 + - "'Reboot Required: true' in powerflex_common_install_package_output.stdout" + changed_when: powerflex_sdc_reboot_node + +- name: Ensure the driver is loaded for SDC + register: powerflex_sdc_driver_loaded + ansible.builtin.shell: > + set -o pipefail && vmkload_mod -l | grep scini + changed_when: powerflex_sdc_driver_loaded.stdout_lines | length == 0 + +- name: Verify ESXi SDC connection with MDMs + ansible.builtin.copy: + src: "{{ item }}" + dest: "{{ powerflex_common_esxi_files_location }}" + mode: "0755" + register: powerflex_sdc_drv_cfg_file_output + with_fileglob: + - "{{ powerflex_common_file_install_location }}/drv_cfg*" + +- name: List the drv_cfg file + register: powerflex_sdc_drv_cfg_file + ansible.builtin.find: + paths: "{{ powerflex_common_esxi_files_location }}" + patterns: "*drv_cfg*" + +- name: Execute drv_cfg command + register: powerflex_sdc_drv_cfg_output + ansible.builtin.command: ./drv_cfg --query_mdm + args: + chdir: "{{ powerflex_common_esxi_files_location }}" + when: powerflex_sdc_drv_cfg_file.files | length > 0 + changed_when: + - "'Retrieved 1 mdm(s)' not in powerflex_sdc_drv_cfg_output.stdout" diff --git a/roles/powerflex_sdc/tasks/remove_sdc.yml b/roles/powerflex_sdc/tasks/remove_sdc.yml index 9cc88a8..b8e9b54 100644 --- a/roles/powerflex_sdc/tasks/remove_sdc.yml +++ b/roles/powerflex_sdc/tasks/remove_sdc.yml @@ -1,4 +1,9 @@ --- +- name: Set fact # noqa var-naming[no-role-prefix] + ansible.builtin.set_fact: + ansible_distribution: "WindowsOS" + when: " 'Windows' in ansible_distribution" + - name: Include uninstall_sdc.yml ansible.builtin.include_tasks: uninstall_sdc.yml diff --git a/roles/powerflex_sdc/tasks/uninstall_esxi_sdc.yml b/roles/powerflex_sdc/tasks/uninstall_esxi_sdc.yml new file mode 100644 index 0000000..b3c3c68 --- /dev/null +++ b/roles/powerflex_sdc/tasks/uninstall_esxi_sdc.yml @@ -0,0 +1,30 @@ +--- +- name: Get the name of SDC driver installed + register: powerflex_sdc_installed_driver_list + ansible.builtin.shell: > + set -o pipefail && esxcli software vib list | grep sdc + changed_when: powerflex_sdc_installed_driver_list.stdout_lines | length == 0 + ignore_errors: true + +- name: Remove the SDC driver form the esxi host + register: powerflex_sdc_remove_driver_output + ansible.builtin.shell: > + esxcli software vib remove -n {{ powerflex_sdc_installed_driver_list.stdout.split()[0] }} + changed_when: "'Reboot Required: true' in powerflex_sdc_remove_driver_output.stdout" + when: powerflex_sdc_installed_driver_list.stdout_lines | length != 0 + +- name: Reboot ESXi host + register: powerflex_sdc_remove_driver_reboot_output + ansible.builtin.reboot: + reboot_timeout: 450 + msg: "Rebooting the ESXi host." + when: + - powerflex_sdc_installed_driver_list.stdout_lines | length != 0 + changed_when: powerflex_sdc_remove_driver_reboot_output.rebooted + +- name: List the SDC driver installed + ansible.builtin.shell: > + set -o pipefail && esxcli software vib list | grep sdc + register: powerflex_sdc_drivers_list + changed_when: powerflex_sdc_drivers_list.stdout_lines | length != 0 + failed_when: powerflex_sdc_drivers_list.stdout_lines | length != 0 diff --git a/roles/powerflex_sdc/tasks/uninstall_sdc.yml b/roles/powerflex_sdc/tasks/uninstall_sdc.yml index e5a0996..e46a326 100644 --- a/roles/powerflex_sdc/tasks/uninstall_sdc.yml +++ b/roles/powerflex_sdc/tasks/uninstall_sdc.yml @@ -8,12 +8,33 @@ state: "absent" with_items: - EMC-ScaleIO-sdc - when: ansible_distribution in ("RedHat", "CentOS", "SLES") + when: ansible_distribution in ("RedHat", "CentOS", "SLES", "Rocky") - name: Uninstall deb package + register: powerflex_sdc_uninstall_deb_output ansible.builtin.apt: name: "{{ item }}" state: absent with_items: - emc-scaleio-sdc when: ansible_distribution == "Ubuntu" + +- name: Include uninstall_esxi_sdc.yml to uninstall the esxi sdc + ansible.builtin.include_tasks: uninstall_esxi_sdc.yml + when: ansible_distribution == "VMkernel" + +- name: List the msi files + ansible.windows.win_find: + paths: "{{ powerflex_common_win_package_location }}" + patterns: "*{{ file_glob_name }}*.msi" + register: powerflex_sdc_msi_package_files + when: ansible_distribution == "WindowsOS" + +- name: Uninstall win package + register: powerflex_sdc_uninstall_win_output + ansible.windows.win_package: + path: "{{ item.path }}" + state: absent + with_items: + - "{{ powerflex_sdc_msi_package_files.files }}" + when: ansible_distribution == "WindowsOS" diff --git a/roles/powerflex_sdr/README.md b/roles/powerflex_sdr/README.md index 5495fde..e834913 100644 --- a/roles/powerflex_sdr/README.md +++ b/roles/powerflex_sdr/README.md @@ -2,6 +2,15 @@ Role to manage installation and uninstallation PowerFlex SDR. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` @@ -108,10 +117,24 @@ dellemc.powerflex ## Usage instructions ---- ### To install all dependency packages, including SDR, on node: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory site.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` ### To uninstall SDR: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory uninstall_powerflex.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` Sample playbooks and inventory can be found in the playbooks directory. diff --git a/roles/powerflex_sdr/tasks/add_sdr.yml b/roles/powerflex_sdr/tasks/add_sdr.yml index c3cdc20..ecd816a 100644 --- a/roles/powerflex_sdr/tasks/add_sdr.yml +++ b/roles/powerflex_sdr/tasks/add_sdr.yml @@ -1,4 +1,18 @@ --- +- name: Get configured MDM IP addresses + dellemc.powerflex.mdm_cluster: + hostname: "{{ hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: "{{ validate_certs }}" + state: "present" + register: powerflex_sdr_mdm_ip_result + delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" + +- name: Set fact - PowerFlex version + ansible.builtin.set_fact: + powerflex_sdr_array_version: "{{ powerflex_sdr_mdm_ip_result.mdm_cluster_details.master.versionInfo[1] }}" + - name: Checking powerflex_protection_domain_name and powerflex_storage_pool_name is provided ansible.builtin.set_fact: powerflex_add_sdr_output: @@ -12,7 +26,7 @@ - name: Include install_powerflex.yml ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml -- name: Login to mdm +- name: Login to mdm for PowerFlex version below 4.x ansible.builtin.command: > scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} --username admin @@ -23,6 +37,20 @@ delegate_to: "{{ powerflex_mdm_primary_hostname }}" changed_when: powerflex_initial_login.rc == 0 no_log: true + when: powerflex_sdr_array_version == "3" + +- name: Login to mdm for PowerFlex version 4.x + ansible.builtin.command: > + scli --login --management_system_ip {{ hostname }} + --username admin + --password "{{ powerflex_mdm_password }}" + --approve_certificate + run_once: true + register: powerflex_initial_login + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + changed_when: powerflex_initial_login.rc == 0 + no_log: true + when: powerflex_sdr_array_version != "3" - name: Output msg of previous task login to mdm ansible.builtin.debug: @@ -54,7 +82,7 @@ register: powerflex_get_replication_capacity changed_when: powerflex_get_replication_capacity.rc == 0 -- name: Checking if SDR already exists or not +- name: Checking if SDR already exists or not for PowerFlex version below 4.x ansible.builtin.command: > scli --mdm_ip {{ powerflex_mdm_primary_ip }} --query_sdr @@ -63,6 +91,19 @@ register: check_sdr_exists changed_when: check_sdr_exists.rc == 0 failed_when: false + when: powerflex_sdr_array_version == "3" + + +- name: Checking if SDR already exists or not for PowerFlex version 4.x + ansible.builtin.command: > + scli --management_system_ip {{ hostname }} + --query_sdr + --sdr_name "{{ powerflex_sdr_hostname }}" + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + register: check_sdr_exists + changed_when: check_sdr_exists.rc == 0 + failed_when: false + when: powerflex_sdr_array_version != "3" - name: Skipping add SDR if already exists ansible.builtin.debug: @@ -70,7 +111,7 @@ when: check_sdr_exists.rc == 0 delegate_to: "{{ powerflex_mdm_primary_hostname }}" -- name: Adding SDR +- name: Adding SDR for PowerFlex version below 4.x ansible.builtin.command: > scli --add_sdr --mdm_ip {{ powerflex_mdm_primary_ip }} --sdr_ip_role all @@ -80,7 +121,19 @@ register: powerflex_add_sdr_output delegate_to: "{{ powerflex_mdm_primary_hostname }}" changed_when: powerflex_add_sdr_output.rc == 0 - when: check_sdr_exists.rc == 7 + when: check_sdr_exists.rc == 7 and powerflex_sdr_array_version == "3" + +- name: Adding SDR for PowerFlex version 4.x + ansible.builtin.command: > + scli --add_sdr --management_system_ip {{ hostname }} + --sdr_ip_role all + --sdr_ip {{ powerflex_sdr_ip }} + --sdr_name "{{ powerflex_sdr_hostname }}" + --protection_domain_name {{ powerflex_protection_domain_name }} + register: powerflex_add_sdr_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + changed_when: powerflex_add_sdr_output.rc == 0 + when: check_sdr_exists.rc == 7 and powerflex_sdr_array_version != "3" - name: Logging out of the mdm ansible.builtin.command: scli --logout diff --git a/roles/powerflex_sdr/tasks/remove_sdr.yml b/roles/powerflex_sdr/tasks/remove_sdr.yml index 1c01cea..4d3c241 100644 --- a/roles/powerflex_sdr/tasks/remove_sdr.yml +++ b/roles/powerflex_sdr/tasks/remove_sdr.yml @@ -1,8 +1,22 @@ --- +- name: Get configured MDM IP addresses + dellemc.powerflex.mdm_cluster: + hostname: "{{ hostname }}" + username: "{{ username }}" + password: "{{ password }}" + validate_certs: "{{ validate_certs }}" + state: "present" + register: powerflex_sdr_mdm_ip_result + delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" + +- name: Set fact - PowerFlex version + ansible.builtin.set_fact: + powerflex_sdr_array_version: "{{ powerflex_sdr_mdm_ip_result.mdm_cluster_details.master.versionInfo[1] }}" + - name: Include the sdr_set_facts.yml ansible.builtin.include_tasks: sdr_set_facts.yml -- name: Login to mdm +- name: Login to mdm for PowerFlex version below 4.x ansible.builtin.command: > scli --login --mdm_ip {{ powerflex_mdm_primary_ip }} --username admin @@ -13,13 +27,27 @@ delegate_to: "{{ powerflex_mdm_primary_hostname }}" changed_when: powerflex_initial_login.rc == 0 no_log: true + when: powerflex_sdr_array_version == "3" + +- name: Login to mdm for PowerFlex version 4.x + ansible.builtin.command: > + scli --login --management_system_ip {{ hostname }} + --username admin + --password "{{ powerflex_mdm_password }}" + --approve_certificate + run_once: true + register: powerflex_initial_login + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + changed_when: powerflex_initial_login.rc == 0 + no_log: true + when: powerflex_sdr_array_version != "3" - name: Output msg of previous task login to mdm ansible.builtin.debug: var: powerflex_initial_login.stdout delegate_to: "{{ powerflex_mdm_primary_hostname }}" -- name: Checking if SDR already exists or not +- name: Checking if SDR already exists or not for PowerFlex version below 4.x ansible.builtin.command: > scli --mdm_ip {{ powerflex_mdm_primary_ip }} --query_sdr @@ -28,6 +56,18 @@ register: check_sdr_exists failed_when: false changed_when: check_sdr_exists.rc == 0 + when: powerflex_sdr_array_version == "3" + +- name: Checking if SDR already exists or not for PowerFlex version 4.x + ansible.builtin.command: > + scli --management_system_ip {{ hostname }} + --query_sdr + --sdr_name "{{ powerflex_sdr_hostname }}" + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + register: check_sdr_exists + failed_when: false + changed_when: check_sdr_exists.rc == 0 + when: powerflex_sdr_array_version != "3" - name: Skipping remove SDR if does not exist ansible.builtin.debug: @@ -35,14 +75,23 @@ when: check_sdr_exists.rc == 7 delegate_to: "{{ powerflex_mdm_primary_hostname }}" -- name: Removing SDR +- name: Removing SDR for PowerFlex version below 4.x ansible.builtin.command: > scli --remove_sdr --mdm_ip {{ powerflex_mdm_primary_ip }} --sdr_name "{{ powerflex_sdr_hostname }}" register: powerflex_remove_sdr_output delegate_to: "{{ powerflex_mdm_primary_hostname }}" changed_when: powerflex_remove_sdr_output.rc == 0 - when: check_sdr_exists.rc == 0 + when: check_sdr_exists.rc == 0 and powerflex_sdr_array_version == "3" + +- name: Removing SDR for PowerFlex version 4.x + ansible.builtin.command: > + scli --remove_sdr --management_system_ip {{ hostname }} + --sdr_name "{{ powerflex_sdr_hostname }}" + register: powerflex_remove_sdr_output + delegate_to: "{{ powerflex_mdm_primary_hostname }}" + changed_when: powerflex_remove_sdr_output.rc == 0 + when: check_sdr_exists.rc == 0 and powerflex_sdr_array_version != "3" - name: Uninstall package register: powerflex_sdr_uninstall_output diff --git a/roles/powerflex_sds/README.md b/roles/powerflex_sds/README.md index bde8641..af70611 100644 --- a/roles/powerflex_sds/README.md +++ b/roles/powerflex_sds/README.md @@ -2,6 +2,15 @@ Role to manage the installation and uninstallation of Powerflex SDS. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` @@ -206,10 +215,24 @@ dellemc.powerflex ## Usage instructions ---- ### To install all dependency packages, including SDS, on node: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory site.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` ### To uninstall SDS: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory uninstall_powerflex.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` Sample playbooks and inventory can be found in the playbooks directory. diff --git a/roles/powerflex_sds/tasks/install_sds.yml b/roles/powerflex_sds/tasks/install_sds.yml index 626df97..bcaa76c 100644 --- a/roles/powerflex_sds/tasks/install_sds.yml +++ b/roles/powerflex_sds/tasks/install_sds.yml @@ -6,12 +6,16 @@ password: "{{ password }}" validate_certs: "{{ validate_certs }}" state: "present" - register: powerflex_sds_result + register: powerflex_sds_mdm_ip_result delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" +- name: Set fact - PowerFlex version + ansible.builtin.set_fact: + powerflex_sds_array_version: "{{ powerflex_sds_mdm_ip_result.mdm_cluster_details.master.versionInfo[1] }}" + - name: Set fact - powerflex_sds_mdm_ips ansible.builtin.set_fact: - powerflex_sds_mdm_ips: "{{ powerflex_sds_result.mdm_cluster_details.mdmAddresses | join(',') }}" + powerflex_sds_mdm_ips: "{{ powerflex_sds_mdm_ip_result.mdm_cluster_details.mdmAddresses | join(',') }}" - name: Include install_powerflex.yml ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml @@ -30,12 +34,21 @@ ansible.builtin.set_fact: disks: "{{ powerflex_sds_disks }}" -- name: Login to mdm +- name: Login to MDM for PowerFlex version 4.x + ansible.builtin.command: scli --login --management_system_ip {{ hostname }} --username {{ username }} --password {{ password }} --approve_certificate + run_once: true + register: powerflex_sds_login_output + changed_when: powerflex_sds_login_output.rc == 0 + delegate_to: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" + when: powerflex_sds_array_version != "3" + +- name: Login to MDM for PowerFlex version below 4.x ansible.builtin.command: scli --login --username {{ username }} --password {{ password }} --approve_certificate run_once: true register: powerflex_sds_login_output changed_when: powerflex_sds_login_output.rc == 0 delegate_to: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" + when: powerflex_sds_array_version == "3" - name: Create SDS dellemc.powerflex.sds: @@ -54,9 +67,21 @@ delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" when: powerflex_sds_fault_set is not defined -- name: Add SDS with fault set +- name: Add SDS with fault set for PowerFlex version 4.x + ansible.builtin.command: + scli --add_sds --management_system_ip {{ hostname }} + --sds_ip {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} + --storage_pool_name {{ powerflex_sds_storage_pool }} --sds_name "{{ inventory_hostname }}" + --protection_domain_name {{ powerflex_sds_protection_domain }} --fault_set_name {{ powerflex_sds_fault_set }} + register: add_sds + changed_when: ('already in use' in add_sds.stderr) or (add_sds.rc == 0) + delegate_to: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" + ignore_errors: true + when: powerflex_sds_fault_set is defined and powerflex_sds_array_version != "3" + +- name: Add SDS with fault set for PowerFlex version below 4.x ansible.builtin.command: - scli --add_sds --mdm_ip {{ powerflex_mdm_ips }} + scli --add_sds --mdm_ip {{ powerflex_sds_mdm_ips }} --sds_ip {{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} --storage_pool_name {{ powerflex_sds_storage_pool }} --sds_name "{{ inventory_hostname }}" --protection_domain_name {{ powerflex_sds_protection_domain }} --fault_set_name {{ powerflex_sds_fault_set }} @@ -64,7 +89,7 @@ changed_when: ('already in use' in add_sds.stderr) or (add_sds.rc == 0) delegate_to: "{{ hostvars[groups['mdm'][0]]['inventory_hostname'] }}" ignore_errors: true - when: powerflex_sds_fault_set is defined + when: powerflex_sds_fault_set is defined and powerflex_sds_array_version == "3" - name: Add a device dellemc.powerflex.device: diff --git a/roles/powerflex_tb/README.md b/roles/powerflex_tb/README.md index 9b46b74..c1df43b 100644 --- a/roles/powerflex_tb/README.md +++ b/roles/powerflex_tb/README.md @@ -2,6 +2,16 @@ Role to manage the installation and uninstallation of Powerflex TB. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Notes](#notes) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` @@ -121,38 +131,6 @@ dellemc.powerflex str ThreeNodes - - powerflex_protection_domain_name - false - Name of the protection domain.
- - str - tb_protection_domain - - - powerflex_fault_sets - false - List of fault sets.
- - list - ['fs1','fs2','fs3'] - - - powerflex_media_type - false - Media type of the storage pool.
- 'SSD', 'HDD', 'TRANSITIONAL' - str - SSD> - - - powerflex_storage_pool_name - false - Name of the storage pool.
- - str - tb_storage_pool - @@ -171,13 +149,6 @@ dellemc.powerflex powerflex_tb_primary_name: "primary_tb" powerflex_tb_secondary_name: "secondary_tb" powerflex_tb_cluster_mode: "ThreeNodes" - powerflex_protection_domain_name: "tb_protection_domain" - powerflex_fault_sets: - - 'fs1' - - 'fs2' - - 'fs3' - powerflex_media_type: 'SSD' - powerflex_storage_pool_name: "tb_storage_pool" powerflex_common_file_install_location: "/var/tmp" powerflex_tb_state: present @@ -194,22 +165,35 @@ dellemc.powerflex ``` +## Notes +---- + +- As a pre-requisite, the Gateway must be installed. + ## Usage instructions ---- ### To install all dependency packages, including TB, on node: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory site.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory site_powerflex45.yml + ``` ### To uninstall TB: +- PowerFlex 3.6: + ``` ansible-playbook -i inventory uninstall_powerflex.yml + ``` +- PowerFlex 4.5: + ``` + ansible-playbook -i inventory uninstall_powerflex45.yml + ``` Sample playbooks and inventory can be found in the playbooks directory. -## Notes ----- - -- As a pre-requisite, the Gateway must be installed. -- TRANSITIONAL media type is supported only during modification. - ## Author Information ------------------ diff --git a/roles/powerflex_tb/defaults/main.yml b/roles/powerflex_tb/defaults/main.yml index c16b8fb..b4b0b5a 100644 --- a/roles/powerflex_tb/defaults/main.yml +++ b/roles/powerflex_tb/defaults/main.yml @@ -3,10 +3,6 @@ powerflex_tb_primary_name: primary_tb powerflex_tb_secondary_name: secondary_tb powerflex_tb_cluster_mode: "ThreeNodes" -powerflex_protection_domain_name: "tb_protection_domain" -powerflex_fault_sets: ['fs1', 'fs2', 'fs3'] -powerflex_media_type: 'SSD' # When version is R3 -powerflex_storage_pool_name: "tb_storage_pool" file_glob_name: mdm powerflex_role_environment: MDM_IP: "{{ powerflex_tb_mdm_ips }}" diff --git a/roles/powerflex_tb/molecule/tb_installation/converge.yml b/roles/powerflex_tb/molecule/tb_installation/converge.yml index 077e509..77d00ec 100644 --- a/roles/powerflex_tb/molecule/tb_installation/converge.yml +++ b/roles/powerflex_tb/molecule/tb_installation/converge.yml @@ -33,39 +33,3 @@ that: - powerflex_tb_cluster_to_five_output.stdout == "Successfully switched the cluster mode." when: not ansible_check_mode and powerflex_tb_cluster_to_five_output.changed and powerflex_tb_cluster_mode == "FiveNodes" - - - name: "Verifying protection domain creation" - ansible.builtin.assert: - that: - - powerflex_tb_add_pd_output.protection_domain_details.name == powerflex_protection_domain_name - when: not ansible_check_mode and powerflex_tb_add_pd_output.changed - - - name: "Verifying storage pool R2 creation" - ansible.builtin.assert: - that: - - powerflex_tb_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name - when: not ansible_check_mode and powerflex_tb_storage_pool_output.changed - - - name: "Verifying storage pool R3 creation" - ansible.builtin.assert: - that: - - powerflex_tb_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name - when: not ansible_check_mode and powerflex_tb_storage_pool_output.changed and powerflex_media_type is not none - - - name: "Verifying protection domain creation in Idempotency" - ansible.builtin.assert: - that: - - powerflex_tb_add_pd_output.protection_domain_details.name == powerflex_protection_domain_name - when: not ansible_check_mode and not powerflex_tb_add_pd_output.changed - - - name: "Verifying storage pool R2 creation in Idempotency" - ansible.builtin.assert: - that: - - powerflex_tb_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name - when: not ansible_check_mode and not powerflex_tb_storage_pool_output.changed - - - name: "Verifying storage pool R3 creation in Idempotency" - ansible.builtin.assert: - that: - - powerflex_tb_storage_pool_output.storage_pool_details.name == powerflex_storage_pool_name - when: not ansible_check_mode and not powerflex_tb_storage_pool_output.changed and powerflex_media_type is not none diff --git a/roles/powerflex_tb/tasks/install_tb.yml b/roles/powerflex_tb/tasks/install_tb.yml index 8373979..8bec6fb 100644 --- a/roles/powerflex_tb/tasks/install_tb.yml +++ b/roles/powerflex_tb/tasks/install_tb.yml @@ -6,12 +6,12 @@ password: "{{ password }}" validate_certs: "{{ validate_certs }}" state: "present" - register: powerflex_tb_mdm_result + register: powerflex_tb_mdm_ip_result delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" - name: Set fact - powerflex_mdm_ips ansible.builtin.set_fact: - powerflex_tb_mdm_ips: "{{ powerflex_tb_mdm_result.mdm_cluster_details.mdmAddresses | join(',') }}" + powerflex_tb_mdm_ips: "{{ powerflex_tb_mdm_ip_result.mdm_cluster_details.mdmAddresses | join(',') }}" - name: Include install_powerflex.yml ansible.builtin.include_tasks: ../../powerflex_common/tasks/install_powerflex.yml @@ -89,62 +89,3 @@ changed_when: powerflex_tb_cluster_to_five_output.rc == 0 delegate_to: "{{ powerflex_tb_mdm_primary_hostname }}" when: powerflex_tb_primary_output.mdm_cluster_details.clusterMode != "FiveNodes" and powerflex_tb_cluster_mode == "FiveNodes" - -- name: Create the protection domain - dellemc.powerflex.protection_domain: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - port: "{{ port }}" - protection_domain_name: "{{ powerflex_protection_domain_name }}" - state: "present" - register: powerflex_tb_add_pd_output - delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" - -- name: Add fault set - ansible.builtin.command: scli --add_fault_set --protection_domain_name "{{ powerflex_protection_domain_name }}" --fault_set_name "{{ item }}" - with_items: "{{ powerflex_fault_sets }}" - run_once: true - delegate_to: "{{ powerflex_tb_mdm_primary_hostname }}" - register: powerflex_tb_add_fs_output - ignore_errors: true - changed_when: powerflex_tb_add_fs_output.rc == 0 - when: - - powerflex_fault_sets is defined - -- name: Create a new storage pool in R2 version - dellemc.powerflex.storagepool: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - storage_pool_name: "{{ powerflex_storage_pool_name }}" - protection_domain_name: "{{ powerflex_protection_domain_name }}" - state: "present" - register: powerflex_tb_storage_pool_output - delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" - when: powerflex_tb_scaleio_version.stdout == "R2" - -- name: Create a new storage pool in R3 version - dellemc.powerflex.storagepool: - hostname: "{{ hostname }}" - username: "{{ username }}" - password: "{{ password }}" - validate_certs: "{{ validate_certs }}" - storage_pool_name: "{{ powerflex_storage_pool_name }}" - protection_domain_name: "{{ powerflex_protection_domain_name }}" - media_type: "{{ powerflex_media_type }}" - state: "present" - register: powerflex_tb_storage_pool_output - delegate_to: "{{ lookup('ansible.builtin.env', 'RUNON', default='localhost') }}" - when: powerflex_tb_scaleio_version.stdout == "R3" - -- name: Enable zero-padding - ansible.builtin.command: | - scli --modify_zero_padding_policy --protection_domain_name - {{ powerflex_protection_domain_name }} --storage_pool_name {{ powerflex_storage_pool_name }} --enable_zero_padding - run_once: true - register: powerflex_tb_enable_zero_padding_output - changed_when: powerflex_tb_enable_zero_padding_output.rc == 0 - delegate_to: "{{ powerflex_tb_mdm_primary_hostname }}" diff --git a/roles/powerflex_webui/README.md b/roles/powerflex_webui/README.md index 5f005b8..794eb6b 100644 --- a/roles/powerflex_webui/README.md +++ b/roles/powerflex_webui/README.md @@ -2,6 +2,16 @@ Role to manage the installation and uninstallation of Powerflex Web UI. +## Table of contents + +* [Requirements](#requirements) +* [Ansible collections](#ansible-collections) +* [Role Variables](#role-variables) +* [Examples](#examples) +* [Notes](#notes) +* [Usage instructions](#usage-instructions) +* [Author Information](#author-information) + ## Requirements ``` @@ -132,7 +142,7 @@ dellemc.powerflex ``` ## Notes -- Supported only in PowerFlex version 3.6 +- Supported only in PowerFlex version 3.6. ## Usage instructions ----