Skip to content

Commit

Permalink
Feat/1.4 (#248)
Browse files Browse the repository at this point in the history
* Feat/hosts and cluseters info modules (#231)

Info modules for hosts and clusters info

Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>
Co-authored-by: alaa-bish <[email protected]>
Co-authored-by: Pradeepsingh Bhati <[email protected]>

* fix hosts and clusters

* Module for PC categories (#236)

Module for categories
Co-authored-by: alaa-bish <[email protected]>

* Module for users (#246)

Users module
Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>
Co-authored-by: Pradeepsingh Bhati <[email protected]>

* Module for Service Groups (#242)

Service groups module

Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>
Co-authored-by: alaa-bish <[email protected]>

* Module for user groups (#245)

User group module

Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>
Co-authored-by: Pradeepsingh Bhati <[email protected]>

* Feat/access control policies (#238)

ACP modules

Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>
Co-authored-by: alaa-bish <[email protected]>
Co-authored-by: Pradeepsingh Bhati <[email protected]>

* New modules for Projects, Projects Info, Users Info and User Groups info (#237)

Modules for projects, users info and user groups info
Co-authored-by: alaa-bish <[email protected]>

* fix filter examples (#227)

* Permissions, Address Groups and Roles modules (#243)

* Permissions module

* Add meta runtime changes

* Roles module

* Info module for roles and minor fixes

* Address groups module

* Minor typo fixes

* Test for roles

* tests for address groups

* Minor fix and formatting

* Change subnet_details to subnets for address groups

* roles docs

* Add examples and docs

* Fix info tests

* Doc fix

* Examples of projects and categories

* Minor change

* runtime changes

* Var changes

* skip dest create

* fix tests

* Minor fix

* add examples

* Remove quarantine uuid

* sanity fix

* Skip some tests

* Revert disabled tests

* Unskip more tests

* Remove debug statements

* remove debug from categoris

* fix image tests

* roles test fix

* fix readme

* Fix static routes test

* Formatting

* enable static routes

* Minor fix

* Skip project with cluster tests. IDP and OU related tests for users and user groups (#249)



Co-authored-by: Gevorg-Khachatryaan <Gevorg1050.1>

* Skip image upload tests

* update vlan ids

* Read me changes

* Update docs

* Minor fixes and update ansible version

* Fix lint

* Change Log update

* minor update

* Minor fix

* Minor changes

* Minor fix

* Fix sanity

* Formatting

* Fix sanity

* Ansible version revert

* Ansible version changes

* readme changes

* Class name changes entitiy modules

* Static routes minor fix

Co-authored-by: Gevorg Khachatryan <[email protected]>
Co-authored-by: alaa-bish <[email protected]>
  • Loading branch information
3 people authored Jul 29, 2022
1 parent 1171943 commit 02c9c5b
Show file tree
Hide file tree
Showing 175 changed files with 9,619 additions and 180 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
## v1.4.0 (28 July 2022)

**Features**

**Prism Central**
- Ansible module for Access Control Policy (ACPs)
- Ansible info module for Access Control Policy (ACPs)
- Ansible module for Projects
- Ansible info module for Projects
- Ansible module for Roles
- Ansible info module for Roles
- Ansible info module for Permissions
- Ansible module for Categories
- Ansible info module for Categories
- Ansible module for Address Groups
- Ansible info module for Address Groups
- Ansible module for Service Groups
- Ansible info module for Service Groups
- Ansible module for Users
- Ansible info module for Users
- Ansible module for User Groups
- Ansible info module for User Groups
- Ansible info module for Hosts
- Ansible info module for Clusters

**Bugs**
- Fix examples of info modules [\#226](https://github.com/nutanix/nutanix.ansible/issues/226)

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

## v1.3.0 (4 July 2022)

**Features**
Expand Down
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,28 @@ It is designed keeping simplicity as the core value. Hence it is
# Version compatibility

## Ansible
> This collection has been tested against following Ansible versions: >=2.12.2.
> 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
## 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.
> For the 1.2.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.5.
> For the 1.3.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. Static routes module (ntnx_static_routes) is only supported for PC versions >= pc.2022.1.
> For the 1.3.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.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.
### Notes:
1. Static routes module (ntnx_static_routes) is supported for PC versions >= pc.2022.1

2. Adding cluster references in projects module (ntnx_projects) is supported for PC versions >= pc.2022.1

3. For Users and User Groups modules (ntnx_users and ntnx_user_groups), adding Identity Provider (IdP) & Organizational Unit (OU) based users/groups are supported for PC versions >= pc.2022.1

Prism Central based examples: https://github.com/nutanix/nutanix.ansible/tree/main/examples/

Expand Down Expand Up @@ -99,16 +112,31 @@ ansible-playbook examples/iaas/iaas.yml

| Name | Description |
| --- | --- |
| ntnx_acps | Create, Update, Delete acp. |
| ntnx_acps_info | Get acp info. |
| ntnx_address_groups | Create, Update, Delete Nutanix address groups. |
| ntnx_address_groups_info | Get address groups info. |
| ntnx_categories | Create, Update, Delete categories |
| ntnx_categories_info | Get categories info. |
| ntnx_clusters_info | Get cluster info. |
| ntnx_floating_ips | Create or delete a Floating Ip. |
| ntnx_floating_ips_info | List existing Floating_Ips. |
| ntnx_hosts_info | Get host info. |
| ntnx_images | Create, update or delete a image. |
| ntnx_images_info | List existing images. |
| ntnx_image_placement_policy | Create, update or delete a image placement policy. |
| ntnx_image_placement_policies_info | List existing image placement policies. |
| ntnx_pbrs | Create or delete a PBR. |
| ntnx_pbrs_info | List existing PBRs. |
| ntnx_permissions_info | List permissions info |
| ntnx_projects | create, update and delete pc projects |
| ntnx_projects_info | Get projects info. |
| ntnx_roles | Create, Update, Delete Nutanix roles |
| ntnx_roles_info | Get roles info. |
| ntnx_security_rules | Create, update or delete a Security Rule. |
| ntnx_security_rules_info | List existing Security Rules. |
| ntnx_service_groups | Create, Update, Delete service_group |
| ntnx_service_groups_info | Get service groups info. |
| ntnx_static_routes | Update static routes of a vpc. |
| ntnx_static_routes_info | List existing static routes of a vpc. |
| ntnx_subnets | Create or delete a Subnet. |
Expand All @@ -131,6 +159,10 @@ ansible-playbook examples/iaas/iaas.yml
| ntnx_foundation_central_api_keys_info | List all the api keys created in Foundation Central. |
| ntnx_foundation_central_imaged_clusters_info | List all the clusters created using Foundation Central. |
| ntnx_foundation_central_imaged_nodes_info | List all the nodes registered with Foundation Central. |
| ntnx_user_groups | Create, Delete user_groups |
| ntnx_user_groups_info | Get user groups info. |
| ntnx_users | Create, Delete users |
| ntnx_users_info | Get users info. |

## Inventory Plugins

Expand Down
47 changes: 47 additions & 0 deletions examples/acp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
- name: ACP 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: Create ACP with all specfactions
ntnx_acps:
validate_certs: False
state: present
nutanix_host: "{{ IP }}"
nutanix_username: "{{ username }}"
nutanix_password: "{{ password }}"
name: acp_with_all_specfactions
role:
uuid: "{{ role.uuid }}"
user_uuids:
- "{{ user_uuid }}"
user_group_uuids:
- "{{ user_group_uuid }}"
filters:
- scope_filter:
lhs: PROJECT
operator: IN
rhs:
uuid_list:
- "{{ project.uuid }}"
entity_filter:
lhs: ALL
operator: IN
rhs:
collection: ALL

- name: Delete ACP
ntnx_acps:
state: absent
acp_uuid: "{{ acp_uuid }}"
register: result
31 changes: 31 additions & 0 deletions examples/acp_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: ACP_Info 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: List ACPs using ascending, sorting and name filter
ntnx_floating_ips_info:
filter:
name: "{{ acp_name }}"
kind: access_control_policy
sort_order: "ASCENDING"
sort_attribute: "name"
register: result
ignore_errors: True

- name: List ACPs using length and offset
ntnx_floating_ips_info:
length: 3
offset: 0
register: result
ignore_errors: True
51 changes: 51 additions & 0 deletions examples/address_groups_crud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
- name: Address group crud playbook. Here we will create, update, read and delete the address group.
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: Create a address group
ntnx_address_groups:
state: present
name: test-ansible-group-1
desc: test-ansible-group-1-desc
subnets:
- network_ip: "10.1.1.0"
network_prefix: 24
- network_ip: "10.1.2.2"
network_prefix: 32
register: ag

- name: update address group
ntnx_address_groups:
state: present
address_group_uuid: "{{ag.address_group_uuid}}"
name: test-ansible-group-1-updated
desc: test-ansible-group-1-desc-updated
subnets:
- network_ip: "10.1.3.0"
network_prefix: 24
register: updated_ag

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

- name: Print the address group details
debug:
msg: "{{ag_info}}"

- name: Delete the address group.
ntnx_address_groups:
state: absent
address_group_uuid: "{{updated_ag.address_group_uuid}}"
register: op


74 changes: 74 additions & 0 deletions examples/category_crud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
- name: categories crud playbook. Here we will create, update, read and delete the category key values.
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
module_defaults:
group/nutanix.ncp.ntnx:
nutanix_host: <pc-ip>
nutanix_username: <username>
nutanix_password: <password>
validate_certs: false
tasks:
- name: Create only category key with description
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:
state: "present"
name: "test-cat-1"
values:
- "val1"
- "val2"

- name: Create category key with values
ntnx_categories:
state: "present"
name: "test-cat-2"
desc: "test-cat-2-desc"
values:
- "val3"
- "val4"
register: cat2

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

- name: Get categories info
ntnx_categories_info:
name: "test-cat-1"
register: cat1_info

- name: Delete val1 category value from test-cat-1
ntnx_categories:
state: absent
name: "test-cat-1"
values:
- val1

- name: delete all category values from test-cat-1
ntnx_categories:
state: absent
name: "test-cat-1"
remove_values: true

- name: delete category key test-cat-2 including its all values
ntnx_categories:
state: absent
name: "test-cat-2"
remove_values: true






30 changes: 30 additions & 0 deletions examples/clusters_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- name: Clusters_Info 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: test getting all clusters
ntnx_clusters_info:
register: clusters

- name: test getting particular cluster using uuid
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:
length: 2
offset: 0
sort_order: "ASCENDING"
sort_attribute: "name"
register: result
3 changes: 2 additions & 1 deletion examples/fip_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

- name: List floating_ips using ascending ip sorting and floating_ip filter
ntnx_floating_ips_info:
filter: "floating_ip==10."
filter:
floating_ip: "10.0.1.2"
kind: floating_ip
sort_order: "ASCENDING"
sort_attribute: "floating_ip"
Expand Down
31 changes: 31 additions & 0 deletions examples/hosts_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: Hosts_Info 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: test getting all hosts
ntnx_hosts_info:
register: hosts

- name: test getting particular host using uuid
ntnx_hosts_info:
host_uuid: '{{ hosts.response.entities[0].metadata.uuid }}'
register: result

- name: List hosts using length, offset, sort order and name sort attribute
ntnx_hosts_info:
length: 2
offset: 0
sort_order: "ASCENDING"
sort_attribute: "name"
register: result
ignore_errors: True
Loading

0 comments on commit 02c9c5b

Please sign in to comment.