Skip to content

Commit d11672f

Browse files
Feat/1.5.0 release Docs and examples (#261)
* recovery plan docs * doc changes * Update README.md (#255) Add link to getting with nutanix asible blog * Minor doc fix * sanity fix * sanity fixes
1 parent 26faae6 commit d11672f

10 files changed

+1843
-3
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## v1.5.0 (26 Aug 2022)
2+
3+
**Features**
4+
5+
**Prism Central Disaster Recovery**
6+
- Ansible module for Protection Rules
7+
- Ansible info module for Protection Rules
8+
- Ansible module for Recovery Plans
9+
- Ansible info module Recovery Plans
10+
- Ansible module for Recovery Plan Jobs
11+
- Ansible info module Recovery Plan Jobs
12+
13+
**Full Changelog:** [here](https://github.com/nutanix/nutanix.ansible/compare/v1.4.0...v1.5.0)
14+
115
## v1.4.0 (28 July 2022)
216

317
**Features**

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ It is designed keeping simplicity as the core value. Hence it is
88
1. Easy to use
99
2. Easy to develop
1010

11+
Checkout this [blog](https://www.nutanix.dev/2022/08/05/getting-started-with-the-nutanix-ansible-module/) for getting started with nutanix ansible module.
12+
1113
# Version compatibility
1214

1315
## Ansible
14-
> This collection has been tested against following versions:
16+
This collection has been tested against following versions:
1517
1. ansible==5.0.1
1618
2. ansible-core==2.12.3
1719

1820
## Python
19-
> This collection requires Python 2.7 or greater
21+
This collection requires Python 2.7 or greater
2022

2123
## Prism Cenral
2224
> For the 1.1.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc2022.1.0.2, pc.2021.9.0.5 and pc.2021.8.0.1.
@@ -27,6 +29,8 @@ It is designed keeping simplicity as the core value. Hence it is
2729
2830
> For the 1.4.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.4, pc2022.1.0.2 and pc.2021.9.0.4.
2931
32+
> For the 1.5.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.6, pc.2022.4.0.2 and pc2022.1.0.2.
33+
3034
### Notes:
3135
1. Static routes module (ntnx_static_routes) is supported for PC versions >= pc.2022.1
3236

@@ -131,6 +135,12 @@ ansible-playbook examples/iaas/iaas.yml
131135
| ntnx_permissions_info | List permissions info |
132136
| ntnx_projects | create, update and delete pc projects |
133137
| ntnx_projects_info | Get projects info. |
138+
| ntnx_protection_rules | create, update and delete pc protection rules |
139+
| ntnx_protection_rules_info | Get pc protection rules info. |
140+
| ntnx_recovery_plans | create, update and delete pc recovery plans |
141+
| ntnx_recovery_plans_info | Get pc recovery plans info. |
142+
| ntnx_recovery_plan_jobs | create and perform action on pc recovery plans |
143+
| ntnx_recovery_plan_jobs_info | Get pc recovery plan jobs info. |
134144
| ntnx_roles | Create, Update, Delete Nutanix roles |
135145
| ntnx_roles_info | Get roles info. |
136146
| ntnx_security_rules | Create, update or delete a Security Rule. |

examples/dr/protection_policy.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
######## Description ###########
2+
# Tasks done by this playbook:
3+
# 1. Create synchronous protection policy and asynchronous protection policy
4+
# 2. Update protection policy
5+
# 3. Get created protection plans info and associated entities
6+
# 4. Delete protection plan from primary site.
7+
#################################
8+
9+
10+
- name: PC DR
11+
hosts: localhost
12+
gather_facts: false
13+
collections:
14+
- nutanix.ncp
15+
tasks:
16+
- name: Create protection rule with synchronous schedule
17+
ntnx_protection_rules:
18+
nutanix_host: "<pc-ip>"
19+
nutanix_username: "<pc-username>"
20+
nutanix_password: "<pc-password>"
21+
validate_certs: false
22+
state: present
23+
wait: True
24+
name: test-ansible
25+
desc: test-ansible-desc
26+
protected_categories:
27+
Environment:
28+
- Dev
29+
- Staging
30+
primary_site:
31+
availability_zone_url: "<primary-az-url>"
32+
schedules:
33+
- source:
34+
availability_zone_url: "<primary-az-url>"
35+
destination:
36+
availability_zone_url: "<recovery-az-url>"
37+
protection_type: SYNC
38+
auto_suspend_timeout: 20
39+
- source:
40+
availability_zone_url: "<recovery-az-url>"
41+
destination:
42+
availability_zone_url: "<primary-az-url>"
43+
protection_type: SYNC
44+
auto_suspend_timeout: 10
45+
register: pr
46+
47+
- name: delete the protection rule
48+
ntnx_protection_rules:
49+
nutanix_host: "<pc-ip>"
50+
nutanix_username: "<pc-username>"
51+
nutanix_password: "<pc-password>"
52+
validate_certs: false
53+
state: "absent"
54+
rule_uuid: "{{pr.rule_uuid}}"
55+
56+
- name: Create protection rule with async schedule
57+
ntnx_protection_rules:
58+
nutanix_host: "<pc-ip>"
59+
nutanix_username: "<pc-username>"
60+
nutanix_password: "<pc-password>"
61+
validate_certs: false
62+
state: present
63+
wait: True
64+
name: test-ansible-1
65+
desc: test-ansible-desc-1
66+
protected_categories:
67+
Environment:
68+
- Dev
69+
- Testing
70+
primary_site:
71+
availability_zone_url: "<primary-az-url>"
72+
schedules:
73+
- source:
74+
availability_zone_url: "<primary-az-url>"
75+
destination:
76+
availability_zone_url: "<recovery-az-url>"
77+
protection_type: ASYNC
78+
rpo: 1
79+
rpo_unit: HOUR
80+
snapshot_type: "CRASH_CONSISTENT"
81+
local_retention_policy:
82+
num_snapshots: 1
83+
remote_retention_policy:
84+
rollup_retention_policy:
85+
snapshot_interval_type: HOURLY
86+
multiple: 2
87+
88+
- source:
89+
availability_zone_url: "<recovery-az-url>"
90+
destination:
91+
availability_zone_url: "<primary-az-url>"
92+
protection_type: ASYNC
93+
rpo: 1
94+
rpo_unit: HOUR
95+
snapshot_type: "CRASH_CONSISTENT"
96+
local_retention_policy:
97+
num_snapshots: 2
98+
remote_retention_policy:
99+
num_snapshots: 1
100+
register: result
101+
102+
- name: Update previously created protection policy
103+
ntnx_protection_rules:
104+
nutanix_host: "<pc-ip>"
105+
nutanix_username: "<pc-username>"
106+
nutanix_password: "<pc-password>"
107+
validate_certs: false
108+
state: present
109+
wait: True
110+
rule_uuid: "{{result.rule_uuid}}"
111+
name: test-ansible-updated
112+
desc: test-ansible-desc-updated
113+
protected_categories:
114+
Environment:
115+
- Testing
116+
primary_site:
117+
availability_zone_url: "<primary-az-url>"
118+
schedules:
119+
- source:
120+
availability_zone_url: "<primary-az-url>"
121+
destination:
122+
availability_zone_url: "<recovery-az-url>"
123+
protection_type: ASYNC
124+
rpo: 2
125+
rpo_unit: DAY
126+
snapshot_type: "APPLICATION_CONSISTENT"
127+
local_retention_policy:
128+
num_snapshots: 1
129+
remote_retention_policy:
130+
rollup_retention_policy:
131+
snapshot_interval_type: YEARLY
132+
multiple: 2
133+
134+
- source:
135+
availability_zone_url: "<recovery-az-url>"
136+
destination:
137+
availability_zone_url: "<primary-az-url>"
138+
protection_type: ASYNC
139+
rpo: 2
140+
rpo_unit: DAY
141+
snapshot_type: "APPLICATION_CONSISTENT"
142+
local_retention_policy:
143+
num_snapshots: 1
144+
remote_retention_policy:
145+
num_snapshots: 2
146+
register: pr
147+
148+
- name: Get protection policy info and its associated vms info
149+
ntnx_protection_rules_info:
150+
nutanix_host: "<pc-ip>"
151+
nutanix_username: "<pc-username>"
152+
nutanix_password: "<pc-password>"
153+
validate_certs: false
154+
rule_uuid: "{{pr.rule_uuid}}"
155+
register: result
156+
157+
- debug:
158+
msg: "{{result}}"
159+
160+
- name: delete the protection rule
161+
ntnx_protection_rules:
162+
nutanix_host: "<pc-ip>"
163+
nutanix_username: "<pc-username>"
164+
nutanix_password: "<pc-password>"
165+
validate_certs: false
166+
state: "absent"
167+
rule_uuid: "{{pr.rule_uuid}}"
168+

0 commit comments

Comments
 (0)