Skip to content

Commit

Permalink
Resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
george-ghawali committed Oct 8, 2024
1 parent c26da2b commit 76443a3
Show file tree
Hide file tree
Showing 9 changed files with 338 additions and 353 deletions.
10 changes: 4 additions & 6 deletions examples/acp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
- name: ACP playbook
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
module_defaults:
group/nutanix.ncp.ntnx:
nutanix_host: <pc_ip>
Expand All @@ -12,9 +10,9 @@
validate_certs: false

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

- name: Delete ACP
ntnx_acps:
nutanix.ncp.ntnx_acps:
state: absent
acp_uuid: "{{ acp_uuid }}"
register: result
177 changes: 87 additions & 90 deletions examples/fc/fc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,96 @@
- name: Foundation Central Playbook
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp

tasks:
- name: Nodes Imaging with Cluster Creation with manual mode.
ntnx_foundation_central:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
cluster_name: "test"
# skip_cluster_creation: false #set this to true to skip cluster creation
common_network_settings:
cvm_dns_servers:
- 10.x.xx.xx
hypervisor_dns_servers:
- 10.x.xx.xx
cvm_ntp_servers:
- "ntp"
hypervisor_ntp_servers:
- "ntp"
nodes_list:
- manual_mode:
cvm_gateway: "10.xx.xx.xx"
cvm_netmask: "xx.xx.xx.xx"
cvm_ip: "10.x.xx.xx"
hypervisor_gateway: "10.x.xx.xxx"
hypervisor_netmask: "xx.xx.xx.xx"
hypervisor_ip: "10.x.x.xx"
hypervisor_hostname: "Host-1"
imaged_node_uuid: "<node_uuid>"
use_existing_network_settings: false
ipmi_gateway: "10.x.xx.xx"
ipmi_netmask: "xx.xx.xx.xx"
ipmi_ip: "10.x.xx.xx"
image_now: true
hypervisor_type: "kvm"
- name: Nodes Imaging with Cluster Creation with manual mode.
nutanix.ncp.ntnx_foundation_central:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
cluster_name: test
# skip_cluster_creation: false #set this to true to skip cluster creation
common_network_settings:
cvm_dns_servers:
- 10.x.xx.xx
hypervisor_dns_servers:
- 10.x.xx.xx
cvm_ntp_servers:
- ntp
hypervisor_ntp_servers:
- ntp
nodes_list:
- manual_mode:
cvm_gateway: 10.xx.xx.xx
cvm_netmask: xx.xx.xx.xx
cvm_ip: 10.x.xx.xx
hypervisor_gateway: 10.x.xx.xxx
hypervisor_netmask: xx.xx.xx.xx
hypervisor_ip: 10.x.x.xx
hypervisor_hostname: Host-1
imaged_node_uuid: <node_uuid>
use_existing_network_settings: false
ipmi_gateway: 10.x.xx.xx
ipmi_netmask: xx.xx.xx.xx
ipmi_ip: 10.x.xx.xx
image_now: true
hypervisor_type: kvm

- manual_mode:
cvm_gateway: "10.xx.xx.xx"
cvm_netmask: "xx.xx.xx.xx"
cvm_ip: "10.x.xx.xx"
hypervisor_gateway: "10.x.xx.xxx"
hypervisor_netmask: "xx.xx.xx.xx"
hypervisor_ip: "10.x.x.xx"
hypervisor_hostname: "Host-2"
imaged_node_uuid: "<node_uuid>"
use_existing_network_settings: false
ipmi_gateway: "10.x.xx.xx"
ipmi_netmask: "xx.xx.xx.xx"
ipmi_ip: "10.x.xx.xx"
image_now: true
hypervisor_type: "kvm"
- manual_mode:
cvm_gateway: 10.xx.xx.xx
cvm_netmask: xx.xx.xx.xx
cvm_ip: 10.x.xx.xx
hypervisor_gateway: 10.x.xx.xxx
hypervisor_netmask: xx.xx.xx.xx
hypervisor_ip: 10.x.x.xx
hypervisor_hostname: Host-2
imaged_node_uuid: <node_uuid>
use_existing_network_settings: false
ipmi_gateway: 10.x.xx.xx
ipmi_netmask: xx.xx.xx.xx
ipmi_ip: 10.x.xx.xx
image_now: true
hypervisor_type: kvm

redundancy_factor: 2
aos_package_url: "<url>"
hypervisor_iso_details:
url: "<hypervisor-url>"
register: output
redundancy_factor: 2
aos_package_url: <url>
hypervisor_iso_details:
url: <hypervisor-url>
register: output

- name: Nodes Imaging without Cluster Creation with discovery mode.
ntnx_foundation_central:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
cluster_name: "test"
skip_cluster_creation: true
common_network_settings:
cvm_dns_servers:
- 10.x.xx.xx
hypervisor_dns_servers:
- 10.x.xx.xx
cvm_ntp_servers:
- "ntp"
hypervisor_ntp_servers:
- "ntp"
nodes_list:
- discovery_mode:
node_serial: "<node-serial-1>"
- discovery_mode:
node_serial: "<node-serial-2>"
- discovery_mode:
node_serial: "<node-serial-3>"
discovery_override:
cvm_ip: <cvm-ip>
- name: Nodes Imaging without Cluster Creation with discovery mode.
nutanix.ncp.ntnx_foundation_central:
nutanix_host: "{{ pc }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
validate_certs: false
cluster_name: test
skip_cluster_creation: true
common_network_settings:
cvm_dns_servers:
- 10.x.xx.xx
hypervisor_dns_servers:
- 10.x.xx.xx
cvm_ntp_servers:
- ntp
hypervisor_ntp_servers:
- ntp
nodes_list:
- discovery_mode:
node_serial: <node-serial-1>
- discovery_mode:
node_serial: <node-serail-2>
- discovery_mode:
node_serial: <node-serial-3>
discovery_override:
cvm_ip: <cvm-ip>

