Skip to content

Commit

Permalink
Use full collection names for ntnx modules
Browse files Browse the repository at this point in the history
  • Loading branch information
bhati-pradeep committed Jan 9, 2024
1 parent 699f89c commit fccb81e
Show file tree
Hide file tree
Showing 64 changed files with 214 additions and 216 deletions.
4 changes: 2 additions & 2 deletions examples/acp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

tasks:
- name: Create ACP with all specfactions
ntnx_acps:
nutanix.ncp.ntnx_acps:
validate_certs: false
state: present
nutanix_host: "{{ IP }}"
Expand All @@ -40,7 +40,7 @@
collection: ALL

- name: Delete ACP
ntnx_acps:
nutanix.ncp.ntnx_acps:
state: absent
acp_uuid: "{{ acp_uuid }}"
register: result
4 changes: 2 additions & 2 deletions examples/acp_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

tasks:
- name: List ACPs using ascending, sorting and name filter
ntnx_floating_ips_info:
nutanix.ncp.ntnx_floating_ips_info:
filter:
name: "{{ acp_name }}"
kind: access_control_policy
Expand All @@ -23,7 +23,7 @@
ignore_errors: true

- name: List ACPs using length and offset
ntnx_floating_ips_info:
nutanix.ncp.ntnx_floating_ips_info:
length: 3
offset: 0
register: result
Expand Down
8 changes: 4 additions & 4 deletions examples/address_groups_crud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
validate_certs: false
tasks:
- name: Create a address group
ntnx_address_groups:
nutanix.ncp.ntnx_address_groups:
state: present
name: test-ansible-group-1
desc: test-ansible-group-1-desc
Expand All @@ -24,7 +24,7 @@
register: ag

- name: Update address group
ntnx_address_groups:
nutanix.ncp.ntnx_address_groups:
state: present
address_group_uuid: "{{ ag.address_group_uuid }}"
name: test-ansible-group-1-updated
Expand All @@ -35,7 +35,7 @@
register: updated_ag

- name: Read the updated address group
ntnx_address_groups_info:
nutanix.ncp.ntnx_address_groups_info:
address_group_uuid: "{{ updated_ag.address_group_uuid }}"
register: ag_info

Expand All @@ -44,7 +44,7 @@
msg: "{{ ag_info }}"

- name: Delete the address group.
ntnx_address_groups:
nutanix.ncp.ntnx_address_groups:
state: absent
address_group_uuid: "{{ updated_ag.address_group_uuid }}"
register: op
16 changes: 8 additions & 8 deletions examples/category_crud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
validate_certs: false
tasks:
- name: Create only category key with description
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: present
name: test-cat-1
desc: test-cat-1-desc
register: cat1

- name: Add category values to test-cat-1
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: present
name: test-cat-1
values:
- val1
- val2

- name: Create category key with values
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: present
name: test-cat-2
desc: test-cat-2-desc
Expand All @@ -37,33 +37,33 @@
register: cat2

- name: Add more category values to test-cat-2
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: present
name: test-cat-2
values:
- val5
- val6

- name: Get categories info
ntnx_categories_info:
nutanix.ncp.ntnx_categories_info:
name: test-cat-1
register: cat1_info

- name: Delete val1 category value from test-cat-1
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: absent
name: test-cat-1
values:
- val1

- name: Delete all category values from test-cat-1
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: absent
name: test-cat-1
remove_values: true

- name: Delete category key test-cat-2 including its all values
ntnx_categories:
nutanix.ncp.ntnx_categories:
state: absent
name: test-cat-2
remove_values: true
8 changes: 4 additions & 4 deletions examples/clusters_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@

tasks:
- name: Test getting all clusters
ntnx_clusters_info:
nutanix.ncp.ntnx_clusters_info:
register: clusters

- name: Test getting particular cluster using uuid
ntnx_clusters_info:
nutanix.ncp.ntnx_clusters_info:
cluster_uuid: "{{ clusters.response.entities[0].metadata.uuid }}"
register: result

- name: List clusters using length, offset, sort order and priority sort attribute
ntnx_clusters_info:
nutanix.ncp.ntnx_clusters_info:
length: 2
offset: 0
sort_order: ASCENDING
sort_attribute: name
register: result

- name: List clusters using filter and custom_filter
ntnx_clusters_info:
nutanix.ncp.ntnx_clusters_info:
filter:
name: <name>
custom_filter:
Expand Down
12 changes: 6 additions & 6 deletions examples/dr/protection_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- nutanix.ncp
tasks:
- name: Create protection rule with synchronous schedule
ntnx_protection_rules:
nutanix.ncp.ntnx_protection_rules:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand Down Expand Up @@ -44,7 +44,7 @@
register: pr

- name: Delete the protection rule
ntnx_protection_rules:
nutanix.ncp.ntnx_protection_rules:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand All @@ -53,7 +53,7 @@
rule_uuid: "{{ pr.rule_uuid }}"

- name: Create protection rule with async schedule
ntnx_protection_rules:
nutanix.ncp.ntnx_protection_rules:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand Down Expand Up @@ -99,7 +99,7 @@
register: result

- name: Update previously created protection policy
ntnx_protection_rules:
nutanix.ncp.ntnx_protection_rules:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand Down Expand Up @@ -145,7 +145,7 @@
register: pr

- name: Get protection policy info and its associated vms info
ntnx_protection_rules_info:
nutanix.ncp.ntnx_protection_rules_info:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand All @@ -157,7 +157,7 @@
msg: "{{ result }}"

