Skip to content

Commit

Permalink
SDT deployment role
Browse files Browse the repository at this point in the history
  • Loading branch information
RayLiu7 committed Oct 15, 2024
1 parent 27ecbd2 commit d27470b
Show file tree
Hide file tree
Showing 19 changed files with 635 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ roles/powerflex_sdc/vars/main.yml var-naming[no-role-prefix]
roles/powerflex_sdr/defaults/main.yml var-naming[no-role-prefix]
roles/powerflex_sds/defaults/main.yml var-naming[no-role-prefix]
roles/powerflex_sds/vars/main.yml var-naming[no-role-prefix]
roles/powerflex_sdt/defaults/main.yml var-naming[no-role-prefix]
roles/powerflex_sdt/vars/main.yml var-naming[no-role-prefix]
roles/powerflex_tb/defaults/main.yml var-naming[no-role-prefix]
roles/powerflex_tb/vars/main.yml var-naming[no-role-prefix]
roles/powerflex_webui/defaults/main.yml var-naming[no-role-prefix]
Expand All @@ -24,4 +26,5 @@ roles/powerflex_lia/molecule/lia_installation_invalid_path_rpm/converge.yml var-
roles/powerflex_sdc/molecule/sdc_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix]
roles/powerflex_sdr/molecule/sdr_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix]
roles/powerflex_sds/molecule/sds_installation/converge.yml var-naming[no-role-prefix]
roles/powerflex_sdt/molecule/sdt_installation/converge.yml var-naming[no-role-prefix]
roles/powerflex_webui/molecule/webui_installation_invalid_path_rpm/converge.yml var-naming[no-role-prefix]
4 changes: 2 additions & 2 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs"

- name: Store migrated collection artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: collection
path: .cache/collection-tarballs
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
run: pip install ansible-lint --disable-pip-version-check

- name: Download migrated collection artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: collection
path: .cache/collection-tarballs
Expand Down
7 changes: 7 additions & 0 deletions playbooks/roles/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,10 @@ powerflex_gateway_is_redundant: false
#powerflex sdr params
powerflex_protection_domain_name: domain1
powerflex_storage_pool_name: pool1
#powerflex sdt params
powerflex_sdt_role: storage_and_host
powerflex_sdt_storage_port: 12200
powerflex_sdt_nvme_port: 4420
powerflex_sdt_discovery_port: 8009
powerflex_sdt_protection_domain: PD1
powerflex_sdt_state: present
6 changes: 6 additions & 0 deletions playbooks/roles/inventory
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node0 ansible_host=10.1.1.1 ansible_port=22 ansible_ssh_pass=password ansible_user=root
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
sdt1 ansible_host=10.x.x.y ansible_port=22 ansible_ssh_pass=password ansible_user=root ansible_ip_list=10.x.1.1,10.x.1.2 ansible_role_list=storage_and_host,storage_and_host
sdt2 ansible_host=10.x.x.y ansible_port=22 ansible_ssh_pass=password ansible_user=root ansible_ip_list=10.x.2.1,10.x.2.2 ansible_role_list=storage_and_host,storage_and_host

[activemq]
node0
Expand Down Expand Up @@ -39,3 +41,7 @@ node1
node0
node1
node2

[sdt]
sdt1
sdt2
7 changes: 7 additions & 0 deletions playbooks/roles/site_powerflex45.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@
- vars_files/connection.yml
roles:
- powerflex_sdr

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.16)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.15)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.17)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, devel)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.15)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.15)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.16)

yaml[trailing-spaces]

Trailing spaces

Check failure on line 60 in playbooks/roles/site_powerflex45.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.17)

yaml[trailing-spaces]

Trailing spaces
- name: Install and configure PowerFlex SDT
hosts: sdt
vars_files:
- vars_files/connection.yml
roles:
- powerflex_sdt
9 changes: 9 additions & 0 deletions playbooks/roles/uninstall_powerflex45.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@
- vars_files/connection.yml
roles:
- powerflex_activemq

- name: Uninstall PowerFlex SDT
hosts: sdt
vars_files:
- vars_files/connection.yml
roles:
- powerflex_sdt
vars:
powerflex_sdt_state: absent
9 changes: 9 additions & 0 deletions roles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Here is the list of supported roles.
├── powerflex_lia
├── powerflex_tb
├── powerflex_sds
├── powerflex_sdt
├── powerflex_config
├── powerflex_activeMQ
Expand Down Expand Up @@ -59,6 +60,10 @@ Below is the brief description of each role
<td>powerflex_sds</td>
<td>Role to manage the installation and uninstallation of Powerflex SDS.</td>
</tr>
<tr>
<td>powerflex_sdt</td>
<td>Role to manage the installation and uninstallation of Powerflex SDT.</td>
</tr>
<tr>
<td>powerflex_tb</td>
<td>Role to manage the installation and uninstallation of Powerflex TB.</td>
Expand Down Expand Up @@ -109,6 +114,10 @@ Below is the list of full form of the acronyms which are refered throughout the
<td>SDS</td>
<td>Storage Data Server.</td>
</tr>
<tr>
<td>SDT</td>
<td>Storage Data Target.</td>
</tr>
<tr>
<td>TB</td>
<td>Tie Breaker.</td>
Expand Down
196 changes: 196 additions & 0 deletions roles/powerflex_sdt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# powerflex_sdt

