Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDT deployment role #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
6 changes: 6 additions & 0 deletions playbooks/roles/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,9 @@ powerflex_gateway_is_redundant: false
#powerflex sdr params
powerflex_protection_domain_name: domain1
powerflex_storage_pool_name: pool1
#powerflex sdt params
powerflex_sdt_storage_port: 12200
powerflex_sdt_nvme_port: 4420
powerflex_sdt_discovery_port: 8009
powerflex_sdt_protection_domain: PD1
powerflex_sdt_state: present
3 changes: 3 additions & 0 deletions playbooks/roles/host_vars/sdt1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#powerflex sdt params
powerflex_sdt_ip_list: 10.x.x.1,10.x.x.2
powerflex_sdt_role_list: storage_and_host,storage_and_host
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line missing,

3 changes: 3 additions & 0 deletions playbooks/roles/host_vars/sdt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#powerflex sdt params
powerflex_sdt_ip_list: 10.x.y.1,10.x.y.2
powerflex_sdt_role_list: storage_and_host,storage_and_host
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line missing,

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.x ansible_port=22 ansible_ssh_pass=password ansible_user=root
sdt2 ansible_host=10.x.x.y ansible_port=22 ansible_ssh_pass=password ansible_user=root

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

[sdt]
sdt1
sdt2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line is missing.

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

- 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
212 changes: 212 additions & 0 deletions roles/powerflex_sdt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# 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_ip_list</td>
<td>true</td>
<td>Target IP list of SDT. Comma separated.</td>
<td></td>
<td>str</td>
<td></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_role_list</td>
<td>true</td>
<td>Role list of SDT target IP. Comma separated.</td>
<td>storage_only, host_only, storage_and_host</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: PD1
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 (yuhao_liu@Dell.com) 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file_glob_name, i_am_sure if these vars are not user inputs, move this to vars/main.yml
lets follow role_name_ convention, if these are role inputs, and update the doc and arg spec accordingly.

powerflex_sdt_state: present
powerflex_sdt_storage_port: 12200
powerflex_sdt_nvme_port: 4420
powerflex_sdt_discovery_port: 8009
Loading
Loading