Skip to content

Commit 02c9c5b

Browse files
bhati-pradeepGevorg-Khachatryan-97alaa-bish
authored
Feat/1.4 (#248)
* 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]>
1 parent 1171943 commit 02c9c5b

File tree

175 files changed

+9619
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+9619
-180
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
## v1.4.0 (28 July 2022)
2+
3+
**Features**
4+
5+
**Prism Central**
6+
- Ansible module for Access Control Policy (ACPs)
7+
- Ansible info module for Access Control Policy (ACPs)
8+
- Ansible module for Projects
9+
- Ansible info module for Projects
10+
- Ansible module for Roles
11+
- Ansible info module for Roles
12+
- Ansible info module for Permissions
13+
- Ansible module for Categories
14+
- Ansible info module for Categories
15+
- Ansible module for Address Groups
16+
- Ansible info module for Address Groups
17+
- Ansible module for Service Groups
18+
- Ansible info module for Service Groups
19+
- Ansible module for Users
20+
- Ansible info module for Users
21+
- Ansible module for User Groups
22+
- Ansible info module for User Groups
23+
- Ansible info module for Hosts
24+
- Ansible info module for Clusters
25+
26+
**Bugs**
27+
- Fix examples of info modules [\#226](https://github.com/nutanix/nutanix.ansible/issues/226)
28+
29+
**Full Changelog:** [here](https://github.com/nutanix/nutanix.ansible/compare/v1.3.0...v1.4.0)
30+
131
## v1.3.0 (4 July 2022)
232

333
**Features**

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,28 @@ It is designed keeping simplicity as the core value. Hence it is
1111
# Version compatibility
1212

1313
## Ansible
14-
> This collection has been tested against following Ansible versions: >=2.12.2.
14+
> This collection has been tested against following versions:
15+
1. ansible==5.0.1
16+
2. ansible-core==2.12.3
1517

1618
## Python
1719
> This collection requires Python 2.7 or greater
1820
1921
## Prism Cenral
2022
> 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.
23+
2124
> 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.
22-
> 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.
25+
26+
> 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.
27+
28+
> 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.
29+
30+
### Notes:
31+
1. Static routes module (ntnx_static_routes) is supported for PC versions >= pc.2022.1
32+
33+
2. Adding cluster references in projects module (ntnx_projects) is supported for PC versions >= pc.2022.1
34+
35+
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
2336

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

@@ -99,16 +112,31 @@ ansible-playbook examples/iaas/iaas.yml
99112

100113
| Name | Description |
101114
| --- | --- |
115+
| ntnx_acps | Create, Update, Delete acp. |
116+
| ntnx_acps_info | Get acp info. |
117+
| ntnx_address_groups | Create, Update, Delete Nutanix address groups. |
118+
| ntnx_address_groups_info | Get address groups info. |
119+
| ntnx_categories | Create, Update, Delete categories |
120+
| ntnx_categories_info | Get categories info. |
121+
| ntnx_clusters_info | Get cluster info. |
102122
| ntnx_floating_ips | Create or delete a Floating Ip. |
103123
| ntnx_floating_ips_info | List existing Floating_Ips. |
124+
| ntnx_hosts_info | Get host info. |
104125
| ntnx_images | Create, update or delete a image. |
105126
| ntnx_images_info | List existing images. |
106127
| ntnx_image_placement_policy | Create, update or delete a image placement policy. |
107128
| ntnx_image_placement_policies_info | List existing image placement policies. |
108129
| ntnx_pbrs | Create or delete a PBR. |
109130
| ntnx_pbrs_info | List existing PBRs. |
131+
| ntnx_permissions_info | List permissions info |
132+
| ntnx_projects | create, update and delete pc projects |
133+
| ntnx_projects_info | Get projects info. |
134+
| ntnx_roles | Create, Update, Delete Nutanix roles |
135+
| ntnx_roles_info | Get roles info. |
110136
| ntnx_security_rules | Create, update or delete a Security Rule. |
111137
| ntnx_security_rules_info | List existing Security Rules. |
138+
| ntnx_service_groups | Create, Update, Delete service_group |
139+
| ntnx_service_groups_info | Get service groups info. |
112140
| ntnx_static_routes | Update static routes of a vpc. |
113141
| ntnx_static_routes_info | List existing static routes of a vpc. |
114142
| ntnx_subnets | Create or delete a Subnet. |
@@ -131,6 +159,10 @@ ansible-playbook examples/iaas/iaas.yml
131159
| ntnx_foundation_central_api_keys_info | List all the api keys created in Foundation Central. |
132160
| ntnx_foundation_central_imaged_clusters_info | List all the clusters created using Foundation Central. |
133161
| ntnx_foundation_central_imaged_nodes_info | List all the nodes registered with Foundation Central. |
162+
| ntnx_user_groups | Create, Delete user_groups |
163+
| ntnx_user_groups_info | Get user groups info. |
164+
| ntnx_users | Create, Delete users |
165+
| ntnx_users_info | Get users info. |
134166

135167
## Inventory Plugins
136168

examples/acp.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
- name: ACP playbook
3+
hosts: localhost
4+
gather_facts: false
5+
collections:
6+
- nutanix.ncp
7+
module_defaults:
8+
group/nutanix.ncp.ntnx:
9+
nutanix_host: <host_ip>
10+
nutanix_username: <user>
11+
nutanix_password: <pass>
12+
validate_certs: false
13+
14+
tasks:
15+
16+
- name: Create ACP with all specfactions
17+
ntnx_acps:
18+
validate_certs: False
19+
state: present
20+
nutanix_host: "{{ IP }}"
21+
nutanix_username: "{{ username }}"
22+
nutanix_password: "{{ password }}"
23+
name: acp_with_all_specfactions
24+
role:
25+
uuid: "{{ role.uuid }}"
26+
user_uuids:
27+
- "{{ user_uuid }}"
28+
user_group_uuids:
29+
- "{{ user_group_uuid }}"
30+
filters:
31+
- scope_filter:
32+
lhs: PROJECT
33+
operator: IN
34+
rhs:
35+
uuid_list:
36+
- "{{ project.uuid }}"
37+
entity_filter:
38+
lhs: ALL
39+
operator: IN
40+
rhs:
41+
collection: ALL
42+
43+
- name: Delete ACP
44+
ntnx_acps:
45+
state: absent
46+
acp_uuid: "{{ acp_uuid }}"
47+
register: result

examples/acp_info.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
- name: ACP_Info playbook
3+
hosts: localhost
4+
gather_facts: false
5+
collections:
6+
- nutanix.ncp
7+
module_defaults:
8+
group/nutanix.ncp.ntnx:
9+
nutanix_host: <host_ip>
10+
nutanix_username: <user>
11+
nutanix_password: <pass>
12+
validate_certs: false
13+
14+
tasks:
15+
16+
- name: List ACPs using ascending, sorting and name filter
17+
ntnx_floating_ips_info:
18+
filter:
19+
name: "{{ acp_name }}"
20+
kind: access_control_policy
21+
sort_order: "ASCENDING"
22+
sort_attribute: "name"
23+
register: result
24+
ignore_errors: True
25+
26+
- name: List ACPs using length and offset
27+
ntnx_floating_ips_info:
28+
length: 3
29+
offset: 0
30+
register: result
31+
ignore_errors: True

examples/address_groups_crud.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
- name: Address group crud playbook. Here we will create, update, read and delete the address group.
2+
hosts: localhost
3+
gather_facts: false
4+
collections:
5+
- nutanix.ncp
6+
module_defaults:
7+
group/nutanix.ncp.ntnx:
8+
nutanix_host: <host_ip>
9+
nutanix_username: <user>
10+
nutanix_password: <pass>
11+
validate_certs: false
12+
tasks:
13+
- name: Create a address group
14+
ntnx_address_groups:
15+
state: present
16+
name: test-ansible-group-1
17+
desc: test-ansible-group-1-desc
18+
subnets:
19+
- network_ip: "10.1.1.0"
20+
network_prefix: 24
21+
- network_ip: "10.1.2.2"
22+
network_prefix: 32
23+
register: ag
24+
25+
- name: update address group
26+
ntnx_address_groups:
27+
state: present
28+
address_group_uuid: "{{ag.address_group_uuid}}"
29+
name: test-ansible-group-1-updated
30+
desc: test-ansible-group-1-desc-updated
31+
subnets:
32+
- network_ip: "10.1.3.0"
33+
network_prefix: 24
34+
register: updated_ag
35+
36+
- name: Read the updated address group
37+
ntnx_address_groups_info:
38+
address_group_uuid: "{{updated_ag.address_group_uuid}}"
39+
register: ag_info
40+
41+
- name: Print the address group details
42+
debug:
43+
msg: "{{ag_info}}"
44+
45+
- name: Delete the address group.
46+
ntnx_address_groups:
47+
state: absent
48+
address_group_uuid: "{{updated_ag.address_group_uuid}}"
49+
register: op
50+
51+

examples/category_crud.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
- name: categories crud playbook. Here we will create, update, read and delete the category key values.
2+
hosts: localhost
3+
gather_facts: false
4+
collections:
5+
- nutanix.ncp
6+
module_defaults:
7+
group/nutanix.ncp.ntnx:
8+
nutanix_host: <pc-ip>
9+
nutanix_username: <username>
10+
nutanix_password: <password>
11+
validate_certs: false
12+
tasks:
13+
- name: Create only category key with description
14+
ntnx_categories:
15+
state: "present"
16+
name: "test-cat-1"
17+
desc: "test-cat-1-desc"
18+
register: cat1
19+
20+
- name: Add category values to test-cat-1
21+
ntnx_categories:
22+
state: "present"
23+
name: "test-cat-1"
24+
values:
25+
- "val1"
26+
- "val2"
27+
28+
- name: Create category key with values
29+
ntnx_categories:
30+
state: "present"
31+
name: "test-cat-2"
32+
desc: "test-cat-2-desc"
33+
values:
34+
- "val3"
35+
- "val4"
36+
register: cat2
37+
38+
- name: Add more category values to test-cat-2
39+
ntnx_categories:
40+
state: "present"
41+
name: "test-cat-2"
42+
values:
43+
- "val5"
44+
- "val6"
45+
46+
- name: Get categories info
47+
ntnx_categories_info:
48+
name: "test-cat-1"
49+
register: cat1_info
50+
51+
- name: Delete val1 category value from test-cat-1
52+
ntnx_categories:
53+
state: absent
54+
name: "test-cat-1"
55+
values:
56+
- val1
57+
58+
- name: delete all category values from test-cat-1
59+
ntnx_categories:
60+
state: absent
61+
name: "test-cat-1"
62+
remove_values: true
63+
64+
- name: delete category key test-cat-2 including its all values
65+
ntnx_categories:
66+
state: absent
67+
name: "test-cat-2"
68+
remove_values: true
69+
70+
71+
72+
73+
74+

examples/clusters_info.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
- name: Clusters_Info playbook
3+
hosts: localhost
4+
gather_facts: false
5+
collections:
6+
- nutanix.ncp
7+
module_defaults:
8+
group/nutanix.ncp.ntnx:
9+
nutanix_host: <host_ip>
10+
nutanix_username: <user>
11+
nutanix_password: <pass>
12+
validate_certs: false
13+
14+
tasks:
15+
- name: test getting all clusters
16+
ntnx_clusters_info:
17+
register: clusters
18+
19+
- name: test getting particular cluster using uuid
20+
ntnx_clusters_info:
21+
cluster_uuid: '{{ clusters.response.entities[0].metadata.uuid }}'
22+
register: result
23+
24+
- name: List clusters using length, offset, sort order and priority sort attribute
25+
ntnx_clusters_info:
26+
length: 2
27+
offset: 0
28+
sort_order: "ASCENDING"
29+
sort_attribute: "name"
30+
register: result

examples/fip_info.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
- name: List floating_ips using ascending ip sorting and floating_ip filter
1717
ntnx_floating_ips_info:
18-
filter: "floating_ip==10."
18+
filter:
19+
floating_ip: "10.0.1.2"
1920
kind: floating_ip
2021
sort_order: "ASCENDING"
2122
sort_attribute: "floating_ip"

examples/hosts_info.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
- name: Hosts_Info playbook
3+
hosts: localhost
4+
gather_facts: false
5+
collections:
6+
- nutanix.ncp
7+
module_defaults:
8+
group/nutanix.ncp.ntnx:
9+
nutanix_host: <host_ip>
10+
nutanix_username: <user>
11+
nutanix_password: <pass>
12+
validate_certs: false
13+
14+
tasks:
15+
- name: test getting all hosts
16+
ntnx_hosts_info:
17+
register: hosts
18+
19+
- name: test getting particular host using uuid
20+
ntnx_hosts_info:
21+
host_uuid: '{{ hosts.response.entities[0].metadata.uuid }}'
22+
register: result
23+
24+
- name: List hosts using length, offset, sort order and name sort attribute
25+
ntnx_hosts_info:
26+
length: 2
27+
offset: 0
28+
sort_order: "ASCENDING"
29+
sort_attribute: "name"
30+
register: result
31+
ignore_errors: True

0 commit comments

Comments
 (0)