Skip to content

Commit

Permalink
Feat/1.5.0 release Docs and examples (#261)
Browse files Browse the repository at this point in the history
* recovery plan docs

* doc changes

* Update README.md (#255)

Add link to getting with nutanix asible blog

* Minor doc fix

* sanity fix

* sanity fixes
  • Loading branch information
bhati-pradeep authored Aug 29, 2022
1 parent 26faae6 commit d11672f
Show file tree
Hide file tree
Showing 10 changed files with 1,843 additions and 3 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## v1.5.0 (26 Aug 2022)

**Features**

**Prism Central Disaster Recovery**
- Ansible module for Protection Rules
- Ansible info module for Protection Rules
- Ansible module for Recovery Plans
- Ansible info module Recovery Plans
- Ansible module for Recovery Plan Jobs
- Ansible info module Recovery Plan Jobs

**Full Changelog:** [here](https://github.com/nutanix/nutanix.ansible/compare/v1.4.0...v1.5.0)

## v1.4.0 (28 July 2022)

**Features**
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ It is designed keeping simplicity as the core value. Hence it is
1. Easy to use
2. Easy to develop

Checkout this [blog](https://www.nutanix.dev/2022/08/05/getting-started-with-the-nutanix-ansible-module/) for getting started with nutanix ansible module.

# Version compatibility

## Ansible
> This collection has been tested against following versions:
This collection has been tested against following versions:
1. ansible==5.0.1
2. ansible-core==2.12.3

## Python
> This collection requires Python 2.7 or greater
This collection requires Python 2.7 or greater

## Prism Cenral
> 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.
Expand All @@ -27,6 +29,8 @@ It is designed keeping simplicity as the core value. Hence it is
> 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.
> 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.
### Notes:
1. Static routes module (ntnx_static_routes) is supported for PC versions >= pc.2022.1

Expand Down Expand Up @@ -131,6 +135,12 @@ ansible-playbook examples/iaas/iaas.yml
| ntnx_permissions_info | List permissions info |
| ntnx_projects | create, update and delete pc projects |
| ntnx_projects_info | Get projects info. |
| ntnx_protection_rules | create, update and delete pc protection rules |
| ntnx_protection_rules_info | Get pc protection rules info. |
| ntnx_recovery_plans | create, update and delete pc recovery plans |
| ntnx_recovery_plans_info | Get pc recovery plans info. |
| ntnx_recovery_plan_jobs | create and perform action on pc recovery plans |
| ntnx_recovery_plan_jobs_info | Get pc recovery plan jobs info. |
| ntnx_roles | Create, Update, Delete Nutanix roles |
| ntnx_roles_info | Get roles info. |
| ntnx_security_rules | Create, update or delete a Security Rule. |
Expand Down
168 changes: 168 additions & 0 deletions examples/dr/protection_policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
######## Description ###########
# Tasks done by this playbook:
# 1. Create synchronous protection policy and asynchronous protection policy
# 2. Update protection policy
# 3. Get created protection plans info and associated entities
# 4. Delete protection plan from primary site.
#################################


- name: PC DR
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
tasks:
- name: Create protection rule with synchronous schedule
ntnx_protection_rules:
nutanix_host: "<pc-ip>"
nutanix_username: "<pc-username>"
nutanix_password: "<pc-password>"
validate_certs: false
state: present
wait: True
name: test-ansible
desc: test-ansible-desc
protected_categories:
Environment:
- Dev
- Staging
primary_site:
availability_zone_url: "<primary-az-url>"
schedules:
- source:
availability_zone_url: "<primary-az-url>"
destination:
availability_zone_url: "<recovery-az-url>"
protection_type: SYNC
auto_suspend_timeout: 20
- source:
availability_zone_url: "<recovery-az-url>"
destination:
availability_zone_url: "<primary-az-url>"
protection_type: SYNC
auto_suspend_timeout: 10
register: pr

- name: delete the protection rule
ntnx_protection_rules:
nutanix_host: "<pc-ip>"
nutanix_username: "<pc-username>"
nutanix_password: "<pc-password>"
validate_certs: false
state: "absent"
rule_uuid: "{{pr.rule_uuid}}"

- name: Create protection rule with async schedule
ntnx_protection_rules:
nutanix_host: "<pc-ip>"
nutanix_username: "<pc-username>"
nutanix_password: "<pc-password>"
validate_certs: false
state: present
wait: True
name: test-ansible-1
desc: test-ansible-desc-1
protected_categories:
Environment:
- Dev
- Testing
primary_site:
availability_zone_url: "<primary-az-url>"
schedules:
- source:
availability_zone_url: "<primary-az-url>"
destination:
availability_zone_url: "<recovery-az-url>"
protection_type: ASYNC
rpo: 1
rpo_unit: HOUR
snapshot_type: "CRASH_CONSISTENT"
local_retention_policy:
num_snapshots: 1
remote_retention_policy:
rollup_retention_policy:
snapshot_interval_type: HOURLY
multiple: 2

- source:
availability_zone_url: "<recovery-az-url>"
destination:
availability_zone_url: "<primary-az-url>"
protection_type: ASYNC
rpo: 1
rpo_unit: HOUR
snapshot_type: "CRASH_CONSISTENT"
local_retention_policy:
num_snapshots: 2
remote_retention_policy:
num_snapshots: 1
register: result

- name: Update previously created protection policy
ntnx_protection_rules:
nutanix_host: "<pc-ip>"
nutanix_username: "<pc-username>"
nutanix_password: "<pc-password>"
validate_certs: false
state: present
wait: True
rule_uuid: "{{result.rule_uuid}}"
name: test-ansible-updated
desc: test-ansible-desc-updated
protected_categories:
Environment:
- Testing
primary_site:
availability_zone_url: "<primary-az-url>"
schedules:
- source:
availability_zone_url: "<primary-az-url>"
destination:
availability_zone_url: "<recovery-az-url>"
protection_type: ASYNC
rpo: 2
rpo_unit: DAY
snapshot_type: "APPLICATION_CONSISTENT"
local_retention_policy:
num_snapshots: 1
remote_retention_policy:
rollup_retention_policy:
snapshot_interval_type: YEARLY
multiple: 2

- source:
availability_zone_url: "<recovery-az-url>"
destination:
availability_zone_url: "<primary-az-url>"
protection_type: ASYNC
rpo: 2
rpo_unit: DAY
snapshot_type: "APPLICATION_CONSISTENT"
local_retention_policy:
num_snapshots: 1
remote_retention_policy:
num_snapshots: 2
register: pr

- name: Get protection policy info and its associated vms info
ntnx_protection_rules_info:
nutanix_host: "<pc-ip>"
nutanix_username: "<pc-username>"
nutanix_password: "<pc-password>"
validate_certs: false
rule_uuid: "{{pr.rule_uuid}}"
register: result

- debug:
msg: "{{result}}"

- name: delete the protection rule
ntnx_protection_rules:
nutanix_host: "<pc-ip>"
nutanix_username: "<pc-username>"
nutanix_password: "<pc-password>"
validate_certs: false
state: "absent"
rule_uuid: "{{pr.rule_uuid}}"

Loading

0 comments on commit d11672f

Please sign in to comment.