Role to manage the installation and uninstallation of Powerflex SDT.

## Table of contents

* [Requirements](#requirements)
* [Ansible collections](#ansible-collections)
* [Role Variables](#role-variables)
* [Examples](#examples)
* [Usage instructions](#usage-instructions)
* [Author Information](#author-information)

## Requirements

```
ansible
python
```

## Ansible collections

Collections required to use the role.

```
dellemc.powerflex
```

## Role Variables

<table>
<thead>
<tr>
<th>Name</th>
<th>Required</th>
<th>Description</th>
<th>Choices</th>
<th>Type</th>
<th>Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>hostname</td>
<td>true</td>
<td>IP or FQDN of the PowerFlex gateway.</td>
<td></td>
<td>str</td>
<td>10.1.1.1</td>
</tr>
<tr>
<td>username</td>
<td>true</td>
<td>The username of the PowerFlex gateway.</td>
<td></td>
<td>str</td>
<td>admin</td>
</tr>
<tr>
<td>password</td>
<td>true</td>
<td>The password of the PowerFlex gateway.</td>
<td></td>
<td>str</td>
<td>password</td>
</tr>
<tr>
<td>port</td>
<td>false</td>
<td>Port</td>
<td></td>
<td>int</td>
<td>443</td>
</tr>
<tr>
<td>validate_certs</td>
<td>false</td>
<td>If C(false), the SSL certificates will not be validated.<br>Configure C(false) only on personally controlled sites where self-signed certificates are used.</td>
<td></td>
<td>bool</td>
<td>false</td>
</tr>
<tr>
<td>timeout</td>
<td>false</td>
<td>Timeout</td>
<td></td>
<td>int</td>
<td>120</td>
</tr>
<tr>
<td>powerflex_common_file_install_location</td>
<td>true</td>
<td>Location of installation and rpm gpg files to be installed.
<br>The required, compatible installation software package based on the operating system of the node.
<br>The files can be downloaded from the Dell Product support page for PowerFlex software.</td>
<td></td>
<td>str</td>
<td>/var/tmp</td>
</tr>
<tr>
<td>powerflex_sdt_discovery_port</td>
<td>false</td>
<td>Port used by the NVMe hosts for discovery. Set to 1 in order to indicate no use of discovery port.</td>
<td></td>
<td>int</td>
<td>8009</td>
</tr>
<tr>
<td>powerflex_sdt_nvme_port</td>
<td>false</td>
<td>Port used by the NVMe hosts</td>
<td></td>
<td>int</td>
<td>4420</td>
</tr>
<tr>
<td>powerflex_sdt_protection_domain</td>
<td>true</td>
<td>The name of the protection domain to which the SDT will be added.
</td>
<td></td>
<td>str</td>
<td></td>
</tr>
<tr>
<td>powerflex_sdt_state</td>
<td>false</td>
<td>State of the SDT.</td>
<td>present, absent</td>
<td>str</td>
<td>present</td>
</tr>
<tr>
<td>powerflex_sdt_storage_port</td>
<td>false</td>
<td>Port assigned to the SDT.</td>
<td></td>
<td>int</td>
<td>12200</td>
</tr>
</tbody>
</table>

## Examples
----
```
- name: "Install and configure powerflex SDT"
ansible.builtin.import_role:
name: "powerflex_sdt"
vars:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
port: "{{ port }}"
powerflex_sdt_protection_domain: domain1
powerflex_sdt_storage_port: 12200
powerflex_sdt_nvme_port: 4420
powerflex_sdt_discovery_port: 8009
powerflex_sdt_state: present
- name: "Uninstall powerflex SDT"
ansible.builtin.import_role:
name: "powerflex_sdt"
vars:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: "{{ validate_certs }}"
port: "{{ port }}"
powerflex_sdt_state: 'absent'
```

## Usage instructions
----
### To install all dependency packages, including SDT, on node:
- PowerFlex 4.5:
```
ansible-playbook -i inventory site_powerflex45.yml
```

### To uninstall SDT:
- 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
Yuhao Liu ([email protected]) 2024
7 changes: 7 additions & 0 deletions roles/powerflex_sdt/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
file_glob_name: sdt
i_am_sure: 1
powerflex_sdt_state: present
powerflex_sdt_storage_port: 12200
powerflex_sdt_nvme_port: 4420
powerflex_sdt_discovery_port: 8009
66 changes: 66 additions & 0 deletions roles/powerflex_sdt/meta/argument_spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
argument_specs:
main:
short_description: Role to manage the installation and uninstallation of Powerflex SDT.
description:
- Role to manage the installation and uninstallation of Powerflex SDT.
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_common_file_install_location:
description:
- Location 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.
type: str
default: /var/tmp
powerflex_sdt_discovery_port:
description:
- Port used by the NVMe hosts for discovery. Set to 1 in order to indicate no use of discovery port.
type: int
default: 8009
powerflex_sdt_nvme_port:
description:
- Port used by the NVMe hosts
type: int
default: 4420
powerflex_sdt_protection_domain:
required: true
description:
- The name of the protection domain to which the SDT will be added.
type: str
powerflex_sdt_state:
description:
- Specifies the state of SDT.
type: str
choices: ['absent', 'present']
default: present
powerflex_sdt_storage_port:
description:
- Port assigned to the SDT
type: int
default: 12200
Loading

0 comments on commit d27470b

Please sign in to comment.