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

Add examples issue#256 #267

Merged
merged 1 commit into from
Sep 18, 2022
Merged
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
84 changes: 84 additions & 0 deletions examples/images.yml
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

46 changes: 46 additions & 0 deletions examples/static_routes.yml
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