redundancy_factor: 2
aos_package_url: "<url>"
hypervisor_iso_details:
url: "<hypervisor-url>"
register: output
redundancy_factor: 2
aos_package_url: <url>
hypervisor_iso_details:
url: <hypervisor-url>
register: output

- name: output of list
debug:
msg: '{{ output }}'
- name: Output of list
ansible.builtin.debug:
msg: "{{ output }}"
18 changes: 9 additions & 9 deletions examples/foundation/node_discovery_network_info.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
# Here we will discover nodes and also get node network info of particular some discovered nodes
- name: Discover nodes and get their network info
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
tasks:
- name: Discover all nodes
ntnx_foundation_discover_nodes_info:
nutanix_host: "10.xx.xx.xx"
# resume line 12 to include configured(nodes part of cluster) nodes in the output
# include_configured: true
nutanix.ncp.ntnx_foundation_discover_nodes_info:
nutanix_host: 10.xx.xx.xx
# unskip line 12 to include configured(nodes part of cluster) nodes in the output
# include_configured: true
register: discovered_nodes

# get network info of nodes discovered from ntnx_foundation_discover_nodes_info module
- name: Get node network info of some discovered nodes
ntnx_foundation_node_network_info:
nutanix_host: "10.xx.xx.xx"
nutanix.ncp.ntnx_foundation_node_network_info:
nutanix_host: 10.xx.xx.xx
nodes:
- "{{discovered_nodes.blocks.0.nodes.0.ipv6_address}}"
- "{{discovered_nodes.blocks.1.nodes.0.ipv6_address}}"
register: result

- debug:
- name: Print node network info
ansible.builtin.debug:
msg: "{{ result }}"
26 changes: 12 additions & 14 deletions examples/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
- name: Images playbook
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
module_defaults:
group/nutanix.ncp.ntnx:
nutanix_host: <host_ip>
Expand All @@ -12,14 +10,14 @@
validate_certs: false
tasks:
- name: Setting Variables
set_fact:
ansible.builtin.set_fact:
image_uuid: ""
source_path: ""
source_uri: ""
clusters_name: ""
clusters_name: ""

- name: create image from local workstation
ntnx_images:
- name: Create image from local workstation
nutanix.ncp.ntnx_images:
state: "present"
source_path: "{{source_path}}"
clusters:
Expand All @@ -38,8 +36,8 @@
product_version: "1.2.0"
wait: true

- name: create image from with source as remote server file location
ntnx_images:
- name: Create image from with source as remote server file location
nutanix.ncp.ntnx_images:
state: "present"
source_uri: "{{source_uri}}"
clusters:
Expand All @@ -58,8 +56,8 @@
product_version: "1.2.0"
wait: true

- name: override categories of existing image
ntnx_images:
- name: Override categories of existing image
nutanix.ncp.ntnx_images:
state: "present"
image_uuid: "{{image-uuid}}"
categories:
Expand All @@ -69,15 +67,15 @@
- Backup
wait: true

- name: detach all categories from existing image
ntnx_images:
- name: Dettach all categories from existing image
nutanix.ncp.ntnx_images:
state: "present"
image_uuid: "00000000-0000-0000-0000-000000000000"
remove_categories: true
wait: true

- name: delete existing image
ntnx_images:
- name: Delete existing image
nutanix.ncp.ntnx_images:
state: "absent"
image_uuid: "00000000-0000-0000-0000-000000000000"
wait: true
53 changes: 26 additions & 27 deletions examples/karbon/create_registries.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
- name: create registries
- name: Create registeries
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
module_defaults:
group/nutanix.ncp.ntnx:
nutanix_host: <pc_ip>
Expand All @@ -12,30 +10,31 @@
validate_certs: false

tasks:
- set_fact:
registry_name: <registry_name>
url: <url>
port_number: <port_number>
username: <username>
password: <pass>
- name: Set vars
ansible.builtin.set_fact:
registry_name: <registry_name>
url: <url>
port_number: <port_number>
username: <username>
password: <pass>

- name: create registry
ntnx_karbon_registries:
name: "{{registry_name}}"
url: "{{url}}"
port: "{{port_number}}"
register: result
- name: Create registry
nutanix.ncp.ntnx_karbon_registries:
name: "{{ registry_name }}"
url: "{{ url }}"
port: "{{ port_number }}"
register: result

- name: delete registry
ntnx_karbon_registries:
name: "{{registry_name}}"
state: absent
register: result
- name: Delete registry
nutanix.ncp.ntnx_karbon_registries:
name: "{{ registry_name }}"
state: absent
register: result

- name: create registry with username and password
ntnx_karbon_registries:
name: "{{registry_name}}"
url: "{{url}}"
username: "{{username}}"
password: "{{password}}"
register: result
- name: Create registry with username and password
nutanix.ncp.ntnx_karbon_registries:
name: "{{ registry_name }}"
url: "{{ url }}"
username: "{{ username }}"
password: "{{ password }}"
register: result
Loading

0 comments on commit 76443a3

Please sign in to comment.