-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add examples for images and static routes(#267)
- Loading branch information
Showing
2 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
- name: Images playbook | ||
hosts: localhost | ||
gather_facts: false | ||
collections: | ||
- nutanix.ncp | ||
module_defaults: | ||
group/nutanix.ncp.ntnx: | ||
nutanix_host: <host_ip> | ||
nutanix_username: <user> | ||
nutanix_password: <pass> | ||
validate_certs: false | ||
tasks: | ||
- name: Setting Variables | ||
set_fact: | ||
image_uuid: "" | ||
source_path: "" | ||
source_uri: "" | ||
clusters_name: "" | ||
|
||
- name: create image from local workstation | ||
ntnx_images: | ||
state: "present" | ||
source_path: "{{source_path}}" | ||
clusters: | ||
- name: "{{clusters_name}}" | ||
categories: | ||
AppFamily: | ||
- Backup | ||
checksum: | ||
checksum_algorithm: SHA_1 | ||
checksum_value: 44610efd741a3ab4a548a81ea94869bb8b692977 | ||
name: "ansible-test-with-categories-mapping" | ||
desc: "description" | ||
image_type: "ISO_IMAGE" | ||
version: | ||
product_name: "test" | ||
product_version: "1.2.0" | ||
wait: true | ||
|
||
- name: create image from with source as remote server file location | ||
ntnx_images: | ||
state: "present" | ||
source_uri: "{{source_uri}}" | ||
clusters: | ||
- name: "{{clusters_name}}" | ||
categories: | ||
AppFamily: | ||
- Backup | ||
checksum: | ||
checksum_algorithm: SHA_1 | ||
checksum_value: 44610efd741a3ab4a548a81ea94869bb8b692977 | ||
name: "ansible-test-with-categories-mapping" | ||
desc: "description" | ||
image_type: "DISK_IMAGE" | ||
version: | ||
product_name: "test" | ||
product_version: "1.2.0" | ||
wait: true | ||
|
||
- name: override categories of existing image | ||
ntnx_images: | ||
state: "present" | ||
image_uuid: "{{image-uuid}}" | ||
categories: | ||
AppTier: | ||
- Default | ||
AppFamily: | ||
- Backup | ||
wait: true | ||
|
||
- name: dettach all categories from existing image | ||
ntnx_images: | ||
state: "present" | ||
image_uuid: "00000000-0000-0000-0000-000000000000" | ||
remove_categories: true | ||
wait: true | ||
|
||
- name: delete existing image | ||
ntnx_images: | ||
state: "absent" | ||
image_uuid: "00000000-0000-0000-0000-000000000000" | ||
wait: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
- name: Static Routes playbook | ||
hosts: localhost | ||
gather_facts: false | ||
collections: | ||
- nutanix.ncp | ||
module_defaults: | ||
group/nutanix.ncp.ntnx: | ||
nutanix_host: <host_ip> | ||
nutanix_username: <user> | ||
nutanix_password: <pass> | ||
validate_certs: false | ||
tasks: | ||
- name: Setting Variables | ||
set_fact: | ||
vpc_uuid: "" | ||
vpn_uuid: "" | ||
external_nat_subnet: | ||
name: "" | ||
uuid: "" | ||
|
||
- name: create static routes and default static routes with external nat subnet | ||
ntnx_static_routes: | ||
vpc_uuid: "{{ vpc_uuid }}" | ||
static_routes: | ||
- destination: "0.0.0.0/0" | ||
next_hop: | ||
external_subnet_ref: | ||
name: "{{ external_nat_subnet.name }}" | ||
- destination: "10.2.2.0/24" | ||
next_hop: | ||
external_subnet_ref: | ||
uuid: "{{ external_nat_subnet.uuid }}" | ||
- destination: "10.2.3.0/24" | ||
next_hop: | ||
external_subnet_ref: | ||
uuid: "{{ external_nat_subnet.uuid }}" | ||
- destination: "10.2.4.0/24" | ||
next_hop: | ||
vpn_connection_ref: | ||
uuid: "{{ vpn_uuid }}" | ||
|
||
- name: remove all routes excluding dynamic and local routes | ||
ntnx_static_routes: | ||
vpc_uuid: "{{ vpc_uuid }}" | ||
remove_all_routes: true |