Skip to content

Commit

Permalink
Release/1.9.1 (#428)
Browse files Browse the repository at this point in the history
* example fix (#420)

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

* Add cluster URL to response only when there is cluster creation (#402)

* Create cluster url when it is required

* Minor fix

* fiql string in filtering (#423)

* fiql string in filtering

* fix

* Add Tests

* example for filter string

---------

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

* Bug/issue#383 (#411)

* Fix Jekyll Build

* fix

* Fix #391 and #418 (#419)

* Create cluster url when it is required

* Minor fix

* Change api url for fetching time machine using name to get complete info same as uuid

* Add attribute in clone modules in ndb for creation or refresh using latestSnapshot

* Minor typo fix

* Minor typo fix

* functionality to update owner of vms (#412)

* functionality to update owner of vm

* sanity fix

* add test

---------

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

* example for vms inventory (#410)

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

* fix for custom filter and examples (#417)

* fix for custom filter and examples

* black fix

* sanity fix

* Add test

---------

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

* example for vms inventory  (#426)

* example for vms inventory

* ansible cfg

* Move cfg to inventory example folder

* Minor name changes

* Minor fix

---------

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

* Add support for PC Categories (#405)

Co-authored-by: Gianluca Salvo <[email protected]>

* Bug/issue#400 (#403)

* fix issue #400

* fix issue #400

---------

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

* example for VMs with guest customization file which injects variables from the playbook (#396)

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

* Fix: Syntax Errors in Create App Security Rule Ex (#394)

* functionality to handle issue when size of new disk is absent (#393)

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

* example fix (#392)

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

* sanity fix

* fix for issue#360 (#408)

* fix for issue#360

* fix

---------

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

* improve clone examples (#407)

* imporve clone examples

* Fix Examples

* sanity fix

* disbale tests

* Enhance Acp Tests

* fix disks issue when size gb is not given for clone image disks

* Set release version 1.9.1

* enable image tests

* enable foundation sanity test

* Minor foundation test fix

* Enable pc tests

* Enable karbon and foundation sanity

* disables tests

* enables tests

* enable pc tests

* add tests for clones with latest snapshot. And enable clones and NDB database sanity tests

* skip protection rules tests

* Add random naming for acp test with user reference

* Bug/191 fix database sanity test (#430)

* Revert "Bug/issue#383 (#411)"

This reverts commit d1a0016.

* Fix Properties map

* Skip jelkyll check on database sanity test build issue

---------

Co-authored-by: Pradeepsingh Bhati <[email protected]>

* fix ntnx_database_sanity

* Add Contributaiong (#431)

* Add Contributaiong

* enhance contributaion

* fix readme

* Add comments to sample var files for simplicity

* Minor typo

---------

Co-authored-by: Pradeepsingh Bhati <[email protected]>

* Release Notes and changelog changes

* Minor typo fix

* remove unrequired file

* Minor release bug list change due to non cherry picks

---------

Co-authored-by: Gevorg Khachatryan <[email protected]>
Co-authored-by: Alaa Bishtawi <[email protected]>
Co-authored-by: Gianluca Salvo <[email protected]>
Co-authored-by: Gianluca Salvo <[email protected]>
Co-authored-by: Nathaniel Roberts <[email protected]>
  • Loading branch information
6 people authored Nov 9, 2023
1 parent 923e9c7 commit b6dc17a
Show file tree
Hide file tree
Showing 105 changed files with 1,308 additions and 148 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## v1.9.1 (09 November 2023)


**Improvements:**

- docs - [Imprv] add doc regarding running integration tests locally [[\#435](https://github.com/nutanix/nutanix.ansible/issues/435)]
- info modules - [Imprv] add examples for custom_filter [[\#416](https://github.com/nutanix/nutanix.ansible/issues/416)]
- ndb clones - [Imprv] Enable database clones and clone refresh using latest snapshot flag [[\#391](https://github.com/nutanix/nutanix.ansible/issues/391)]
- ndb clones - [Imprv] add examples for NDB database clone under examples folder [[\#386](https://github.com/nutanix/nutanix.ansible/issues/386)]
- ntnx_prism_vm_inventory - Add support for PC Categories [[\#405](https://github.com/nutanix/nutanix.ansible/issues/405)]
- ntnx_prism_vm_inventory - [Imprv] add examples for dynamic inventory using ntnx_prism_vm_inventory [[\#401](https://github.com/nutanix/nutanix.ansible/issues/401)]
- ntnx_vms - [Imprv] add possibility to specify / modify vm user ownership and project [[\#378](https://github.com/nutanix/nutanix.ansible/issues/378)]
- ntnx_vms - owner association upon vm creation module [[\#359](https://github.com/nutanix/nutanix.ansible/issues/359)]
- ntnx_vms_info - [Imprv] add examples with guest customization for module ntnx_vms [[\#395](https://github.com/nutanix/nutanix.ansible/issues/395)]

**Bugs:**

- ntnx_foundation - [Bug] Error when Clusters Block is missing in module ntnx_foundation [[\#397](https://github.com/nutanix/nutanix.ansible/issues/397)]
- ntnx_ndb_time_machines_info - [Bug] ntnx_ndb_time_machines_info not fetching all attributes when name is used for fetching [[\#418](https://github.com/nutanix/nutanix.ansible/issues/418)]
- ntnx_security_rules - Fix Syntax Errors in Create App Security Rule Example [[\#394](https://github.com/nutanix/nutanix.ansible/pull/394/files)]
- ntnx_vms - [Bug] Error when updating size_gb using the int filter in module ntnx_vms [[\#400](https://github.com/nutanix/nutanix.ansible/issues/400)]
- ntnx_vms - [Bug] hard_poweroff has been moved to state from operation [[\#415](https://github.com/nutanix/nutanix.ansible/issues/415)]
- ntnx_vms_clone - [Bug] cannot change boot_config when cloning in module ntnx_vms_clone [[\#360](https://github.com/nutanix/nutanix.ansible/issues/359)]
- website - [Bug] Github page deployment action is failing. [[\#483](https://github.com/nutanix/nutanix.ansible/issues/483)]

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

## v1.9.0 (11 July 2023)


Expand All @@ -19,6 +46,7 @@
- ntnx_karbon_clusters_node_pools - Create,Update and Delete worker node pools with the provided configuration.
- ntnx_ndb_tags_info - info module for ndb tags info

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


## v1.8.0 (28 Feb 2023)
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ Nutanix.Ncp Release Notes
.. contents:: Topics


v1.9.1
======

Minor Changes
-------------

- docs - [Imprv] add doc regarding running integration tests locally [[\#435](https://github.com/nutanix/nutanix.ansible/issues/435)]
- info modules - [Imprv] add examples for custom_filter [[\#416](https://github.com/nutanix/nutanix.ansible/issues/416)]
- ndb clones - [Imprv] Enable database clones and clone refresh using latest snapshot flag [[\#391](https://github.com/nutanix/nutanix.ansible/issues/391)]
- ndb clones - [Imprv] add examples for NDB database clone under examples folder [[\#386](https://github.com/nutanix/nutanix.ansible/issues/386)]
- ntnx_prism_vm_inventory - Add support for PC Categories [[\#405](https://github.com/nutanix/nutanix.ansible/issues/405)]
- ntnx_prism_vm_inventory - [Imprv] add examples for dynamic inventory using ntnx_prism_vm_inventory [[\#401](https://github.com/nutanix/nutanix.ansible/issues/401)]
- ntnx_vms - [Imprv] add possibility to specify / modify vm user ownership and project [[\#378](https://github.com/nutanix/nutanix.ansible/issues/378)]
- ntnx_vms - owner association upon vm creation module [[\#359](https://github.com/nutanix/nutanix.ansible/issues/359)]
- ntnx_vms_info - [Imprv] add examples with guest customization for module ntnx_vms [[\#395](https://github.com/nutanix/nutanix.ansible/issues/395)]

Bugfixes
--------

- ntnx_foundation - [Bug] Error when Clusters Block is missing in module ntnx_foundation [[\#397](https://github.com/nutanix/nutanix.ansible/issues/397)]
- ntnx_ndb_time_machines_info - [Bug] ntnx_ndb_time_machines_info not fetching all attributes when name is used for fetching [[\#418](https://github.com/nutanix/nutanix.ansible/issues/418)]
- ntnx_security_rules - Fix Syntax Errors in Create App Security Rule Example [[\#394](https://github.com/nutanix/nutanix.ansible/pull/394/files)]
- ntnx_vms - [Bug] Error when updating size_gb using the int filter in module ntnx_vms [[\#400](https://github.com/nutanix/nutanix.ansible/issues/400)]
- ntnx_vms - [Bug] hard_poweroff has been moved to state from operation [[\#415](https://github.com/nutanix/nutanix.ansible/issues/415)]
- ntnx_vms_clone - [Bug] cannot change boot_config when cloning in module ntnx_vms_clone [[\#360](https://github.com/nutanix/nutanix.ansible/issues/359)]
- website - [Bug] Github page deployment action is failing. [[\#483](https://github.com/nutanix/nutanix.ansible/issues/483)]

v1.9.0
======

Expand Down
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ This collection requires Python 2.7 or greater
> For the 1.9.0 release of the ansible plugin it will have N-1 compatibility with the Prism Central APIs. This release was tested against Prism Central version pc.2023.1 and pc.2023.1.0.1 .
> For the 1.9.1 release of the ansible plugin it will have N-1 compatibility with the Prism Central APIs. This release was tested against Prism Central version pc.2023.3 and pc.2023.1.0.2 .
### Notes:
1. Static routes module (ntnx_static_routes) is supported for PC versions >= pc.2022.1

Expand All @@ -55,6 +57,8 @@ Prism Central based examples: https://github.com/nutanix/nutanix.ansible/tree/ma
## Foundation
> For the 1.1.0 release of the ansible plugin, it will have N-1 compatibility with the Foundation. This release was tested against Foundation versions v5.2 and v5.1.1
> For the 1.9.1 release of the ansible plugin, it was tested against NDB versions v2.5.2
Foundation based examples : https://github.com/nutanix/nutanix.ansible/tree/main/examples/foundation

## Foundation Central
Expand All @@ -67,6 +71,8 @@ Foundation Central based examples : https://github.com/nutanix/nutanix.ansible/t
> For the 1.9.0 release of the ansible plugin, it was tested against Karbon versions v2.6.0, v2.7.0 and v2.8.0
> For the 1.9.1 release of the ansible plugin, it was tested against Karbon version v2.8.0
Karbon based examples : https://github.com/nutanix/nutanix.ansible/tree/main/examples/karbon

## Nutanix Database Service (ERA)
Expand All @@ -75,6 +81,8 @@ Karbon based examples : https://github.com/nutanix/nutanix.ansible/tree/main/exa
> For the 1.9.0 release of the ansible plugin, it was tested against NDB versions v2.5.0.2
> For the 1.9.1 release of the ansible plugin, it was tested against NDB versions v2.5.1.1
NDB based examples : https://github.com/nutanix/nutanix.ansible/tree/main/examples/ndb

### Notes:
Expand Down Expand Up @@ -260,6 +268,56 @@ We glady welcome contributions from the community. From updating the documentati
* [Contributing Guide](CONTRIBUTING.md)
* [Code of Conduct](CODE_OF_CONDUCT.md)

# Testing

## Integration Testing for Nutanix Ansible Modules

To conduct integration tests for a specific Ansible module such as the `ntnx_vms` module, the following step-by-step procedures can be followed:

### Prerequisites
- Ensure you are in the installed collection directory where the module is located. For example:
`/Users/mac.user1/.ansible/collections/ansible_collections/nutanix/ncp`

### Setting up Variables
1. Navigate to the `tests/integration/targets` directory within the collection.

2. Define the necessary variables within the feature-specific var files, such as `tests/integration/targets/prepare_env/vars/main.yml`, `tests/integration/targets/prepare_foundation_env/vars/main.yml`,`tests/integration/targets/prepare_ndb_env/tasks/prepare_env.yml`, etc.

Note: For Karbon and FC tests, use the PC vars exclusively, as these features rely on pc setup. Not all variables are mandatory; define only the required variables for the particular feature to be tested.

3. Run the test setup playbook for the specific feature you intend to test to create entities in setup:
- For PC, NDB, and Foundation tests, execute the relevant commands:
```bash
ansible-playbook prepare_env/tasks/prepare_env.yml
ansible-playbook prepare_ndb_env/tasks/prepare_env.yml
ansible-playbook prepare_foundation_env/tasks/prepare_foundation_env.yml
```

### Running Integration Tests
1. Conduct integration tests for all modules using:
```bash
ansible-test integration
```

2. To perform integration tests for a specific module:
```bash
ansible-test integration module_test_name
```
Replace `module_test_name` with test directory name under tests/integration/targets.

### Cleanup
1. After completing the integration tests, perform a cleanup specific to the tested feature:
- For PC tests, execute the command:
```bash
ansible-playbook prepare_env/tasks/clean_up.yml
```
- For Foundation tests, execute the command:
```bash
ansible-playbook prepare_foundation_env/tasks/clean_up.yml
```

By following these steps, you can perform comprehensive integration testing for the specified Ansible module and ensure a clean testing environment afterward. Define only the necessary variables for the specific feature you intend to test.

# Examples
## Playbook for IaaS provisioning on Nutanix

Expand Down
31 changes: 31 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,34 @@ releases:
name: ntnx_ndb_tags_info
namespace: ''
release_date: '2023-07-11'
1.9.1:
changes:
bugfixes:
- ntnx_foundation - [Bug] Error when Clusters Block is missing in module ntnx_foundation
[[\#397](https://github.com/nutanix/nutanix.ansible/issues/397)]
- ntnx_ndb_time_machines_info - [Bug] ntnx_ndb_time_machines_info not fetching
all attributes when name is used for fetching [[\#418](https://github.com/nutanix/nutanix.ansible/issues/418)]
- ntnx_security_rules - Fix Syntax Errors in Create App Security Rule Example
[[\#394](https://github.com/nutanix/nutanix.ansible/pull/394/files)]
- ntnx_vms - [Bug] Error when updating size_gb using the int filter in module
ntnx_vms [[\#400](https://github.com/nutanix/nutanix.ansible/issues/400)]
- ntnx_vms - [Bug] hard_poweroff has been moved to state from operation [[\#415](https://github.com/nutanix/nutanix.ansible/issues/415)]
- ntnx_vms_clone - [Bug] cannot change boot_config when cloning in module ntnx_vms_clone
[[\#360](https://github.com/nutanix/nutanix.ansible/issues/359)]
- website - [Bug] Github page deployment action is failing. [[\#483](https://github.com/nutanix/nutanix.ansible/issues/483)]
minor_changes:
- docs - [Imprv] add doc regarding running integration tests locally [[\#435](https://github.com/nutanix/nutanix.ansible/issues/435)]
- info modules - [Imprv] add examples for custom_filter [[\#416](https://github.com/nutanix/nutanix.ansible/issues/416)]
- ndb clones - [Imprv] Enable database clones and clone refresh using latest
snapshot flag [[\#391](https://github.com/nutanix/nutanix.ansible/issues/391)]
- ndb clones - [Imprv] add examples for NDB database clone under examples folder
[[\#386](https://github.com/nutanix/nutanix.ansible/issues/386)]
- ntnx_prism_vm_inventory - Add support for PC Categories [[\#405](https://github.com/nutanix/nutanix.ansible/issues/405)]
- ntnx_prism_vm_inventory - [Imprv] add examples for dynamic inventory using
ntnx_prism_vm_inventory [[\#401](https://github.com/nutanix/nutanix.ansible/issues/401)]
- ntnx_vms - [Imprv] add possibility to specify / modify vm user ownership and
project [[\#378](https://github.com/nutanix/nutanix.ansible/issues/378)]
- ntnx_vms - owner association upon vm creation module [[\#359](https://github.com/nutanix/nutanix.ansible/issues/359)]
- ntnx_vms_info - [Imprv] add examples with guest customization for module ntnx_vms
[[\#395](https://github.com/nutanix/nutanix.ansible/issues/395)]
release_date: '2023-10-09'
8 changes: 8 additions & 0 deletions examples/clusters_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@
sort_order: "ASCENDING"
sort_attribute: "name"
register: result

- name: List clusters using filter and custom_filter
ntnx_clusters_info:
filter:
name: <name>
custom_filter:
external_ip: <external_ip>
register: result
9 changes: 9 additions & 0 deletions examples/fip_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@
offset: 0
register: result
ignore_errors: True


- name: List floating_ips using filter and custom_filter
ntnx_floating_ips_info:
filter:
name: <name>
custom_filter:
private_ip: <private_ip>
register: result
8 changes: 8 additions & 0 deletions examples/hosts_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@
sort_attribute: "name"
register: result
ignore_errors: True

- name: List hosts using filter and custom_filter
ntnx_hosts_info:
filter:
name: <name>
custom_filter:
serial_number: <serial_number>
register: result
7 changes: 7 additions & 0 deletions examples/inventory/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[defaults]
inventory = nutanix.yaml

[inventory]
enable_plugins = nutanix.ncp.ntnx_prism_vm_inventory


13 changes: 13 additions & 0 deletions examples/inventory/nutanix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
plugin: nutanix.ncp.ntnx_prism_vm_inventory
nutanix_hostname: <pc_ip>
nutanix_username: <username>
nutanix_password: <password>
validate_certs: false
data: {"offset": 0, "length": 1000}
groups:
group_1: "'<name_prefix>' in name"
group_2: "'<vm_name>'==name"
keyed_groups:
- prefix: "host"
separator: ':'
key: "ansible_host"
121 changes: 121 additions & 0 deletions examples/ndb/create_clone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
- name: Create clone
hosts: localhost
gather_facts: false
collections:
- nutanix.ncp
module_defaults:
group/nutanix.ncp.ntnx:
nutanix_host: <ndb-era-ip>
nutanix_username: <username>
nutanix_password: <password>
validate_certs: false

tasks:
- set_fact:
clone_db:
name: <Clone Db Name>
db_params_profile:
name: <Db Profile Name>
vm:
name: <Vm Name>
password: <Vm password>
cluster:
name: <Cluster Name>
network_profile:
name: <Network Profile Name>
compute_profile:
name: <Compute Profile Name>
public_ssh_key: <Public SSH Key>
time_machine:
name: <Time Machine Name>
snapshot:
uuid: <Snapshot UUID>

- name: create clone using snapshot
ntnx_ndb_database_clones:
name: "{{clone_db.name}}"
desc: "ansible-created-clone"

db_params_profile:
name: "{{db_params_profile.name}}"

db_vm:
create_new_server:
name: "{{ vm.name }}"
desc: "vm for db server"
password: "{{ vm.password }}"
cluster:
name: "{{cluster.name}}"
network_profile:
name: "{{ network_profile.name }}"
compute_profile:
name: "{{ compute_profile.name }}"
pub_ssh_key: "{{ public_ssh_key }}"

postgres:
db_password: "{{vm.password}}"

time_machine:
name: "{{time_machine.name}}"
snapshot_uuid: "{{snapshot.uuid}}"

removal_schedule:
days: 2
timezone: "Asia/Calcutta"
remind_before_in_days: 1
delete_database: True

refresh_schedule:
days: 2
time: "12:00:00"
timezone: "Asia/Calcutta"

register: output

- debug:
msg: "{{output}}"

- name: create clone using point in time
ntnx_ndb_database_clones:
name: "{{clone_db.name}}"
desc: "ansible-created-clone"

db_params_profile:
name: "{{db_params_profile.name}}"

db_vm:
create_new_server:
name: "{{ vm.name }}"
desc: "vm for db server"
password: "{{ vm.password }}"
cluster:
name: "{{cluster.name}}"
network_profile:
name: "{{ network_profile.name }}"
compute_profile:
name: "{{ compute_profile.name }}"
pub_ssh_key: "{{ public_ssh_key }}"

postgres:
db_password: "{{vm.password}}"

time_machine:
name: "{{time_machine.name}}"
pitr_timestamp: "2023-02-28 12:00:00"
timestamp: "Asia/Calcutta"

removal_schedule:
days: 2
timezone: "Asia/Calcutta"
remind_before_in_days: 1
delete_database: True

refresh_schedule:
days: 2
time: "12:00:00"
timezone: "Asia/Calcutta"
register: output

- debug:
msg: "{{output}}"
Loading

0 comments on commit b6dc17a

Please sign in to comment.