- name: Delete the protection rule
ntnx_protection_rules:
nutanix.ncp.ntnx_protection_rules:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand Down
20 changes: 10 additions & 10 deletions examples/dr/recovery_plan_with_execution.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
######## Description ###########
# Tasks done by this playbook:
# 1. Create Recovery plan using ntnx_recovery_plans
# 1. Create Recovery plan using nutanix.ncp.ntnx_recovery_plans
# 2. Update recovery plan stages and networks
# 3. Get created recovery plan info and affected entities
# 4. Use this info to run test failover on recovery site using ntnx_recovery_plan_jobs
# 4. Use this info to run test failover on recovery site using nutanix.ncp.ntnx_recovery_plan_jobs
# 5. Run cleanup of vms created by test failover on recovery site
# 6. Get final status of both recovery plan jobs using info module
# 7. Delete recovery plan from primary site.
Expand All @@ -15,9 +15,9 @@
collections:
- nutanix.ncp
tasks:
################################# Create recovery plans using ntnx_recovery_plans #############
################################# Create recovery plans using nutanix.ncp.ntnx_recovery_plans #############
- name: Create recovery plan with custom ip network mapping
ntnx_recovery_plans:
nutanix.ncp.ntnx_recovery_plans:
nutanix_host: <pcip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand Down Expand Up @@ -76,7 +76,7 @@
msg: "{{ result }}"

- name: Update recovery plan by adding more stages and remove custom IP to enable dynamic IP allocation
ntnx_recovery_plans:
nutanix.ncp.ntnx_recovery_plans:
plan_uuid: "{{ result.plan_uuid }}"
nutanix_host: <pcip>
nutanix_username: <pc-username>
Expand Down Expand Up @@ -115,10 +115,10 @@
name: <subnet-name>
register: recovery_plan

#################################### Lets recover the vms on recovery site using ntnx_recovery_plan_jobs ################
#################################### Lets recover the vms on recovery site using nutanix.ncp.ntnx_recovery_plan_jobs ################

- name: Recovery plan info and its affected entities get
ntnx_recovery_plans_info:
nutanix.ncp.ntnx_recovery_plans_info:
nutanix_host: <pcip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand All @@ -131,7 +131,7 @@

# We can also perform FAILOVER, LIVE_MIGRATE and FAILOVER here
- name: Run migrate (planned failover)
ntnx_recovery_plan_jobs:
nutanix.ncp.ntnx_recovery_plan_jobs:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand All @@ -152,7 +152,7 @@
msg: "{{ migrate_job }}"

- name: Get recovery plan job status using info module
ntnx_recovery_plan_jobs_info:
nutanix.ncp.ntnx_recovery_plan_jobs_info:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand All @@ -167,7 +167,7 @@
###################################### delete the recovery plan #################

- name: Delete recovery plan
ntnx_recovery_plans:
nutanix.ncp.ntnx_recovery_plans:
nutanix_host: <pc-ip>
nutanix_username: <pc-username>
nutanix_password: <pc-password>
Expand Down
2 changes: 1 addition & 1 deletion examples/fc/api_keys_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

tasks:
- name: Create a new API Key
ntnx_foundation_central_api_keys:
nutanix.ncp.ntnx_foundation_central_api_keys:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand Down
4 changes: 2 additions & 2 deletions examples/fc/api_keys_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

tasks:
- name: API key response with alias
ntnx_foundation_central_api_keys:
nutanix.ncp.ntnx_foundation_central_api_keys:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand All @@ -16,7 +16,7 @@
register: output

- name: API key response with key_uuid
ntnx_foundation_central_api_keys:
nutanix.ncp.ntnx_foundation_central_api_keys:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand Down
4 changes: 2 additions & 2 deletions examples/fc/fc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

tasks:
- name: Nodes Imaging with Cluster Creation with manual mode.
ntnx_foundation_central:
nutanix.ncp.ntnx_foundation_central:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand Down Expand Up @@ -63,7 +63,7 @@
register: output

- name: Nodes Imaging without Cluster Creation with discovery mode.
ntnx_foundation_central:
nutanix.ncp.ntnx_foundation_central:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand Down
6 changes: 3 additions & 3 deletions examples/fc/imaged_cluster_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

tasks:
- name: Imaged-Cluster details with imaged_cluster_uuid
ntnx_foundation_central_imaged_clusters_info:
nutanix.ncp.ntnx_foundation_central_imaged_clusters_info:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand All @@ -16,7 +16,7 @@
register: output

- name: Imaged-Cluster details with filters
ntnx_foundation_central_imaged_clusters_info:
nutanix.ncp.ntnx_foundation_central_imaged_clusters_info:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand All @@ -26,7 +26,7 @@
register: output

- name: Imaged-Cluster details with custom filter
ntnx_foundation_central_imaged_clusters_info:
nutanix.ncp.ntnx_foundation_central_imaged_clusters_info:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand Down
6 changes: 3 additions & 3 deletions examples/fc/imaged_nodes_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

tasks:
- name: Imaged-Node details with imaged_node_uuid
ntnx_foundation_central_imaged_nodes_info:
nutanix.ncp.ntnx_foundation_central_imaged_nodes_info:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand All @@ -16,7 +16,7 @@
register: output

- name: Imaged-Node details with filters
ntnx_foundation_central_imaged_nodes_info:
nutanix.ncp.ntnx_foundation_central_imaged_nodes_info:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand All @@ -26,7 +26,7 @@
register: output

- name: Imaged-Node details with custom filter
ntnx_foundation_central_imaged_nodes_info:
nutanix.ncp.ntnx_foundation_central_imaged_nodes_info:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
Expand Down
Loading

0 comments on commit fccb81e

Please sign in to comment.