diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index b3b0d8f2..28a26681 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -30,7 +30,7 @@ jobs: run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs" - name: Store migrated collection artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: collection path: .cache/collection-tarballs @@ -74,7 +74,7 @@ jobs: run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check - name: Download migrated collection artifacts - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: collection path: .cache/collection-tarballs @@ -94,7 +94,7 @@ jobs: - name: Generate coverage report run: | if [ "${{ matrix.ansible-version }}" == "devel" ]; then - pip install coverage==7.5.3; + pip install coverage==7.6.1; elif [ "${{ matrix.ansible-version }}" == "stable-2.15" ]; then pip install coverage==6.5.0; fi @@ -142,7 +142,7 @@ jobs: run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check - name: Download migrated collection artifacts - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: collection path: .cache/collection-tarball @@ -152,6 +152,7 @@ jobs: - name: Setup Integration test Pre-requisites run: | + sudo apt-get update sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0 pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/requirements.txt @@ -161,7 +162,7 @@ jobs: echo $ANSIBLE_NIOSSIM_CONTAINER ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python-version }} --docker --coverage env: - ANSIBLE_NIOSSIM_CONTAINER: quay.io/ansible/nios-test-container:4.0.0 + ANSIBLE_NIOSSIM_CONTAINER: quay.io/ansible/nios-test-container:5.0.0 working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/ # ansible-test support producing code coverage date @@ -200,7 +201,7 @@ jobs: run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check - name: Download migrated collection artifacts - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: collection path: .cache/collection-tarballs diff --git a/changelogs/.plugin-cache.yaml b/changelogs/.plugin-cache.yaml index 3ed1f4b5..8ffcc433 100644 --- a/changelogs/.plugin-cache.yaml +++ b/changelogs/.plugin-cache.yaml @@ -1,3 +1,4 @@ +--- plugins: become: {} cache: {} @@ -27,137 +28,137 @@ plugins: nios_a_record: description: Configure Infoblox NIOS A records name: nios_a_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_aaaa_record: description: Configure Infoblox NIOS AAAA records name: nios_aaaa_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_cname_record: description: Configure Infoblox NIOS CNAME records name: nios_cname_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_dns_view: description: Configure Infoblox NIOS DNS views name: nios_dns_view - namespace: '' + namespace: "" version_added: 1.0.0 nios_dtc_lbdn: description: Configure Infoblox NIOS DTC LBDN name: nios_dtc_lbdn - namespace: '' + namespace: "" version_added: 1.1.0 nios_dtc_pool: description: Configure Infoblox NIOS DTC Pool name: nios_dtc_pool - namespace: '' + namespace: "" version_added: 1.1.0 nios_dtc_server: description: Configure Infoblox NIOS DTC Server name: nios_dtc_server - namespace: '' + namespace: "" version_added: 1.1.0 nios_dtc_monitor_http: description: Configure Infoblox NIOS DTC HTTP monitor name: nios_dtc_monitor_http - namespace: '' + namespace: "" version_added: 1.6.0 nios_dtc_monitor_tcp: description: Configure Infoblox NIOS DTC TCP monitor name: nios_dtc_monitor_tcp - namespace: '' + namespace: "" version_added: 1.6.0 nios_dtc_monitor_icmp: description: Configure Infoblox NIOS DTC ICMP monitor name: nios_dtc_monitor_icmp - namespace: '' + namespace: "" version_added: 1.6.0 nios_dtc_monitor_pdp: description: Configure Infoblox NIOS DTC PDP monitor name: nios_dtc_monitor_pdp - namespace: '' + namespace: "" version_added: 1.6.0 nios_dtc_monitor_sip: description: Configure Infoblox NIOS DTC SIP monitor name: nios_dtc_monitor_sip - namespace: '' + namespace: "" version_added: 1.6.0 nios_dtc_monitor_snmp: description: Configure Infoblox NIOS DTC SNMP monitor name: nios_dtc_monitor_snmp - namespace: '' + namespace: "" version_added: 1.6.0 nios_dtc_topology: description: Configure Infoblox NIOS DTC Topology name: nios_dtc_topology - namespace: '' + namespace: "" version_added: 1.6.0 nios_fixed_address: description: Configure Infoblox NIOS DHCP Fixed Address name: nios_fixed_address - namespace: '' + namespace: "" version_added: 1.0.0 nios_host_record: description: Configure Infoblox NIOS host records name: nios_host_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_member: description: Configure Infoblox NIOS members name: nios_member - namespace: '' + namespace: "" version_added: 1.0.0 nios_mx_record: description: Configure Infoblox NIOS MX records name: nios_mx_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_naptr_record: description: Configure Infoblox NIOS NAPTR records name: nios_naptr_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_network: description: Configure Infoblox NIOS network object name: nios_network - namespace: '' + namespace: "" version_added: 1.0.0 nios_network_view: description: Configure Infoblox NIOS network views name: nios_network_view - namespace: '' + namespace: "" version_added: 1.0.0 nios_nsgroup: description: Configure InfoBlox DNS Nameserver Groups name: nios_nsgroup - namespace: '' + namespace: "" version_added: 1.0.0 nios_ptr_record: description: Configure Infoblox NIOS PTR records name: nios_ptr_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_restartservices: description: Restart grid services. name: nios_restartservices - namespace: '' + namespace: "" version_added: 1.1.0 nios_srv_record: description: Configure Infoblox NIOS SRV records name: nios_srv_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_txt_record: description: Configure Infoblox NIOS txt records name: nios_txt_record - namespace: '' + namespace: "" version_added: 1.0.0 nios_zone: description: Configure Infoblox NIOS DNS zones name: nios_zone - namespace: '' + namespace: "" version_added: 1.0.0 netconf: {} shell: {} diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index ec67aff0..056bf800 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -1,262 +1,252 @@ -ancestor: null +--- +ancestor: releases: 1.0.0: changes: - release_summary: 'First release of the `nios_modules` collection! This release - includes multiple plugins:- an `api` plugin, a `network` plugin, a `nios` - plugin, a `nios_inventory` plugin, a `lookup plugin`, a `nios_next_ip` plugin, - a `nios_next_network` plugin ' + release_summary: "First release of the `nios_modules` collection! This release includes multiple plugins:- an + `api` plugin, a `network` plugin, a `nios` plugin, a `nios_inventory` plugin, a `lookup plugin`, + a `nios_next_ip` plugin, a `nios_next_network` plugin " modules: - - description: Configure Infoblox NIOS A records - name: nios_a_record - namespace: '' - - description: Configure Infoblox NIOS AAAA records - name: nios_aaaa_record - namespace: '' - - description: Configure Infoblox NIOS CNAME records - name: nios_cname_record - namespace: '' - - description: Configure Infoblox NIOS DNS views - name: nios_dns_view - namespace: '' - - description: Configure Infoblox NIOS DHCP Fixed Address - name: nios_fixed_address - namespace: '' - - description: Configure Infoblox NIOS host records - name: nios_host_record - namespace: '' - - description: Configure Infoblox NIOS members - name: nios_member - namespace: '' - - description: Configure Infoblox NIOS MX records - name: nios_mx_record - namespace: '' - - description: Configure Infoblox NIOS NAPTR records - name: nios_naptr_record - namespace: '' - - description: Configure Infoblox NIOS network object - name: nios_network - namespace: '' - - description: Configure Infoblox NIOS network views - name: nios_network_view - namespace: '' - - description: Configure Infoblox NIOS Nameserver Groups - name: nios_nsgroup - namespace: '' - - description: Configure Infoblox NIOS PTR records - name: nios_ptr_record - namespace: '' - - description: Configure Infoblox NIOS SRV records - name: nios_srv_record - namespace: '' - - description: Configure Infoblox NIOS txt records - name: nios_txt_record - namespace: '' - - description: Configure Infoblox NIOS DNS zones - name: nios_zone - namespace: '' + - description: Configure Infoblox NIOS A records + name: nios_a_record + namespace: "" + - description: Configure Infoblox NIOS AAAA records + name: nios_aaaa_record + namespace: "" + - description: Configure Infoblox NIOS CNAME records + name: nios_cname_record + namespace: "" + - description: Configure Infoblox NIOS DNS views + name: nios_dns_view + namespace: "" + - description: Configure Infoblox NIOS DHCP Fixed Address + name: nios_fixed_address + namespace: "" + - description: Configure Infoblox NIOS host records + name: nios_host_record + namespace: "" + - description: Configure Infoblox NIOS members + name: nios_member + namespace: "" + - description: Configure Infoblox NIOS MX records + name: nios_mx_record + namespace: "" + - description: Configure Infoblox NIOS NAPTR records + name: nios_naptr_record + namespace: "" + - description: Configure Infoblox NIOS network object + name: nios_network + namespace: "" + - description: Configure Infoblox NIOS network views + name: nios_network_view + namespace: "" + - description: Configure Infoblox NIOS Nameserver Groups + name: nios_nsgroup + namespace: "" + - description: Configure Infoblox NIOS PTR records + name: nios_ptr_record + namespace: "" + - description: Configure Infoblox NIOS SRV records + name: nios_srv_record + namespace: "" + - description: Configure Infoblox NIOS txt records + name: nios_txt_record + namespace: "" + - description: Configure Infoblox NIOS DNS zones + name: nios_zone + namespace: "" plugins: lookup: - - description: Query Infoblox NIOS objects - name: nios - namespace: null - - description: Return the next available IP address for a network - name: nios_next_ip - namespace: null - - description: Return the next available network range for a network-container - name: nios_next_network - namespace: null - release_date: '2020-10-23' + - description: Query Infoblox NIOS objects + name: nios + namespace: + - description: Return the next available IP address for a network + name: nios_next_ip + namespace: + - description: Return the next available network range for a network-container + name: nios_next_network + namespace: + release_date: "2020-10-23" 1.0.1: changes: minor_changes: - - Made it compatible for Ansible v3.0.0 + - Made it compatible for Ansible v3.0.0 release_summary: This release provides compatibilty for Ansible v3.0.0 - release_date: '2021-01-25' + release_date: "2021-01-25" 1.0.2: changes: minor_changes: - - Fixed the ignored sanity errors required for Ansible 3.0.0 collection - - Made it compatible for Ansible v3.0.0 + - Fixed the ignored sanity errors required for Ansible 3.0.0 collection + - Made it compatible for Ansible v3.0.0 release_summary: This release provides compatibilty for Ansible v3.0.0 - release_date: '2021-01-27' + release_date: "2021-01-27" 1.1.0: changes: release_summary: This release provides plugins for NIOS DTC modules: - - description: Configure Infoblox NIOS DTC LBDN - name: nios_dtc_lbdn - namespace: '' - - description: Configure Infoblox NIOS DTC Pool - name: nios_dtc_pool - namespace: '' - - description: Configure Infoblox NIOS DTC Server - name: nios_dtc_server - namespace: '' - - description: Restart grid services. - name: nios_restartservices - namespace: '' - release_date: '2021-04-12' + - description: Configure Infoblox NIOS DTC LBDN + name: nios_dtc_lbdn + namespace: "" + - description: Configure Infoblox NIOS DTC Pool + name: nios_dtc_pool + namespace: "" + - description: Configure Infoblox NIOS DTC Server + name: nios_dtc_server + namespace: "" + - description: Restart grid services. + name: nios_restartservices + namespace: "" + release_date: "2021-04-12" 1.1.1: changes: bugfixes: - - Implemented the bugfixes provided by Ansible `community.general` - - Update the name of existing A and AAAA records `#70 `_ - - Update of comment field of SRV, PTR and NAPTR records failing with the following error `#70 `_ - - PTR Record failed to update and raises KeyError for view field `#70 `_ - - Update comment field and delete an existing Fixed Address `#73 `_ - - GitHub issue fix - Lookup module for next available IPV6 `#31 `_ - - GitHub issue fix - [nios_zone] changing a nios_zone does not work `#60 `_ - - GitHub issue fix - Getting an error, running every module `#67 `_ - - GitHub issue fix - Error - Dictionary Issues `#68 `_ - - GitHub issue fix - Examples for lookups don't work as written `#72 `_ - - Sanity fixes as per Ansible guidelines to all modules + - Implemented the bugfixes provided by Ansible `community.general` + - Update the name of existing A and AAAA records `#70 `_ + - Update of comment field of SRV, PTR and NAPTR records failing with the following error + `#70 `_ + - PTR Record failed to update and raises KeyError for view field `#70 `_ + - Update comment field and delete an existing Fixed Address `#73 `_ + - GitHub issue fix - Lookup module for next available IPV6 `#31 `_ + - GitHub issue fix - [nios_zone] changing a nios_zone does not work `#60 `_ + - GitHub issue fix - Getting an error, running every module `#67 `_ + - GitHub issue fix - Error - Dictionary Issues `#68 `_ + - GitHub issue fix - Examples for lookups don't work as written `#72 `_ + - Sanity fixes as per Ansible guidelines to all modules minor_changes: - - The modules are standardized as per Ansible guidelines - release_summary: 'Support for creating IPv6 Fixed Address with DUID, - Support added to return the next available IP address for an IPv6 network, - Modules made compatible to work with ansible-core 2.11, - Issue fixes and standardization of modules as per Ansible guidelines' - release_date: '2021-09-07' + - The modules are standardized as per Ansible guidelines + release_summary: Support for creating IPv6 Fixed Address with DUID, Support added to return the next available IP address + for an IPv6 network, Modules made compatible to work with ansible-core 2.11, Issue fixes and standardization of modules as per Ansible guidelines + release_date: "2021-09-07" 1.1.2: changes: bugfixes: - - Handle NoneType parsing in nios_inventory.py `#81 `_ - - Check all dhcp options, not just first one `#83 `_ + - Handle NoneType parsing in nios_inventory.py `#81 `_ + - Check all dhcp options, not just first one `#83 `_ minor_changes: - - Changes in inventory and lookup plugins documentation `#85 `_ - - Directory restructure and added integration & unit tests `#87 `_ - release_summary: 'Issue fixes and standardization of inventory plugin and lookup modules as per Ansible guidelines, - Directory restructure and added integration & unit tests' - release_date: '2021-10-12' + - Changes in inventory and lookup plugins documentation `#85 `_ + - Directory restructure and added integration & unit tests `#87 `_ + release_summary: Issue fixes and standardization of inventory plugin and lookup modules as per Ansible guidelines, + Directory restructure and added integration & unit tests + release_date: "2021-10-12" 1.2.0: changes: bugfixes: - - nios_a_record module - KeyError 'old_ipv4addr' `#79 `_ - - Ansible playbook fails to update canonical name of CName Record `#97 `_ + - nios_a_record module - KeyError 'old_ipv4addr' `#79 `_ + - Ansible playbook fails to update canonical name of CName Record `#97 `_ minor_changes: - - Updated 'required' field in modules `#99 `_ - - Following options are made required in the modules - | Record | Option made required | - | ------ | -------------------- | - | A | ipv4addr | - | AAAA | ipv6addr | - | CNAME | canonical | - | MX | mail_exchanger, preference | - | PTR | ptrdname | - release_summary: 'Issue fixes to update A Record using `next_available_ip` function, - Added a new feature - Update canonical name of the CNAME Record, - Updated the `required` fields in modules' - release_date: '2021-12-13' + - Updated 'required' field in modules `#99 `_ + - Following options are made required in the modules + | Record | Option made required | | ------ | -------------------- | | A | ipv4addr | | AAAA | ipv6addr| + | CNAME | canonical | | MX | mail_exchanger, preference | | PTR | ptrdname | + release_summary: Issue fixes to update A Record using `next_available_ip` function, Added a new feature + - Update canonical name of the CNAME Record, Updated the `required` fields in modules + release_date: "2021-12-13" 1.2.1: changes: minor_changes: - - Added tags 'cloud' and 'networking' in 'galaxy.yaml' - release_summary: 'Added tags to support release on Ansible Automation Hub' - release_date: '2021-12-20' + - Added tags 'cloud' and 'networking' in 'galaxy.yaml' + release_summary: Added tags to support release on Ansible Automation Hub + release_date: "2021-12-20" 1.2.2: changes: minor_changes: - - Fix to create PTR record in different network views `#103 `_ - - Remove use_option for DHCP option 60 `#104 `_ - - Allow specifying a template when creating a network `#105 `_ - - Fix unit and sanity test issues `#117 `_ - - Expanding for disable value `#119 `_ - release_summary: 'Issue fixes to create PTR record in different network views, - Support extended to determine whether the DTC server is disabled or not' - release_date: '2022-05-23' + - Fix to create PTR record in different network views `#103 `_ + - Remove use_option for DHCP option 60 `#104 `_ + - Allow specifying a template when creating a network `#105 `_ + - Fix unit and sanity test issues `#117 `_ + - Expanding for disable value `#119 `_ + release_summary: Issue fixes to create PTR record in different network views, Support extended to determine whether the DTC server is disabled or not + release_date: "2022-05-23" 1.3.0: changes: major_changes: - - Update operation using `old_name` and `new_name` for the object with dummy name in `old_name` (which does not exist in system) will not create a new object in the system. An error will be thrown stating the object does not exist in the system `#129 `_ - - Update `text` field of TXT Record `#128 `_ + - Update operation using `old_name` and `new_name` for the object with dummy name in `old_name` + (which does not exist in system) will not create a new object in the system. An error will be thrown stating the object does not exist in the + system `#129 `_ + - Update `text` field of TXT Record `#128 `_ bugfixes: - - Fix to create TXT record with equals sign `#128 `_ - release_summary: 'Issue fixes to create TXT record with equals sign, - For nonexistent record, update operation creates the new record, - For nonexistent IPv4Address, update operation creates a new A record with new_ipv4addr' - release_date: '2022-07-01' + - Fix to create TXT record with equals sign `#128 `_ + release_summary: Issue fixes to create TXT record with equals sign, For nonexistent record, update operation + creates the new record, For nonexistent IPv4Address, update operation creates a new A record with new_ipv4addr + release_date: "2022-07-01" 1.4.0: changes: major_changes: - - Feature for extra layer security , with `cert` and `key` parameters in playbooks for authenticating using certificate and key ``*.pem`` file absolute path `#154 `_ - - Fix to remove issue causing due to template attr in deleting network using Ansible module nios network `#147 `_ - release_summary: 'For ansible module, added certificate authentication feature, - Few bugs fix in ansible module nios network' - release_date: '2022-10-12' + - Feature for extra layer security , with `cert` and `key` parameters in playbooks for authenticating + using certificate and key ``*.pem`` file absolute path `#154 `_ + - Fix to remove issue causing due to template attr in deleting network using Ansible module nios network + `#147 `_ + release_summary: For ansible module, added certificate authentication feature, Few bugs fix in ansible module nios network + release_date: "2022-10-12" 1.4.1: changes: minor_changes: - - Fix to specify network_view in lookup modules to return absolute network and ip `#157 `_ - - Fix to camelcase issue for updating 'nios_network_view' name `#163 `_ - - Fix to allocate ip to a_record dynamically `#163 `_ - - Fix to update 'nios_a_record' name with multiple ips having same name `#164 `_ - - Fix to changelog yaml file with linting issues `#161 `_ - release_summary: 'Ansible Lookup modules can specify network_view to which a network/ip belongs, - Fixes camelCase issue while updating `nios_network_view` with `new_name`, - Fixes issue to allocate ip to a_record dynamically, - Updates `nios_a_record` name with multiple ips having same name' - release_date: '2022-11-24' + - Fix to specify network_view in lookup modules to return absolute network and ip `#157 `_ + - Fix to camelcase issue for updating 'nios_network_view' name `#163 `_ + - Fix to allocate ip to a_record dynamically `#163 `_ + - Fix to update 'nios_a_record' name with multiple ips having same name `#164 `_ + - Fix to changelog yaml file with linting issues `#161 `_ + release_summary: Ansible Lookup modules can specify network_view to which a network/ip belongs, + Fixes camelCase issue while updating `nios_network_view` with `new_name`, Fixes issue to allocate ip to a_record dynamically, + Updates `nios_a_record` name with multiple ips having same name + release_date: "2022-11-24" 1.5.0: changes: major_changes: - - Added NIOS Range module with Create, Update and Delete features `#152 `_ - - Added Member Assignment to network and ranges `#152 `_ - - Added Grid Master Candidate feature `#152 `_ - - Fixes issue unable to update/delete EAs using Ansible plugin `#180 `_ - - Fixes static and dynamic allocation of IPV4 address of A Record `#182 `_ - - Fixes to Update host name of NIOS member `#176 `_ - - Updates default WAPI version to 2.9 `#176 `_ + - Added NIOS Range module with Create, Update and Delete features `#152 `_ + - Added Member Assignment to network and ranges `#152 `_ + - Added Grid Master Candidate feature `#152 `_ + - Fixes issue unable to update/delete EAs using Ansible plugin `#180 `_ + - Fixes static and dynamic allocation of IPV4 address of A Record `#182 `_ + - Fixes to Update host name of NIOS member `#176 `_ + - Updates default WAPI version to 2.9 `#176 `_ bugfixes: - - Fixes Update A Record having multiple records with same name and different IP `#182 `_ - release_summary: 'Added new module NIOS Range with Create, Update and Delete features, - Added new feature Member Assignment to Networks with add and remove functionality, - Fixes Unable to Update/Delete EAs using Ansible plugin, - Fixes Static Allocation of IPV4 address of A Record, - Updates default WAPI version to `2.9`, - Added Grid Master Candidate feature' - release_date: '2023-05-11' + - Fixes Update A Record having multiple records with same name and different IP `#182 `_ + release_summary: Added new module NIOS Range with Create, Update and Delete features, Added new feature Member Assignment to Networks with add + remove functionality, Fixes Unable to Update/Delete EAs using Ansible plugin, Fixes Static Allocation of IPV4 address of A Record, + Updates default WAPI version to `2.9`, Added Grid Master Candidate feature + release_date: "2023-05-11" 1.6.0: changes: major_changes: - Upgrade Ansible version support from 2.13 to 2.16. - Upgrade Python version support from 3.8 to 3.10. - release_summary: 'Added new modules with CRUD features to manage NIOS DTC health check monitors: DTC HTTP Monitor, - DTC ICMP Monitor, DTC PDP Monitor, DTC SIP Monitor, DTC SNMP Monitor, DTC TCP Monitor. - Added a new module with CRUD features to manage topology rulesets in NIOS. - Added a new field to define topology ruleset for the DTC Pool and DTC LBDN modules.' + release_summary: "Added new modules with CRUD features to manage NIOS DTC health check monitors: DTC HTTP Monitor, DTC ICMP Monitor, + DTC PDP Monitor, DTC SIP Monitor, DTC SNMP Monitor, DTC TCP Monitor. Added a new module with CRUD features to manage topology rulesets in NIOS. + Added a new field to define topology ruleset for the DTC Pool and DTC LBDN modules." bugfixes: - Fixes typo for environment variable INFOBLOX_WAPI_VERSION `#209 `_ - Fixes environment variable max_results using INFOBLOX_MAX_RESULTS `#209 `_ - - Fixes index error for transform fields in DTC LBDN (auth_zone and Pool) and DTC POOL (servers and monitors) `#209 `_ + - Fixes index error for transform fields in DTC LBDN (auth_zone and Pool) and DTC POOL (servers and monitors) + `#209 `_ modules: - - description: Configures the Infoblox NIOS DTC HTTP monitor. - name: nios_dtc_monitor_http - namespace: '' - - description: Configures the Infoblox NIOS DTC ICMP monitor - name: nios_dtc_monitor_icmp - namespace: '' - - description: Configures the Infoblox NIOS DTC PDP monitor - name: nios_dtc_monitor_pdp - namespace: '' - - description: Configures the Infoblox NIOS DTC SIP monitor - name: nios_dtc_monitor_sip - namespace: '' - - description: Configures the Infoblox NIOS DTC SNMP monitor - name: nios_dtc_monitor_snmp - namespace: '' - - description: Configures the Infoblox NIOS DTC TCP monitor - name: nios_dtc_monitor_tcp - namespace: '' - - description: Configures the Infoblox NIOS DTC Topology - name: nios_dtc_topology - namespace: '' - release_date: '2023-12-14' - 1.6.1: - changes: - minor_changes: - - Ansible core version in the dependencies updated to 2.14 or later. - release_summary: 'This release includes the updates of plug-in version 1.6.0 and the following documentation changes: - Ansible core version in the dependencies updated to 2.14 or later.' - release_date: '2023-12-19' + - description: Configures the Infoblox NIOS DTC HTTP monitor. + name: nios_dtc_monitor_http + namespace: "" + - description: Configures the Infoblox NIOS DTC ICMP monitor + name: nios_dtc_monitor_icmp + namespace: "" + - description: Configures the Infoblox NIOS DTC PDP monitor + name: nios_dtc_monitor_pdp + namespace: "" + - description: Configures the Infoblox NIOS DTC SIP monitor + name: nios_dtc_monitor_sip + namespace: "" + - description: Configures the Infoblox NIOS DTC SNMP monitor + name: nios_dtc_monitor_snmp + namespace: "" + - description: Configures the Infoblox NIOS DTC TCP monitor + name: nios_dtc_monitor_tcp + namespace: "" + - description: Configures the Infoblox NIOS DTC Topology + name: nios_dtc_topology + namespace: "" + release_date: "2023-12-14" + 1.6.1: + changes: + minor_changes: + - Ansible core version in the dependencies updated to 2.14 or later. + release_summary: "This release includes the updates of plug-in version 1.6.0 and + the following documentation changes: Ansible core version in the dependencies updated to 2.14 or later." + release_date: "2023-12-19" diff --git a/changelogs/config.yaml b/changelogs/config.yaml index 09a1f378..c1e7596e 100644 --- a/changelogs/config.yaml +++ b/changelogs/config.yaml @@ -1,3 +1,4 @@ +--- changelog_filename_template: ../CHANGELOG.rst changelog_filename_version_depth: 0 changes_file: changelog.yaml @@ -11,22 +12,22 @@ prelude_section_name: release_summary prelude_section_title: Release Summary sanitize_changelog: true sections: -- - major_changes - - Major Changes -- - minor_changes - - Minor Changes -- - breaking_changes - - Breaking Changes / Porting Guide -- - deprecated_features - - Deprecated Features -- - removed_features - - Removed Features (previously deprecated) -- - security_fixes - - Security Fixes -- - bugfixes - - Bugfixes -- - known_issues - - Known Issues + - - major_changes + - Major Changes + - - minor_changes + - Minor Changes + - - breaking_changes + - Breaking Changes / Porting Guide + - - deprecated_features + - Deprecated Features + - - removed_features + - Removed Features (previously deprecated) + - - security_fixes + - Security Fixes + - - bugfixes + - Bugfixes + - - known_issues + - Known Issues title: Infoblox.Nios_Modules trivial_section_name: trivial use_fqcn: true diff --git a/galaxy.yml b/galaxy.yml index 787065d8..6676e2e5 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,3 +1,4 @@ +--- ### REQUIRED # The namespace of the collection. This can be a company/brand/organization or product namespace under which all @@ -17,9 +18,9 @@ readme: README.md # A list of the collection's content authors. Can be just the name or in the format 'Full Name (url) # @nicks:irc/im.site#channel' authors: -- Hemanth Kumar (hkumar3@infoblox.com) -- Jeenitkumar Khatri (jkhatri@infoblox.com) -- Jaykumar Chhatbar (jchhatbar@infoblox.com) + - Hemanth Kumar (hkumar3@infoblox.com) + - Jeenitkumar Khatri (jkhatri@infoblox.com) + - Jaykumar Chhatbar (jchhatbar@infoblox.com) ### OPTIONAL but strongly recommended @@ -29,25 +30,25 @@ description: Infoblox Ansible Collection for vNIOS allows managing your NIOS obj # Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only # accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' license: -- GPL-3.0-only + - GPL-3.0-only # The path to the license file for the collection. This path is relative to the root of the collection. This key is # mutually exclusive with 'license' -license_file: '' +license_file: "" # A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character # requirements as 'namespace' and 'name' tags: -- infoblox -- nios -- cloud -- networking + - infoblox + - nios + - cloud + - networking # Collections that this collection requires to be installed for it to be usable. The key of the dict is the # collection label 'namespace.name'. The value is a version range # L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version # range specifiers can be set and are separated by ',' -#dependencies: {} +# dependencies: {} # The URL of the originating SCM repository repository: https://github.com/infobloxopen/infoblox-ansible/tree/master diff --git a/meta/runtime.yml b/meta/runtime.yml index be99ccf4..1e85b01d 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,2 +1,2 @@ --- -requires_ansible: '>=2.14.0' +requires_ansible: ">=2.15.0" diff --git a/playbooks/create_a_record.yaml b/playbooks/create_a_record.yaml index 29245981..83cc2fdd 100644 --- a/playbooks/create_a_record.yaml +++ b/playbooks/create_a_record.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,11 +9,11 @@ connection: local tasks: - - name: Create Nios A record Test - infoblox.nios_modules.nios_a_record: - name: v55.ansibletestzone.com - view: ansibleDnsView - ipv4: 192.168.11.251 - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create Nios A record Test + infoblox.nios_modules.nios_a_record: + name: v55.ansibletestzone.com + view: ansibleDnsView + ipv4: 192.168.11.251 + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_cname_record.yaml b/playbooks/create_cname_record.yaml index 1c59c7a6..ae2869ad 100644 --- a/playbooks/create_cname_record.yaml +++ b/playbooks/create_cname_record.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,11 +9,11 @@ connection: local tasks: - - name: Create Nios CNAME record - infoblox.nios_modules.nios_cname_record: - name: cname.ansibletestzone.com - canonical: realhost.ansible.com - view: ansibleDnsView - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create Nios CNAME record + infoblox.nios_modules.nios_cname_record: + name: cname.ansibletestzone.com + canonical: realhost.ansible.com + view: ansibleDnsView + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_dns_view.yml b/playbooks/create_dns_view.yml index 834a7c9a..b380ddd0 100644 --- a/playbooks/create_dns_view.yml +++ b/playbooks/create_dns_view.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,12 +9,12 @@ connection: local tasks: - - name: create DNS view - infoblox.nios_modules.nios_dns_view: - name: ansibleDnsView - network_view: ansibleCollectionsView - extattrs: - Site: Test Site - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create DNS view + infoblox.nios_modules.nios_dns_view: + name: ansibleDnsView + network_view: ansibleCollectionsView + extattrs: + Site: Test Site + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_dtc_lbdn.yml b/playbooks/create_dtc_lbdn.yml index 9cbf3ad2..f0a1449c 100644 --- a/playbooks/create_dtc_lbdn.yml +++ b/playbooks/create_dtc_lbdn.yml @@ -1,5 +1,6 @@ --- -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.196.205.10 @@ -9,21 +10,20 @@ connection: local tasks: - - name: 'create DTC LBDN' - infoblox.nios_modules.nios_dtc_lbdn: - name: LBDN1 - lb_method: GLOBAL_AVAILABILITY - pools: - - pool: Pool1 - ratio: 2 - ttl: 100 - auth_zones: - - 'demo.com' - patterns: - - '*.demo.com' - types: - - A - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" -... + - name: Create DTC LBDN + infoblox.nios_modules.nios_dtc_lbdn: + name: LBDN1 + lb_method: GLOBAL_AVAILABILITY + pools: + - pool: Pool1 + ratio: 2 + ttl: 100 + auth_zones: + - demo.com + patterns: + - "*.demo.com" + types: + - A + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_dtc_monitor_http.yaml b/playbooks/create_dtc_monitor_http.yaml index 2d2afc3e..140e4a1d 100644 --- a/playbooks/create_dtc_monitor_http.yaml +++ b/playbooks/create_dtc_monitor_http.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/create_dtc_monitor_icmp.yaml b/playbooks/create_dtc_monitor_icmp.yaml index f792cfa6..50dfa157 100644 --- a/playbooks/create_dtc_monitor_icmp.yaml +++ b/playbooks/create_dtc_monitor_icmp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/create_dtc_monitor_pdp.yaml b/playbooks/create_dtc_monitor_pdp.yaml index ea2bc9b9..09bb1c5d 100644 --- a/playbooks/create_dtc_monitor_pdp.yaml +++ b/playbooks/create_dtc_monitor_pdp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/create_dtc_monitor_sip.yaml b/playbooks/create_dtc_monitor_sip.yaml index 4caa32ea..f2752ab6 100644 --- a/playbooks/create_dtc_monitor_sip.yaml +++ b/playbooks/create_dtc_monitor_sip.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/create_dtc_monitor_snmp.yaml b/playbooks/create_dtc_monitor_snmp.yaml index b8b796ee..accffc41 100644 --- a/playbooks/create_dtc_monitor_snmp.yaml +++ b/playbooks/create_dtc_monitor_snmp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/create_dtc_monitor_tcp.yaml b/playbooks/create_dtc_monitor_tcp.yaml index 95a824a1..f3cc1306 100644 --- a/playbooks/create_dtc_monitor_tcp.yaml +++ b/playbooks/create_dtc_monitor_tcp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/create_dtc_pool.yml b/playbooks/create_dtc_pool.yml index 96a59f29..4d168c6e 100644 --- a/playbooks/create_dtc_pool.yml +++ b/playbooks/create_dtc_pool.yml @@ -1,5 +1,6 @@ --- -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.196.205.10 @@ -9,17 +10,16 @@ connection: local tasks: - - name: 'create DTC Pool' - infoblox.nios_modules.nios_dtc_pool: - name: Pool1 - lb_preferred_method: ROUND_ROBIN - servers: - - server: Server1 - ratio: 1 - monitors: - - name: monitor1 - type: icmp - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" -... + - name: Create DTC Pool + infoblox.nios_modules.nios_dtc_pool: + name: Pool1 + lb_preferred_method: ROUND_ROBIN + servers: + - server: Server1 + ratio: 1 + monitors: + - name: monitor1 + type: icmp + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_dtc_server.yml b/playbooks/create_dtc_server.yml index dd0c0388..7b7d2101 100644 --- a/playbooks/create_dtc_server.yml +++ b/playbooks/create_dtc_server.yml @@ -1,5 +1,6 @@ --- -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.196.205.10 @@ -9,11 +10,10 @@ connection: local tasks: - - name: 'create DTC server' - infoblox.nios_modules.nios_dtc_server: - name: Server1 - host: 10.196.200.74 - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" -... + - name: Create DTC server + infoblox.nios_modules.nios_dtc_server: + name: Server1 + host: 10.196.200.74 + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_dtc_topology.yml b/playbooks/create_dtc_topology.yml index 01c50bd4..d721d8ea 100644 --- a/playbooks/create_dtc_topology.yml +++ b/playbooks/create_dtc_topology.yml @@ -1,5 +1,6 @@ --- -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.196.205.10 diff --git a/playbooks/create_extensible_attribute.yaml b/playbooks/create_extensible_attribute.yaml new file mode 100644 index 00000000..17a4c3a2 --- /dev/null +++ b/playbooks/create_extensible_attribute.yaml @@ -0,0 +1,20 @@ +--- + +- hosts: localhost + vars: + nios_provider: + host: 10.120.1.11 + username: admin + password: infoblox + + connection: local + tasks: + - name: Create INT extensible attribute + infoblox.nios_modules.nios_extensible_attribute: + name: integer_ea + type: INTEGER + default_value: 11 + comment: Created with Ansible + flags: 'I' + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_mx_record.yaml b/playbooks/create_mx_record.yaml index ac8c8f34..533a068e 100644 --- a/playbooks/create_mx_record.yaml +++ b/playbooks/create_mx_record.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,12 +9,12 @@ connection: local tasks: - - name: Create Nios MX record - infoblox.nios_modules.nios_mx_record: - name: mx.ansibletestzone.com - mx: mailhost.ansible.com - view: ansibleDnsView - preference: 0 - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create Nios MX record + infoblox.nios_modules.nios_mx_record: + name: mx.ansibletestzone.com + mx: mailhost.ansible.com + view: ansibleDnsView + preference: 0 + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_network.yml b/playbooks/create_network.yml index c309105f..de11bc0f 100644 --- a/playbooks/create_network.yml +++ b/playbooks/create_network.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,15 +9,15 @@ connection: local tasks: - - name: create network - infoblox.nios_modules.nios_network: - network: 10.0.0.0/24 - network_view: ansibleCollectionsView - options: - - name: domain-name - value: infoblox-ansible.com - extattrs: - Site: Test Site - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create network + infoblox.nios_modules.nios_network: + network: 10.0.0.0/24 + network_view: ansibleCollectionsView + options: + - name: domain-name + value: infoblox-ansible.com + extattrs: + Site: Test Site + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_network_view.yml b/playbooks/create_network_view.yml index ca372187..10762fd3 100644 --- a/playbooks/create_network_view.yml +++ b/playbooks/create_network_view.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,11 +9,11 @@ connection: local tasks: - - name: create network view - infoblox.nios_modules.nios_network_view: - name: ansibleCollectionsView - extattrs: - Site: Test Site - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create network view + infoblox.nios_modules.nios_network_view: + name: ansibleCollectionsView + extattrs: + Site: Test Site + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_txt_record.yaml b/playbooks/create_txt_record.yaml index d0a28058..65730a63 100644 --- a/playbooks/create_txt_record.yaml +++ b/playbooks/create_txt_record.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,11 +9,11 @@ connection: local tasks: - - name: Create Nios TXT record - infoblox.nios_modules.nios_txt_record: - name: one.txt.ansibletestzone.com - text: example_text45 - view: ansibleDnsView - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create Nios TXT record + infoblox.nios_modules.nios_txt_record: + name: one.txt.ansibletestzone.com + text: example_text45 + view: ansibleDnsView + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/create_zone.yml b/playbooks/create_zone.yml index 63b874e2..c986b167 100644 --- a/playbooks/create_zone.yml +++ b/playbooks/create_zone.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -10,12 +10,12 @@ connection: local tasks: - - name: create zone - infoblox.nios_modules.nios_zone: - name: ansibletestzone.com - view: ansibleDnsView - extattrs: - Site: Test Site - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Create zone + infoblox.nios_modules.nios_zone: + name: ansibletestzone.com + view: ansibleDnsView + extattrs: + Site: Test Site + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_cname_record.yaml b/playbooks/delete_cname_record.yaml index f7f753a7..d6fd96ed 100644 --- a/playbooks/delete_cname_record.yaml +++ b/playbooks/delete_cname_record.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,10 +9,10 @@ connection: local tasks: - - name: Delete Nios CNAME record - infoblox.nios_modules.nios_cname_record: - name: cname.ansible.com - canonical: realhost.ansible.com - comment: Created with Ansible - state: absent - provider: "{{ nios_provider }}" + - name: Delete Nios CNAME record + infoblox.nios_modules.nios_cname_record: + name: cname.ansible.com + canonical: realhost.ansible.com + comment: Created with Ansible + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_dnsview.yml b/playbooks/delete_dnsview.yml index bb5e22a2..8d02d9cc 100644 --- a/playbooks/delete_dnsview.yml +++ b/playbooks/delete_dnsview.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,9 +9,9 @@ connection: local tasks: - - name: delete DNS view - infoblox.nios_modules.nios_dns_view: - name: ansibleDnsView - network_view: ansibleNetView - state: absent - provider: "{{ nios_provider }}" + - name: Delete DNS view + infoblox.nios_modules.nios_dns_view: + name: ansibleDnsView + network_view: ansibleNetView + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_dtc_monitor_http.yaml b/playbooks/delete_dtc_monitor_http.yaml index 29427ebd..5e04d20d 100644 --- a/playbooks/delete_dtc_monitor_http.yaml +++ b/playbooks/delete_dtc_monitor_http.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/delete_dtc_monitor_icmp.yaml b/playbooks/delete_dtc_monitor_icmp.yaml index eca2975f..d8bc33c9 100644 --- a/playbooks/delete_dtc_monitor_icmp.yaml +++ b/playbooks/delete_dtc_monitor_icmp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/delete_dtc_monitor_pdp.yaml b/playbooks/delete_dtc_monitor_pdp.yaml index b69fb462..a23fd962 100644 --- a/playbooks/delete_dtc_monitor_pdp.yaml +++ b/playbooks/delete_dtc_monitor_pdp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/delete_dtc_monitor_sip.yaml b/playbooks/delete_dtc_monitor_sip.yaml index 1fbc0e29..962756d4 100644 --- a/playbooks/delete_dtc_monitor_sip.yaml +++ b/playbooks/delete_dtc_monitor_sip.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/delete_dtc_monitor_snmp.yaml b/playbooks/delete_dtc_monitor_snmp.yaml index 972751a6..48f97879 100644 --- a/playbooks/delete_dtc_monitor_snmp.yaml +++ b/playbooks/delete_dtc_monitor_snmp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/delete_dtc_monitor_tcp.yaml b/playbooks/delete_dtc_monitor_tcp.yaml index 662df448..b4a500d4 100644 --- a/playbooks/delete_dtc_monitor_tcp.yaml +++ b/playbooks/delete_dtc_monitor_tcp.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 diff --git a/playbooks/delete_dtc_topology.yml b/playbooks/delete_dtc_topology.yml index 1782aa67..663a82c5 100644 --- a/playbooks/delete_dtc_topology.yml +++ b/playbooks/delete_dtc_topology.yml @@ -1,5 +1,6 @@ --- -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.196.205.10 @@ -9,7 +10,7 @@ connection: local tasks: - - name: delete a DTC Topology + - name: Delete a DTC Topology infoblox.nios_modules.nios_dtc_topology: name: a_topology state: absent diff --git a/playbooks/delete_mx_record.yaml b/playbooks/delete_mx_record.yaml index 9a4475ec..77d3208b 100644 --- a/playbooks/delete_mx_record.yaml +++ b/playbooks/delete_mx_record.yaml @@ -1,19 +1,19 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: - host: 10.36.118.2 + host: 10.36.118.2 username: cloudadmin password: admin connection: local tasks: - - name: delete Nios MX record - infoblox.nios_modules.nios_mx_record: - name: ansible.com - mx: mailhost.ansible.com - preference: 0 - comment: Created with Ansible - state: absent - provider: "{{ nios_provider }}" + - name: Delete Nios MX record + infoblox.nios_modules.nios_mx_record: + name: ansible.com + mx: mailhost.ansible.com + preference: 0 + comment: Created with Ansible + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_network.yml b/playbooks/delete_network.yml index 304dccc0..c0d9ba45 100644 --- a/playbooks/delete_network.yml +++ b/playbooks/delete_network.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.60.27.4 @@ -9,9 +9,9 @@ connection: local tasks: - - name: delete network - infoblox.nios_modules.nios_network: - network: 10.0.0.0/24 - network_view: ansibleNetView - state: absent - provider: "{{ nios_provider }}" + - name: Delete network + infoblox.nios_modules.nios_network: + network: 10.0.0.0/24 + network_view: ansibleNetView + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_network_view.yml b/playbooks/delete_network_view.yml index e0a7b119..458a4809 100644 --- a/playbooks/delete_network_view.yml +++ b/playbooks/delete_network_view.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.60.27.4 @@ -9,8 +9,8 @@ connection: local tasks: - - name: delete network view - infoblox.nios_modules.nios_network_view: - name: ansibleNetView - state: absent - provider: "{{ nios_provider }}" + - name: Delete network view + infoblox.nios_modules.nios_network_view: + name: ansibleNetView + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_txt_record.yaml b/playbooks/delete_txt_record.yaml index ea9269af..7510ab35 100644 --- a/playbooks/delete_txt_record.yaml +++ b/playbooks/delete_txt_record.yaml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,11 +9,11 @@ connection: local tasks: - - name: delete Nios TXT record - infoblox.nios_modules.nios_txt_record: - name: fqdn.txt.ansible.com - text: example_text - view: default - comment: Created with Ansible - state: absent - provider: "{{ nios_provider }}" + - name: Delete Nios TXT record + infoblox.nios_modules.nios_txt_record: + name: fqdn.txt.ansible.com + text: example_text + view: default + comment: Created with Ansible + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/delete_zone.yml b/playbooks/delete_zone.yml index ca50801a..02eb55c2 100644 --- a/playbooks/delete_zone.yml +++ b/playbooks/delete_zone.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.36.118.2 @@ -9,9 +9,9 @@ connection: local tasks: - - name: delete zone - infoblox.nios_modules.nios_zone: - name: ansiblezone.com - view: ansibleDnsView - state: absent - provider: "{{ nios_provider }}" + - name: Delete zone + infoblox.nios_modules.nios_zone: + name: ansiblezone.com + view: ansibleDnsView + state: absent + provider: "{{ nios_provider }}" diff --git a/playbooks/restart_services.yml b/playbooks/restart_services.yml index b8b8fe61..2255b4e2 100644 --- a/playbooks/restart_services.yml +++ b/playbooks/restart_services.yml @@ -1,5 +1,6 @@ --- -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.196.205.10 @@ -9,7 +10,6 @@ connection: local tasks: - - name: Restart Services - infoblox.nios_modules.nios_restartservices: - provider: "{{ nios_provider }}" -... + - name: Restart Services + infoblox.nios_modules.nios_restartservices: + provider: "{{ nios_provider }}" diff --git a/playbooks/update_a_record.yml b/playbooks/update_a_record.yml index 2630c3bb..709305c2 100644 --- a/playbooks/update_a_record.yml +++ b/playbooks/update_a_record.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.34.34.175 @@ -9,11 +9,11 @@ connection: local tasks: - - name: Update Nios A record - infoblox.nios_modules.nios_a_record: - name: {new_name: v7.testzone.com, old_name: v7.testzone.com} - view: testDnsView - ipv4: 1.1.11.2 - comment: Created with Ansible - state: present - provider: "{{ nios_provider }}" + - name: Update Nios A record + infoblox.nios_modules.nios_a_record: + name: { new_name: v7.testzone.com, old_name: v7.testzone.com } + view: testDnsView + ipv4: 1.1.11.2 + comment: Created with Ansible + state: present + provider: "{{ nios_provider }}" diff --git a/playbooks/update_member.yml b/playbooks/update_member.yml index 39156913..f161f461 100644 --- a/playbooks/update_member.yml +++ b/playbooks/update_member.yml @@ -1,6 +1,6 @@ --- - -- hosts: localhost +- name: Infoblox Member Configuration + hosts: localhost vars: nios_provider: host: 10.34.10.724 @@ -8,15 +8,15 @@ password: cloudadmin connection: local tasks: - - name: update member host name - infoblox.nios_modules.nios_member: - host_name: {old_name: block1.localdomain, new_name: member01.localdomain} - master_candidate: false - vip_setting: - - address: 120.0.0.25 - subnet_mask: 255.255.255.0 - gateway: 120.0.0.1 - config_addr_type: IPV4 - platform: VNIOS - state: present - provider: "{{ nios_provider }}" \ No newline at end of file + - name: Update member host name + infoblox.nios_modules.nios_member: + host_name: { old_name: block1.localdomain, new_name: member01.localdomain } + master_candidate: false + vip_setting: + - address: 120.0.0.25 + subnet_mask: 255.255.255.0 + gateway: 120.0.0.1 + config_addr_type: IPV4 + platform: VNIOS + state: present + provider: "{{ nios_provider }}" diff --git a/plugins/lookup/nios_next_ip.py b/plugins/lookup/nios_next_ip.py index 9b3dd8cd..be059db0 100644 --- a/plugins/lookup/nios_next_ip.py +++ b/plugins/lookup/nios_next_ip.py @@ -63,7 +63,7 @@ - name: return the next 3 available IP addresses for network 192.168.10.0/24 ansible.builtin.set_fact: - ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', num=3, \ + ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', num=3, provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}" - name: return the next 3 available IP addresses for network 192.168.10.0/24 @@ -103,20 +103,20 @@ def run(self, terms, variables=None, **kwargs): provider = kwargs.pop('provider', {}) wapi = WapiLookup(provider) + network_view = kwargs.get('network_view', 'default') if isinstance(ipaddress.ip_network(network), ipaddress.IPv6Network): object_type = 'ipv6range' if kwargs.get('use_range', False) else 'ipv6network' else: object_type = 'range' if kwargs.get('use_range', False) else 'network' - network_obj = wapi.get_object(object_type, {'network': network}) + network_obj = wapi.get_object(object_type, {'network': network, 'network_view': network_view}) if network_obj is None: raise AnsibleError('unable to find network object %s' % network) num = kwargs.get('num', 1) exclude_ip = kwargs.get('exclude', []) - network_view = kwargs.get('network_view', 'default') ref_list = [network['_ref'] for network in network_obj if network['network_view'] == network_view] if not ref_list: diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index 9e8ff037..73080e33 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -223,6 +223,8 @@ def convert_ea_list_to_struct(member_spec): ''' Transforms the list of the values into a valid WAPI struct. ''' if 'list_values' in member_spec.keys(): + if all(isinstance(item, dict) for item in member_spec['list_values']): + member_spec['list_values'] = [item['value'] for item in member_spec['list_values']] member_spec['list_values'] = [{'_struct': 'extensibleattributedef:listvalues', 'value': v} for v in member_spec['list_values']] return member_spec @@ -386,6 +388,18 @@ def run(self, ib_obj_type, ib_spec): if (ib_obj_type == NIOS_IPV4_NETWORK or ib_obj_type == NIOS_IPV6_NETWORK): proposed_object = convert_members_to_struct(proposed_object) + if ib_obj_type in {NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER, NIOS_IPV4_NETWORK, NIOS_IPV6_NETWORK, NIOS_RANGE}: + + # Iterate over each option and remove the 'num' key + if current_object.get('options') or proposed_object.get('options'): + if proposed_object.get('options'): + # remove use_options false from proposed_object + proposed_object['options'] = [option for option in proposed_object['options'] if option.get('use_option', True)] + + if current_object.get('options'): + # remove use_options false from current_object + current_object['options'] = [option for option in current_object['options'] if option.get('use_option', True)] + if (ib_obj_type == NIOS_RANGE): if proposed_object.get('new_start_addr'): proposed_object['start_addr'] = proposed_object.get('new_start_addr') @@ -396,6 +410,11 @@ def run(self, ib_obj_type, ib_spec): if (ib_obj_type == NIOS_EXTENSIBLE_ATTRIBUTE): proposed_object = convert_ea_list_to_struct(proposed_object) + current_object = convert_ea_list_to_struct(current_object) + # Convert 'default_value' to string in both proposed_object and current_object if it exists + for obj in (proposed_object, current_object): + if 'default_value' in obj: + obj['default_value'] = str(obj['default_value']) # checks if the 'text' field has to be updated for the TXT Record if (ib_obj_type == NIOS_TXT_RECORD): @@ -487,6 +506,8 @@ def run(self, ib_obj_type, ib_spec): result['changed'] = True elif 'network_view' in proposed_object and (ib_obj_type not in (NIOS_IPV4_FIXED_ADDRESS, NIOS_IPV6_FIXED_ADDRESS, NIOS_RANGE)): proposed_object.pop('network_view') + if ib_obj_type in (NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER): + proposed_object.pop('network') result['changed'] = True if not self.module.check_mode and res is None: proposed_object = self.on_update(proposed_object, ib_spec) @@ -642,13 +663,18 @@ def compare_objects(self, current_object, proposed_object): # If the lists are of a different length the objects can not be # equal and False will be returned before comparing the lists items # this code part will work for members assignment - if key == 'members' and (len(proposed_item) != len(current_item)): + if key in ['members', 'options'] and (len(proposed_item) != len(current_item)): return False for subitem in proposed_item: if not self.issubset(subitem, current_item): return False + # If the lists are of a different length the objects and order of element mismatch + # Ignore DHCP options while comparing due to extra num param is get response + if key == 'logic_filter_rules' and proposed_item != current_item: + return False + elif isinstance(proposed_item, dict): # Compare the items of the dict to see if they are equal. A # difference stops the comparison and returns false. If they diff --git a/plugins/modules/nios_dtc_lbdn.py b/plugins/modules/nios_dtc_lbdn.py index bc5a79c1..fe99d0e5 100644 --- a/plugins/modules/nios_dtc_lbdn.py +++ b/plugins/modules/nios_dtc_lbdn.py @@ -183,7 +183,6 @@ def auth_zones_transform(module): else: module.fail_json( msg='auth_zone %s cannot be found.' % zone) - # epdb.serve() return zone_list def pools_transform(module): diff --git a/plugins/modules/nios_extensible_attribute.py b/plugins/modules/nios_extensible_attribute.py index 50e6b9ff..35792448 100644 --- a/plugins/modules/nios_extensible_attribute.py +++ b/plugins/modules/nios_extensible_attribute.py @@ -177,7 +177,6 @@ username: admin password: admin connection: local - ''' RETURN = ''' # ''' diff --git a/plugins/modules/nios_member.py b/plugins/modules/nios_member.py index 9662c9fb..ddb0bf15 100644 --- a/plugins/modules/nios_member.py +++ b/plugins/modules/nios_member.py @@ -455,11 +455,11 @@ router_id: 150 node_info: - lan_ha_port_setting: - - ha_ip_address: 192.168.1.70 - mgmt_lan: 192.168.1.80 + - ha_ip_address: 192.168.1.70 + mgmt_lan: 192.168.1.80 - lan_ha_port_setting: - - ha_ip_address: 192.168.1.71 - mgmt_lan: 192.168.1.81 + - ha_ip_address: 192.168.1.71 + mgmt_lan: 192.168.1.81 comment: "Created by Ansible" state: present provider: @@ -473,13 +473,13 @@ name: member01.localdomain pre_provisioning: - hardware_info: - - hwmodel: IB-VM-820 - hwtype: IB-VNIOS + - hwmodel: IB-VM-820 + hwtype: IB-VNIOS licenses: - - dns - - dhcp - - enterprise - - vnios + - dns + - dhcp + - enterprise + - vnios comment: "Updated by Ansible" state: present provider: diff --git a/plugins/modules/nios_network.py b/plugins/modules/nios_network.py index ee3b9349..4ec26a85 100644 --- a/plugins/modules/nios_network.py +++ b/plugins/modules/nios_network.py @@ -47,6 +47,7 @@ of values (see suboptions). When configuring suboptions at least one of C(name) or C(num) must be specified. type: list + default: [] elements: dict suboptions: name: @@ -315,7 +316,6 @@ def check_ip_addr_type(obj_filter, ib_spec): if 'container' in obj_filter and obj_filter['container']: check_ip = ip.split('/') del ib_spec['container'] # removing the container key from post arguments - del ib_spec['options'] # removing option argument as for network container it's not supported if validate_ip_address(check_ip[0]): return NIOS_IPV4_NETWORK_CONTAINER, ib_spec elif validate_ip_v6_address(check_ip[0]): @@ -360,7 +360,7 @@ def main(): network=dict(required=True, aliases=['name', 'cidr'], ib_req=True), network_view=dict(default='default', ib_req=True), - options=dict(type='list', elements='dict', options=option_spec, transform=options), + options=dict(type='list', elements='dict', options=option_spec, transform=options, default=[]), template=dict(type='str'), extattrs=dict(type='dict'), diff --git a/plugins/modules/nios_nsgroup.py b/plugins/modules/nios_nsgroup.py index 91e5d6d4..eb141a4a 100644 --- a/plugins/modules/nios_nsgroup.py +++ b/plugins/modules/nios_nsgroup.py @@ -295,7 +295,7 @@ external_primaries: "{{ ext_nameservers }}" grid_secondaries: - name: infoblox-test.example.com - lead: True + lead: true preferred_primaries: "{{ ext_nameservers }}" state: present provider: diff --git a/plugins/modules/nios_range.py b/plugins/modules/nios_range.py index 0f1b5cf9..f2bc7515 100644 --- a/plugins/modules/nios_range.py +++ b/plugins/modules/nios_range.py @@ -44,6 +44,7 @@ of values (see suboptions). When configuring suboptions at least one of C(name) or C(num) must be specified. type: list + default: [] elements: dict suboptions: name: @@ -252,8 +253,8 @@ start_addr: 18.10.0.12 end_addr: 18.10.0.14 options: - - name: domain-name - value: zone1.com + - name: domain-name + value: zone1.com comment: Created with Ansible state: present provider: @@ -375,7 +376,7 @@ def main(): new_end_addr=dict(aliases=['new_end', 'new_last_addr', 'new_last'], type='str'), name=dict(type='str'), disable=dict(type='bool', default='false',), - options=dict(type='list', elements='dict', options=option_spec, transform=options), + options=dict(type='list', elements='dict', options=option_spec, transform=options, default=[]), member=dict(type='str'), failover_association=dict(type='str'), ms_server=dict(type='str'), diff --git a/plugins/modules/nios_txt_record.py b/plugins/modules/nios_txt_record.py index 7e46ed97..4ef9d27d 100644 --- a/plugins/modules/nios_txt_record.py +++ b/plugins/modules/nios_txt_record.py @@ -75,39 +75,39 @@ ''' EXAMPLES = ''' - - name: Ensure a text Record Exists - infoblox.nios_modules.nios_txt_record: - name: fqdn.txt.record.com - text: mytext - state: present - view: External - provider: - host: "{{ inventory_hostname_short }}" - username: admin - password: admin - - - name: Update name of TXT record - infoblox.nios_modules.nios_txt_record: - name: {old_name: sample.txtrecord.com, new_name: newsample.txtrecord.com} - text: mytext - state: present - view: External - provider: - host: "{{ inventory_hostname_short }}" - username: admin - password: admin - connection: local - - - name: Ensure a text Record does not exist - infoblox.nios_modules.nios_txt_record: - name: fqdn.txt.record.com - text: mytext - state: absent - view: External - provider: - host: "{{ inventory_hostname_short }}" - username: admin - password: admin +- name: Ensure a text Record Exists + infoblox.nios_modules.nios_txt_record: + name: fqdn.txt.record.com + text: mytext + state: present + view: External + provider: + host: "{{ inventory_hostname_short }}" + username: admin + password: admin + +- name: Update name of TXT record + infoblox.nios_modules.nios_txt_record: + name: {old_name: sample.txtrecord.com, new_name: newsample.txtrecord.com} + text: mytext + state: present + view: External + provider: + host: "{{ inventory_hostname_short }}" + username: admin + password: admin + connection: local + +- name: Ensure a text Record does not exist + infoblox.nios_modules.nios_txt_record: + name: fqdn.txt.record.com + text: mytext + state: absent + view: External + provider: + host: "{{ inventory_hostname_short }}" + username: admin + password: admin ''' RETURN = ''' # ''' diff --git a/tests/integration/targets/nios_a_record/meta/main.yaml b/tests/integration/targets/nios_a_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_a_record/meta/main.yaml +++ b/tests/integration/targets/nios_a_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_a_record/tasks/main.yml b/tests/integration/targets/nios_a_record/tasks/main.yml index 0955a39f..36c13b70 100644 --- a/tests/integration/targets/nios_a_record/tasks/main.yml +++ b/tests/integration/targets/nios_a_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_a_record_idempotence.yml +--- +- name: Include A record idempotence tests + ansible.builtin.include_tasks: nios_a_record_idempotence.yml diff --git a/tests/integration/targets/nios_a_record/tasks/nios_a_record_idempotence.yml b/tests/integration/targets/nios_a_record/tasks/nios_a_record_idempotence.yml index 0bbf106c..a6134b4e 100644 --- a/tests/integration/targets/nios_a_record/tasks/nios_a_record_idempotence.yml +++ b/tests/integration/targets/nios_a_record/tasks/nios_a_record_idempotence.yml @@ -1,40 +1,41 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup a_record - nios_a_record: +- name: Cleanup a_record + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 state: absent provider: "{{ nios_provider }}" -- name: create an a_record - nios_a_record: +- name: Create an a_record + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 state: present provider: "{{ nios_provider }}" register: a_record_create1 -- name: recreate an a_record - nios_a_record: +- name: Recreate an a_record + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 state: present provider: "{{ nios_provider }}" register: a_record_create2 -- name: add a comment to an existing a_record - nios_a_record: +- name: Add a comment to an existing a_record + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 comment: this is a test comment @@ -42,8 +43,8 @@ provider: "{{ nios_provider }}" register: a_record_update1 -- name: add a comment to an existing a_record - nios_a_record: +- name: Add a comment to an existing a_record + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 comment: this is a test comment @@ -51,27 +52,28 @@ provider: "{{ nios_provider }}" register: a_record_update2 -- name: remove a a_record from the system - nios_a_record: +- name: Remove a a_record from the system + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 state: absent provider: "{{ nios_provider }}" register: a_record_delete1 -- name: remove a a_record from the system - nios_a_record: +- name: Remove a a_record from the system + infoblox.nios_modules.nios_a_record: name: a.ansible.com ipv4: 192.168.10.1 state: absent provider: "{{ nios_provider }}" register: a_record_delete2 -- assert: +- name: Verify idempotence and changes of A record operations + ansible.builtin.assert: that: - - "a_record_create1.changed" - - "not a_record_create2.changed" - - "a_record_update1.changed" - - "not a_record_update2.changed" - - "a_record_delete1.changed" - - "not a_record_delete2.changed" + - a_record_create1.changed + - not a_record_create2.changed + - a_record_update1.changed + - not a_record_update2.changed + - a_record_delete1.changed + - not a_record_delete2.changed diff --git a/tests/integration/targets/nios_aaaa_record/meta/main.yaml b/tests/integration/targets/nios_aaaa_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_aaaa_record/meta/main.yaml +++ b/tests/integration/targets/nios_aaaa_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_aaaa_record/tasks/main.yml b/tests/integration/targets/nios_aaaa_record/tasks/main.yml index 9096b63d..6637c0de 100644 --- a/tests/integration/targets/nios_aaaa_record/tasks/main.yml +++ b/tests/integration/targets/nios_aaaa_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_aaaa_record_idempotence.yml +--- +- name: Include AAAA record idempotence tests + ansible.builtin.include_tasks: nios_aaaa_record_idempotence.yml diff --git a/tests/integration/targets/nios_aaaa_record/tasks/nios_aaaa_record_idempotence.yml b/tests/integration/targets/nios_aaaa_record/tasks/nios_aaaa_record_idempotence.yml index 2df01d34..bf4d0866 100644 --- a/tests/integration/targets/nios_aaaa_record/tasks/nios_aaaa_record_idempotence.yml +++ b/tests/integration/targets/nios_aaaa_record/tasks/nios_aaaa_record_idempotence.yml @@ -1,40 +1,41 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup aaaa record - nios_aaaa_record: +- name: Cleanup aaaa record + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 state: absent provider: "{{ nios_provider }}" -- name: create an aaaa record - nios_aaaa_record: +- name: Create an aaaa record + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 state: present provider: "{{ nios_provider }}" register: aaaa_record_create1 -- name: recreate an aaaa record - nios_aaaa_record: +- name: Recreate an aaaa record + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 state: present provider: "{{ nios_provider }}" register: aaaa_record_create2 -- name: add a comment to an existing aaaa record - nios_aaaa_record: +- name: Add a comment to an existing aaaa record + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 comment: this is a test comment @@ -42,8 +43,8 @@ provider: "{{ nios_provider }}" register: aaaa_record_update1 -- name: add a comment to an existing aaaa record - nios_aaaa_record: +- name: Add a comment to an existing aaaa record + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 comment: this is a test comment @@ -51,27 +52,28 @@ provider: "{{ nios_provider }}" register: aaaa_record_update2 -- name: remove a aaaa record from the system - nios_aaaa_record: +- name: Remove a aaaa record from the system + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 state: absent provider: "{{ nios_provider }}" register: aaaa_record_delete1 -- name: remove a aaaa record from the system - nios_aaaa_record: +- name: Remove a aaaa record from the system + infoblox.nios_modules.nios_aaaa_record: name: aaaa.ansible.com ipv6: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 state: absent provider: "{{ nios_provider }}" register: aaaa_record_delete2 -- assert: +- name: Verify idempotence and changes of AAAA record operations + ansible.builtin.assert: that: - - "aaaa_record_create1.changed" - - "not aaaa_record_create2.changed" - - "aaaa_record_update1.changed" - - "not aaaa_record_update2.changed" - - "aaaa_record_delete1.changed" - - "not aaaa_record_delete2.changed" + - aaaa_record_create1.changed + - not aaaa_record_create2.changed + - aaaa_record_update1.changed + - not aaaa_record_update2.changed + - aaaa_record_delete1.changed + - not aaaa_record_delete2.changed diff --git a/tests/integration/targets/nios_cname_record/meta/main.yaml b/tests/integration/targets/nios_cname_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_cname_record/meta/main.yaml +++ b/tests/integration/targets/nios_cname_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_cname_record/tasks/main.yml b/tests/integration/targets/nios_cname_record/tasks/main.yml index df8ff758..0eb34124 100644 --- a/tests/integration/targets/nios_cname_record/tasks/main.yml +++ b/tests/integration/targets/nios_cname_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_cname_record_idempotence.yml +--- +- name: Include CNAME record idempotence tests + ansible.builtin.include_tasks: nios_cname_record_idempotence.yml diff --git a/tests/integration/targets/nios_cname_record/tasks/nios_cname_record_idempotence.yml b/tests/integration/targets/nios_cname_record/tasks/nios_cname_record_idempotence.yml index f450c716..de0c687c 100644 --- a/tests/integration/targets/nios_cname_record/tasks/nios_cname_record_idempotence.yml +++ b/tests/integration/targets/nios_cname_record/tasks/nios_cname_record_idempotence.yml @@ -1,40 +1,41 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup cname record - nios_cname_record: +- name: Cleanup cname record + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com state: absent provider: "{{ nios_provider }}" -- name: create an cname record - nios_cname_record: +- name: Create an cname record + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com state: present provider: "{{ nios_provider }}" register: cname_record_create1 -- name: recreate an cname record - nios_cname_record: +- name: Recreate an cname record + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com state: present provider: "{{ nios_provider }}" register: cname_record_create2 -- name: add a comment to an existing cname record - nios_cname_record: +- name: Add a comment to an existing cname record + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com comment: this is a test comment @@ -42,8 +43,8 @@ provider: "{{ nios_provider }}" register: cname_record_update1 -- name: add a comment to an existing cname record - nios_cname_record: +- name: Add a comment to an existing cname record + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com comment: this is a test comment @@ -51,27 +52,28 @@ provider: "{{ nios_provider }}" register: cname_record_update2 -- name: remove a cname record from the system - nios_cname_record: +- name: Remove a cname record from the system + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com state: absent provider: "{{ nios_provider }}" register: cname_record_delete1 -- name: remove a cname record from the system - nios_cname_record: +- name: Remove a cname record from the system + infoblox.nios_modules.nios_cname_record: name: cname.ansible.com canonical: realhost.ansible.com state: absent provider: "{{ nios_provider }}" register: cname_record_delete2 -- assert: +- name: Verify idempotence and changes of CNAME record operations + ansible.builtin.assert: that: - - "cname_record_create1.changed" - - "not cname_record_create2.changed" - - "cname_record_update1.changed" - - "not cname_record_update2.changed" - - "cname_record_delete1.changed" - - "not cname_record_delete2.changed" + - cname_record_create1.changed + - not cname_record_create2.changed + - cname_record_update1.changed + - not cname_record_update2.changed + - cname_record_delete1.changed + - not cname_record_delete2.changed diff --git a/tests/integration/targets/nios_dns_view/defaults/main.yaml b/tests/integration/targets/nios_dns_view/defaults/main.yaml index ebf6ffc9..9ef5ba51 100644 --- a/tests/integration/targets/nios_dns_view/defaults/main.yaml +++ b/tests/integration/targets/nios_dns_view/defaults/main.yaml @@ -1,3 +1,3 @@ --- testcase: "*" -test_items: [] \ No newline at end of file +test_items: [] diff --git a/tests/integration/targets/nios_dns_view/meta/main.yaml b/tests/integration/targets/nios_dns_view/meta/main.yaml index 9472935b..a4ad32ff 100644 --- a/tests/integration/targets/nios_dns_view/meta/main.yaml +++ b/tests/integration/targets/nios_dns_view/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_nios_tests \ No newline at end of file + - prepare_nios_tests diff --git a/tests/integration/targets/nios_dns_view/tasks/main.yml b/tests/integration/targets/nios_dns_view/tasks/main.yml index 2b9ca3a0..50a5ce43 100644 --- a/tests/integration/targets/nios_dns_view/tasks/main.yml +++ b/tests/integration/targets/nios_dns_view/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_dns_view_idempotence.yml +--- +- name: Include the tasks for the nios_dns_view_idempotence + ansible.builtin.include_tasks: nios_dns_view_idempotence.yml diff --git a/tests/integration/targets/nios_dns_view/tasks/nios_dns_view_idempotence.yml b/tests/integration/targets/nios_dns_view/tasks/nios_dns_view_idempotence.yml index b9dc9fec..c05f51af 100644 --- a/tests/integration/targets/nios_dns_view/tasks/nios_dns_view_idempotence.yml +++ b/tests/integration/targets/nios_dns_view/tasks/nios_dns_view_idempotence.yml @@ -1,58 +1,60 @@ -- name: delete dns view instance - nios_dns_view: +--- +- name: Delete dns view instance + infoblox.nios_modules.nios_dns_view: name: ansible-dns state: absent provider: "{{ nios_provider }}" -- name: configure a new dns view instance - nios_dns_view: +- name: Configure a new dns view instance + infoblox.nios_modules.nios_dns_view: name: ansible-dns state: present provider: "{{ nios_provider }}" register: nios_dns_create1 -- name: configure a new dns view instance - nios_dns_view: +- name: Configure a new dns view instance + infoblox.nios_modules.nios_dns_view: name: ansible-dns state: present provider: "{{ nios_provider }}" register: nios_dns_create2 -- name: update the comment for dns view - nios_dns_view: +- name: Update the comment for dns view + infoblox.nios_modules.nios_dns_view: name: ansible-dns comment: this is an example comment state: present provider: "{{ nios_provider }}" register: nios_dns_update1 -- name: update the comment for dns view - nios_dns_view: +- name: Update the comment for dns view + infoblox.nios_modules.nios_dns_view: name: ansible-dns comment: this is an example comment state: present provider: "{{ nios_provider }}" register: nios_dns_update2 -- name: delete dns view instance - nios_dns_view: +- name: Delete dns view instance + infoblox.nios_modules.nios_dns_view: name: ansible-dns state: absent provider: "{{ nios_provider }}" register: nios_dns_delete1 -- name: delete dns view instance - nios_dns_view: +- name: Delete dns view instance + infoblox.nios_modules.nios_dns_view: name: ansible-dns state: absent provider: "{{ nios_provider }}" register: nios_dns_delete2 -- assert: +- name: Verify idempotence and changes of DNS view operations + ansible.builtin.assert: that: - - "nios_dns_create1.changed" - - "not nios_dns_create2.changed" - - "nios_dns_update1.changed" - - "not nios_dns_update2.changed" - - "nios_dns_delete1.changed" - - "not nios_dns_delete2.changed" + - nios_dns_create1.changed + - not nios_dns_create2.changed + - nios_dns_update1.changed + - not nios_dns_update2.changed + - nios_dns_delete1.changed + - not nios_dns_delete2.changed diff --git a/tests/integration/targets/nios_dtc_monitor_http/meta/main.yaml b/tests/integration/targets/nios_dtc_monitor_http/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_monitor_http/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_http/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_monitor_http/tasks/main.yaml b/tests/integration/targets/nios_dtc_monitor_http/tasks/main.yaml index f774bfbf..05d8bb79 100644 --- a/tests/integration/targets/nios_dtc_monitor_http/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_http/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_monitor_http_idempotence.yaml +--- +- name: Include the test for the nios_dtc_monitor_http_idempotence + ansible.builtin.include_tasks: nios_dtc_monitor_http_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_monitor_http/tasks/nios_dtc_monitor_http_idempotence.yaml b/tests/integration/targets/nios_dtc_monitor_http/tasks/nios_dtc_monitor_http_idempotence.yaml index 8b3a4f40..50172f5f 100644 --- a/tests/integration/targets/nios_dtc_monitor_http/tasks/nios_dtc_monitor_http_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_monitor_http/tasks/nios_dtc_monitor_http_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -67,9 +68,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_monitor_http_create1.changed" - - "not dtc_monitor_http_create2.changed" - - "dtc_monitor_http_update1.changed" - - "not dtc_monitor_http_update2.changed" - - "dtc_monitor_http_delete1.changed" - - "not dtc_monitor_http_delete2.changed" + - dtc_monitor_http_create1.changed + - not dtc_monitor_http_create2.changed + - dtc_monitor_http_update1.changed + - not dtc_monitor_http_update2.changed + - dtc_monitor_http_delete1.changed + - not dtc_monitor_http_delete2.changed diff --git a/tests/integration/targets/nios_dtc_monitor_icmp/meta/main.yaml b/tests/integration/targets/nios_dtc_monitor_icmp/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_monitor_icmp/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_icmp/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_monitor_icmp/tasks/main.yaml b/tests/integration/targets/nios_dtc_monitor_icmp/tasks/main.yaml index 28bf85bd..d0da4f93 100644 --- a/tests/integration/targets/nios_dtc_monitor_icmp/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_icmp/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_monitor_icmp_idempotence.yaml +--- +- name: Include the tasks for the nios_dtc_monitor_icmp_idempotence + ansible.builtin.include_tasks: nios_dtc_monitor_icmp_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_monitor_icmp/tasks/nios_dtc_monitor_icmp_idempotence.yaml b/tests/integration/targets/nios_dtc_monitor_icmp/tasks/nios_dtc_monitor_icmp_idempotence.yaml index 984aa59a..d8df170b 100644 --- a/tests/integration/targets/nios_dtc_monitor_icmp/tasks/nios_dtc_monitor_icmp_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_monitor_icmp/tasks/nios_dtc_monitor_icmp_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -63,9 +64,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_monitor_icmp_create1.changed" - - "not dtc_monitor_icmp_create2.changed" - - "dtc_monitor_icmp_update1.changed" - - "not dtc_monitor_icmp_update2.changed" - - "dtc_monitor_icmp_delete1.changed" - - "not dtc_monitor_icmp_delete2.changed" + - dtc_monitor_icmp_create1.changed + - not dtc_monitor_icmp_create2.changed + - dtc_monitor_icmp_update1.changed + - not dtc_monitor_icmp_update2.changed + - dtc_monitor_icmp_delete1.changed + - not dtc_monitor_icmp_delete2.changed diff --git a/tests/integration/targets/nios_dtc_monitor_pdp/meta/main.yaml b/tests/integration/targets/nios_dtc_monitor_pdp/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_monitor_pdp/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_pdp/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_monitor_pdp/tasks/main.yaml b/tests/integration/targets/nios_dtc_monitor_pdp/tasks/main.yaml index 55829c8d..65b2d789 100644 --- a/tests/integration/targets/nios_dtc_monitor_pdp/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_pdp/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_monitor_pdp_idempotence.yaml +--- +- name: Include the tasks from the idempotence test + ansible.builtin.include_tasks: nios_dtc_monitor_pdp_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_monitor_pdp/tasks/nios_dtc_monitor_pdp_idempotence.yaml b/tests/integration/targets/nios_dtc_monitor_pdp/tasks/nios_dtc_monitor_pdp_idempotence.yaml index 022f12d7..ab64163d 100644 --- a/tests/integration/targets/nios_dtc_monitor_pdp/tasks/nios_dtc_monitor_pdp_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_monitor_pdp/tasks/nios_dtc_monitor_pdp_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -63,9 +64,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_monitor_pdp_create1.changed" - - "not dtc_monitor_pdp_create2.changed" - - "dtc_monitor_pdp_update1.changed" - - "not dtc_monitor_pdp_update2.changed" - - "dtc_monitor_pdp_delete1.changed" - - "not dtc_monitor_pdp_delete2.changed" + - dtc_monitor_pdp_create1.changed + - not dtc_monitor_pdp_create2.changed + - dtc_monitor_pdp_update1.changed + - not dtc_monitor_pdp_update2.changed + - dtc_monitor_pdp_delete1.changed + - not dtc_monitor_pdp_delete2.changed diff --git a/tests/integration/targets/nios_dtc_monitor_sip/meta/main.yaml b/tests/integration/targets/nios_dtc_monitor_sip/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_monitor_sip/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_sip/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_monitor_sip/tasks/main.yaml b/tests/integration/targets/nios_dtc_monitor_sip/tasks/main.yaml index e5e1b33f..af5c50a1 100644 --- a/tests/integration/targets/nios_dtc_monitor_sip/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_sip/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_monitor_sip_idempotence.yaml +--- +- name: Include tasks from nios_dtc_monitor_sip_idempotence.yaml + ansible.builtin.include_tasks: nios_dtc_monitor_sip_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_monitor_sip/tasks/nios_dtc_monitor_sip_idempotence.yaml b/tests/integration/targets/nios_dtc_monitor_sip/tasks/nios_dtc_monitor_sip_idempotence.yaml index 68187a12..8b49b8a2 100644 --- a/tests/integration/targets/nios_dtc_monitor_sip/tasks/nios_dtc_monitor_sip_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_monitor_sip/tasks/nios_dtc_monitor_sip_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -63,9 +64,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_monitor_sip_create1.changed" - - "not dtc_monitor_sip_create2.changed" - - "dtc_monitor_sip_update1.changed" - - "not dtc_monitor_sip_update2.changed" - - "dtc_monitor_sip_delete1.changed" - - "not dtc_monitor_sip_delete2.changed" + - dtc_monitor_sip_create1.changed + - not dtc_monitor_sip_create2.changed + - dtc_monitor_sip_update1.changed + - not dtc_monitor_sip_update2.changed + - dtc_monitor_sip_delete1.changed + - not dtc_monitor_sip_delete2.changed diff --git a/tests/integration/targets/nios_dtc_monitor_snmp/meta/main.yaml b/tests/integration/targets/nios_dtc_monitor_snmp/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_monitor_snmp/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_snmp/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_monitor_snmp/tasks/main.yaml b/tests/integration/targets/nios_dtc_monitor_snmp/tasks/main.yaml index 02c852d3..d47b695f 100644 --- a/tests/integration/targets/nios_dtc_monitor_snmp/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_snmp/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_monitor_snmp_idempotence.yaml +--- +- name: Include the tasks from the nios_dtc_monitor_snmp_idempotence.yaml file + ansible.builtin.include_tasks: nios_dtc_monitor_snmp_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_monitor_snmp/tasks/nios_dtc_monitor_snmp_idempotence.yaml b/tests/integration/targets/nios_dtc_monitor_snmp/tasks/nios_dtc_monitor_snmp_idempotence.yaml index 12b56047..49a2fd22 100644 --- a/tests/integration/targets/nios_dtc_monitor_snmp/tasks/nios_dtc_monitor_snmp_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_monitor_snmp/tasks/nios_dtc_monitor_snmp_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -63,9 +64,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_monitor_snmp_create1.changed" - - "not dtc_monitor_snmp_create2.changed" - - "dtc_monitor_snmp_update1.changed" - - "not dtc_monitor_snmp_update2.changed" - - "dtc_monitor_snmp_delete1.changed" - - "not dtc_monitor_snmp_delete2.changed" + - dtc_monitor_snmp_create1.changed + - not dtc_monitor_snmp_create2.changed + - dtc_monitor_snmp_update1.changed + - not dtc_monitor_snmp_update2.changed + - dtc_monitor_snmp_delete1.changed + - not dtc_monitor_snmp_delete2.changed diff --git a/tests/integration/targets/nios_dtc_monitor_tcp/meta/main.yaml b/tests/integration/targets/nios_dtc_monitor_tcp/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_monitor_tcp/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_tcp/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_monitor_tcp/tasks/main.yaml b/tests/integration/targets/nios_dtc_monitor_tcp/tasks/main.yaml index e24c8265..aef2a532 100644 --- a/tests/integration/targets/nios_dtc_monitor_tcp/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_monitor_tcp/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_monitor_tcp_idempotence.yaml +--- +- name: Include the test for the nios_dtc_monitor_tcp_idempotence + ansible.builtin.include_tasks: nios_dtc_monitor_tcp_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_monitor_tcp/tasks/nios_dtc_monitor_tcp_idempotence.yaml b/tests/integration/targets/nios_dtc_monitor_tcp/tasks/nios_dtc_monitor_tcp_idempotence.yaml index 1c025b93..403aad2f 100644 --- a/tests/integration/targets/nios_dtc_monitor_tcp/tasks/nios_dtc_monitor_tcp_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_monitor_tcp/tasks/nios_dtc_monitor_tcp_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -70,9 +71,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_monitor_tcp_create1.changed" - - "not dtc_monitor_tcp_create2.changed" - - "dtc_monitor_tcp_update1.changed" - - "not dtc_monitor_tcp_update2.changed" - - "dtc_monitor_tcp_delete1.changed" - - "not dtc_monitor_tcp_delete2.changed" + - dtc_monitor_tcp_create1.changed + - not dtc_monitor_tcp_create2.changed + - dtc_monitor_tcp_update1.changed + - not dtc_monitor_tcp_update2.changed + - dtc_monitor_tcp_delete1.changed + - not dtc_monitor_tcp_delete2.changed diff --git a/tests/integration/targets/nios_dtc_topology/meta/main.yaml b/tests/integration/targets/nios_dtc_topology/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_dtc_topology/meta/main.yaml +++ b/tests/integration/targets/nios_dtc_topology/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_dtc_topology/tasks/main.yaml b/tests/integration/targets/nios_dtc_topology/tasks/main.yaml index 8873ef55..11c12594 100644 --- a/tests/integration/targets/nios_dtc_topology/tasks/main.yaml +++ b/tests/integration/targets/nios_dtc_topology/tasks/main.yaml @@ -1 +1,3 @@ -- include_tasks: nios_dtc_topology_idempotence.yaml +--- +- name: Include DTC topology idempotence tests + ansible.builtin.include_tasks: nios_dtc_topology_idempotence.yaml diff --git a/tests/integration/targets/nios_dtc_topology/tasks/nios_dtc_topology_idempotence.yaml b/tests/integration/targets/nios_dtc_topology/tasks/nios_dtc_topology_idempotence.yaml index a24a9c31..20dee06a 100644 --- a/tests/integration/targets/nios_dtc_topology/tasks/nios_dtc_topology_idempotence.yaml +++ b/tests/integration/targets/nios_dtc_topology/tasks/nios_dtc_topology_idempotence.yaml @@ -1,3 +1,4 @@ +--- - name: Clean up the parent object infoblox.nios_modules.nios_zone: name: ansible.com @@ -114,9 +115,9 @@ - name: Verify outcomes ansible.builtin.assert: that: - - "dtc_topology_create1.changed" - - "not dtc_topology_create2.changed" - - "dtc_topology_update1.changed" - - "not dtc_topology_update2.changed" - - "dtc_topology_delete1.changed" - - "not dtc_topology_delete2.changed" + - dtc_topology_create1.changed + - not dtc_topology_create2.changed + - dtc_topology_update1.changed + - not dtc_topology_update2.changed + - dtc_topology_delete1.changed + - not dtc_topology_delete2.changed diff --git a/tests/integration/targets/nios_extensible_attribute/aliases b/tests/integration/targets/nios_extensible_attribute/aliases new file mode 100644 index 00000000..b3138dc7 --- /dev/null +++ b/tests/integration/targets/nios_extensible_attribute/aliases @@ -0,0 +1,3 @@ +shippable/cloud/group1 +cloud/nios +destructive diff --git a/tests/integration/targets/nios_extensible_attribute/defaults/main.yaml b/tests/integration/targets/nios_extensible_attribute/defaults/main.yaml new file mode 100644 index 00000000..9ef5ba51 --- /dev/null +++ b/tests/integration/targets/nios_extensible_attribute/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +testcase: "*" +test_items: [] diff --git a/tests/integration/targets/nios_extensible_attribute/meta/main.yaml b/tests/integration/targets/nios_extensible_attribute/meta/main.yaml new file mode 100644 index 00000000..1b01a972 --- /dev/null +++ b/tests/integration/targets/nios_extensible_attribute/meta/main.yaml @@ -0,0 +1,2 @@ +dependencies: + - prepare_nios_tests diff --git a/tests/integration/targets/nios_extensible_attribute/tasks/main.yaml b/tests/integration/targets/nios_extensible_attribute/tasks/main.yaml new file mode 100644 index 00000000..e1442d4f --- /dev/null +++ b/tests/integration/targets/nios_extensible_attribute/tasks/main.yaml @@ -0,0 +1 @@ +- include_tasks: nios_extensible_attribute.yaml diff --git a/tests/integration/targets/nios_extensible_attribute/tasks/nios_extensible_attribute.yaml b/tests/integration/targets/nios_extensible_attribute/tasks/nios_extensible_attribute.yaml new file mode 100644 index 00000000..b5b54470 --- /dev/null +++ b/tests/integration/targets/nios_extensible_attribute/tasks/nios_extensible_attribute.yaml @@ -0,0 +1,147 @@ +- name: Clean up existing EA + infoblox.nios_modules.nios_extensible_attribute: + name: stringEA + type: STRING + state: absent + provider: "{{ nios_provider }}" + +- name: Create STRING EA + infoblox.nios_modules.nios_extensible_attribute: + name: stringEA + type: STRING + default_value: "string" + min: 1 + max: 15 + comment: Created string EA with Ansible + state: present + provider: "{{ nios_provider }}" + register: create_string_ea + +- name: Update STRING EA Comment + infoblox.nios_modules.nios_extensible_attribute: + name: stringEA + type: STRING + default_value: "string" + min: 1 + max: 15 + comment: Updated string EA with Ansible + state: present + provider: "{{ nios_provider }}" + register: update_string_ea + +- name: Create Integer EA + infoblox.nios_modules.nios_extensible_attribute: + name: IntegerEA + type: INTEGER + default_value: "15" + min: 1 + max: 15 + flags: 'I' + comment: Created string EA with Ansible + state: present + provider: "{{ nios_provider }}" + register: create_integer_ea + +- name: Update Integer EA value + infoblox.nios_modules.nios_extensible_attribute: + name: IntegerEA + type: INTEGER + default_value: "14" + min: 1 + max: 15 + flags: 'I' + comment: Created string EA with Ansible + state: present + provider: "{{ nios_provider }}" + register: update_integer_ea + +- name: Remove STRING EA Comment + infoblox.nios_modules.nios_extensible_attribute: + name: stringEA + type: STRING + default_value: "string" + min: 1 + max: 15 + state: present + provider: "{{ nios_provider }}" + register: remove_string_ea + +- name: Remove Integer EA definition + infoblox.nios_modules.nios_extensible_attribute: + name: IntegerEA + type: INTEGER + default_value: "14" + min: 1 + max: 15 + flags: 'I' + comment: Created string EA with Ansible + state: absent + provider: "{{ nios_provider }}" + register: remove_integer_ea + +- name: Create ENUM EA + infoblox.nios_modules.nios_extensible_attribute: + name: enumEA + type: ENUM + list_values: + - option1 + - option2 + default_value: "option1" + comment: Created enum EA with Ansible + state: present + provider: "{{ nios_provider }}" + register: create_enum_ea + +- name: Update ENUM EA default value + infoblox.nios_modules.nios_extensible_attribute: + name: enumEA + type: ENUM + list_values: + - option1 + - option2 + default_value: "option2" + comment: Updated enum EA default value with Ansible + state: present + provider: "{{ nios_provider }}" + register: update_enum_ea + +- name: Create DATE EA + infoblox.nios_modules.nios_extensible_attribute: + name: dateEA + type: DATE + default_value: "2023-01-01" + comment: Created date EA with Ansible + state: present + provider: "{{ nios_provider }}" + register: create_date_ea + +- name: Update DATE EA default value + infoblox.nios_modules.nios_extensible_attribute: + name: dateEA + type: DATE + default_value: "2023-12-31" + comment: Updated date EA default value with Ansible + state: present + provider: "{{ nios_provider }}" + register: update_date_ea + +- name: Check if the EA already exists + infoblox.nios_modules.nios_extensible_attribute: + name: existEA + state: present + provider: "{{ nios_provider }}" + register: ea_exists + +- name: Verify outcomes including new tests + ansible.builtin.assert: + that: + - "create_string_ea.changed" + - "update_string_ea.changed" + - "create_integer_ea.changed" + - "update_integer_ea.changed" + - "remove_string_ea.changed" + - "remove_integer_ea.changed" + - "create_enum_ea.changed" + - "update_enum_ea.changed" + - "create_date_ea.changed" + - "update_date_ea.changed" diff --git a/tests/integration/targets/nios_host_record/defaults/main.yaml b/tests/integration/targets/nios_host_record/defaults/main.yaml index ebf6ffc9..9ef5ba51 100644 --- a/tests/integration/targets/nios_host_record/defaults/main.yaml +++ b/tests/integration/targets/nios_host_record/defaults/main.yaml @@ -1,3 +1,3 @@ --- testcase: "*" -test_items: [] \ No newline at end of file +test_items: [] diff --git a/tests/integration/targets/nios_host_record/meta/main.yaml b/tests/integration/targets/nios_host_record/meta/main.yaml index 9472935b..a4ad32ff 100644 --- a/tests/integration/targets/nios_host_record/meta/main.yaml +++ b/tests/integration/targets/nios_host_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_nios_tests \ No newline at end of file + - prepare_nios_tests diff --git a/tests/integration/targets/nios_host_record/tasks/main.yml b/tests/integration/targets/nios_host_record/tasks/main.yml index 3c626f55..bd80def0 100644 --- a/tests/integration/targets/nios_host_record/tasks/main.yml +++ b/tests/integration/targets/nios_host_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_host_record_idempotence.yml +--- +- name: Include host record idempotence tests + ansible.builtin.include_tasks: nios_host_record_idempotence.yml diff --git a/tests/integration/targets/nios_host_record/tasks/nios_host_record_idempotence.yml b/tests/integration/targets/nios_host_record/tasks/nios_host_record_idempotence.yml index 636431ee..c1ea7cf0 100644 --- a/tests/integration/targets/nios_host_record/tasks/nios_host_record_idempotence.yml +++ b/tests/integration/targets/nios_host_record/tasks/nios_host_record_idempotence.yml @@ -1,25 +1,26 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup ipv4 host record - nios_host_record: +- name: Cleanup ipv4 host record + infoblox.nios_modules.nios_host_record: name: host.ansible.com ipv4: - address: 192.168.10.1 state: absent provider: "{{ nios_provider }}" -- name: create an ipv4 host record - nios_host_record: +- name: Create an ipv4 host record + infoblox.nios_modules.nios_host_record: name: host.ansible.com ipv4: - address: 192.168.10.1 @@ -27,8 +28,8 @@ provider: "{{ nios_provider }}" register: ipv4_create1 -- name: recreate an ipv4 host record - nios_host_record: +- name: Recreate an ipv4 host record + infoblox.nios_modules.nios_host_record: name: host.ansible.com ipv4: - address: 192.168.10.1 @@ -36,8 +37,8 @@ provider: "{{ nios_provider }}" register: ipv4_create2 -- name: add a comment to an existing host record - nios_host_record: +- name: Add a comment to an existing host record + infoblox.nios_modules.nios_host_record: name: host.ansible.com ipv4: - address: 192.168.10.1 @@ -46,8 +47,8 @@ provider: "{{ nios_provider }}" register: ipv4_update1 -- name: add a comment to an existing host record - nios_host_record: +- name: Add a comment to an existing host record + infoblox.nios_modules.nios_host_record: name: host.ansible.com ipv4: - address: 192.168.10.1 @@ -56,22 +57,22 @@ provider: "{{ nios_provider }}" register: ipv4_update2 -- name: remove a host record from the system - nios_host_record: +- name: Remove a host record from the system + infoblox.nios_modules.nios_host_record: name: host.ansible.com state: absent provider: "{{ nios_provider }}" register: ipv4_delete1 -- name: remove a host record from the system - nios_host_record: +- name: Remove a host record from the system + infoblox.nios_modules.nios_host_record: name: host.ansible.com state: absent provider: "{{ nios_provider }}" register: ipv4_delete2 -- name: create an ipv4 host record bypassing DNS - nios_host_record: +- name: Create an ipv4 host record bypassing DNS + infoblox.nios_modules.nios_host_record: name: host ipv4: - address: 192.168.10.1 @@ -80,8 +81,8 @@ provider: "{{ nios_provider }}" register: ipv4_create3 -- name: recreate an ipv4 host record bypassing DNS - nios_host_record: +- name: Recreate an ipv4 host record bypassing DNS + infoblox.nios_modules.nios_host_record: name: host ipv4: - address: 192.168.10.1 @@ -90,8 +91,8 @@ provider: "{{ nios_provider }}" register: ipv4_create4 -- name: create an ipv4 host record via DHCP and MAC - nios_host_record: +- name: Create an ipv4 host record via DHCP and MAC + infoblox.nios_modules.nios_host_record: name: host ipv4: - address: 192.168.10.1 @@ -101,8 +102,8 @@ provider: "{{ nios_provider }}" register: ipv4_create5 -- name: recreate an ipv4 host record via DHCP and MAC - nios_host_record: +- name: Recreate an ipv4 host record via DHCP and MAC + infoblox.nios_modules.nios_host_record: name: host ipv4: - address: 192.168.10.1 @@ -112,15 +113,16 @@ provider: "{{ nios_provider }}" register: ipv4_create6 -- assert: +- name: Verify idempotence and changes of IPv4 host record operations + ansible.builtin.assert: that: - - "ipv4_create1.changed" - - "not ipv4_create2.changed" - - "ipv4_update1.changed" - - "not ipv4_update2.changed" - - "ipv4_delete1.changed" - - "not ipv4_delete2.changed" - - "ipv4_create3.changed" - - "not ipv4_create4.changed" - - "ipv4_create5.changed" - - "not ipv4_create6.changed" + - ipv4_create1.changed + - not ipv4_create2.changed + - ipv4_update1.changed + - not ipv4_update2.changed + - ipv4_delete1.changed + - not ipv4_delete2.changed + - ipv4_create3.changed + - not ipv4_create4.changed + - ipv4_create5.changed + - not ipv4_create6.changed diff --git a/tests/integration/targets/nios_mx_record/meta/main.yaml b/tests/integration/targets/nios_mx_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_mx_record/meta/main.yaml +++ b/tests/integration/targets/nios_mx_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_mx_record/tasks/main.yml b/tests/integration/targets/nios_mx_record/tasks/main.yml index ebffb41a..a95ba59a 100644 --- a/tests/integration/targets/nios_mx_record/tasks/main.yml +++ b/tests/integration/targets/nios_mx_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_mx_record_idempotence.yml +--- +- name: Include MX record idempotence tests + ansible.builtin.include_tasks: nios_mx_record_idempotence.yml diff --git a/tests/integration/targets/nios_mx_record/tasks/nios_mx_record_idempotence.yml b/tests/integration/targets/nios_mx_record/tasks/nios_mx_record_idempotence.yml index 65b1e8f4..d6fd93ee 100644 --- a/tests/integration/targets/nios_mx_record/tasks/nios_mx_record_idempotence.yml +++ b/tests/integration/targets/nios_mx_record/tasks/nios_mx_record_idempotence.yml @@ -1,25 +1,26 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup mx record - nios_mx_record: +- name: Cleanup mx record + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 state: absent provider: "{{ nios_provider }}" -- name: create an mx record - nios_mx_record: +- name: Create an mx record + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 @@ -27,8 +28,8 @@ provider: "{{ nios_provider }}" register: mx_record_create1 -- name: recreate an mx record - nios_mx_record: +- name: Recreate an mx record + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 @@ -36,8 +37,8 @@ provider: "{{ nios_provider }}" register: mx_record_create2 -- name: add a comment to an existing mx record - nios_mx_record: +- name: Add a comment to an existing mx record + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 @@ -46,8 +47,8 @@ provider: "{{ nios_provider }}" register: mx_record_update1 -- name: add a comment to an existing mx record - nios_mx_record: +- name: Add a comment to an existing mx record + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 @@ -56,8 +57,8 @@ provider: "{{ nios_provider }}" register: mx_record_update2 -- name: remove a mx record from the system - nios_mx_record: +- name: Remove a mx record from the system + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 @@ -65,8 +66,8 @@ provider: "{{ nios_provider }}" register: mx_record_delete1 -- name: remove a mx record from the system - nios_mx_record: +- name: Remove a mx record from the system + infoblox.nios_modules.nios_mx_record: name: ansible.com mx: mailhost.ansible.com preference: 0 @@ -74,11 +75,12 @@ provider: "{{ nios_provider }}" register: mx_record_delete2 -- assert: +- name: Verify idempotence and changes of MX record operations + ansible.builtin.assert: that: - - "mx_record_create1.changed" - - "not mx_record_create2.changed" - - "mx_record_update1.changed" - - "not mx_record_update2.changed" - - "mx_record_delete1.changed" - - "not mx_record_delete2.changed" + - mx_record_create1.changed + - not mx_record_create2.changed + - mx_record_update1.changed + - not mx_record_update2.changed + - mx_record_delete1.changed + - not mx_record_delete2.changed diff --git a/tests/integration/targets/nios_naptr_record/meta/main.yaml b/tests/integration/targets/nios_naptr_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_naptr_record/meta/main.yaml +++ b/tests/integration/targets/nios_naptr_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_naptr_record/tasks/main.yml b/tests/integration/targets/nios_naptr_record/tasks/main.yml index ed94e8a3..ed567b40 100644 --- a/tests/integration/targets/nios_naptr_record/tasks/main.yml +++ b/tests/integration/targets/nios_naptr_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_naptr_record_idempotence.yml +--- +- name: Include NAPTR record idempotence tests + ansible.builtin.include_tasks: nios_naptr_record_idempotence.yml diff --git a/tests/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml b/tests/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml index 2303eff5..38aadfd0 100644 --- a/tests/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml +++ b/tests/integration/targets/nios_naptr_record/tasks/nios_naptr_record_idempotence.yml @@ -1,27 +1,28 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup naptr record - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Cleanup naptr record + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com state: absent provider: "{{ nios_provider }}" -- name: create an naptr record - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Create an naptr record + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com @@ -29,9 +30,9 @@ provider: "{{ nios_provider }}" register: naptr_record_create1 -- name: recreate an naptr record - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Recreate an naptr record + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com @@ -39,9 +40,9 @@ provider: "{{ nios_provider }}" register: naptr_record_create2 -- name: add a comment to an existing naptr record - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Add a comment to an existing naptr record + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com @@ -50,9 +51,9 @@ provider: "{{ nios_provider }}" register: naptr_record_update1 -- name: add a comment to an existing naptr record - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Add a comment to an existing naptr record + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com @@ -61,9 +62,9 @@ provider: "{{ nios_provider }}" register: naptr_record_update2 -- name: remove a naptr record from the system - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Remove a naptr record from the system + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com @@ -71,9 +72,9 @@ provider: "{{ nios_provider }}" register: naptr_record_delete1 -- name: remove a naptr record from the system - nios_naptr_record: - name: '*.subscriber-100.ansiblezone.com' +- name: Remove a naptr record from the system + infoblox.nios_modules.nios_naptr_record: + name: "*.subscriber-100.ansiblezone.com" order: 1000 preference: 10 replacement: replacement1.network.ansiblezone.com @@ -81,11 +82,12 @@ provider: "{{ nios_provider }}" register: naptr_record_delete2 -- assert: +- name: Verify idempotence and changes of NAPTR record operations + ansible.builtin.assert: that: - - "naptr_record_create1.changed" - - "not naptr_record_create2.changed" - - "naptr_record_update1.changed" - - "not naptr_record_update2.changed" - - "naptr_record_delete1.changed" - - "not naptr_record_delete2.changed" + - naptr_record_create1.changed + - not naptr_record_create2.changed + - naptr_record_update1.changed + - not naptr_record_update2.changed + - naptr_record_delete1.changed + - not naptr_record_delete2.changed diff --git a/tests/integration/targets/nios_network/meta/main.yaml b/tests/integration/targets/nios_network/meta/main.yaml index 9472935b..a4ad32ff 100644 --- a/tests/integration/targets/nios_network/meta/main.yaml +++ b/tests/integration/targets/nios_network/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_nios_tests \ No newline at end of file + - prepare_nios_tests diff --git a/tests/integration/targets/nios_network/tasks/main.yml b/tests/integration/targets/nios_network/tasks/main.yml index 040cb8a8..5d1d658c 100644 --- a/tests/integration/targets/nios_network/tasks/main.yml +++ b/tests/integration/targets/nios_network/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_network_idempotence.yml +--- +- name: Include network idempotence tests + ansible.builtin.include_tasks: nios_network_idempotence.yml diff --git a/tests/integration/targets/nios_network/tasks/nios_network_idempotence.yml b/tests/integration/targets/nios_network/tasks/nios_network_idempotence.yml index 95937d1a..04142d6a 100644 --- a/tests/integration/targets/nios_network/tasks/nios_network_idempotence.yml +++ b/tests/integration/targets/nios_network/tasks/nios_network_idempotence.yml @@ -1,33 +1,29 @@ -- name: cleanup a network ipv4 - nios_network: +--- +- name: Cleanup a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 comment: this is a test comment state: absent provider: "{{ nios_provider }}" -- name: configure a network ipv4 - nios_network: +- name: Configure a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 comment: this is a test comment state: present provider: "{{ nios_provider }}" register: nios_ipv4_create1 -- name: configure a network ipv4 - nios_network: +- name: Configure a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 comment: this is a test comment state: present provider: "{{ nios_provider }}" register: nios_ipv4_create2 -#- assert: -# that: -# - "nios_ipv4_create1.changed" -# - "not nios_ipv4_create2.changed" - -- name: set dhcp options for a network ipv4 - nios_network: +- name: Set dhcp options for a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 comment: this is a test comment options: @@ -37,8 +33,8 @@ provider: "{{ nios_provider }}" register: nios_ipv4_update1 -- name: set dhcp options for a network ipv4 - nios_network: +- name: Set dhcp options for a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 comment: this is a test comment options: @@ -48,31 +44,30 @@ provider: "{{ nios_provider }}" register: nios_ipv4_update2 -- name: remove a network ipv4 - nios_network: +- name: Remove a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 state: absent provider: "{{ nios_provider }}" register: nios_ipv4_remove1 -- name: remove a network ipv4 - nios_network: +- name: Remove a network ipv4 + infoblox.nios_modules.nios_network: network: 192.168.10.0/24 state: absent provider: "{{ nios_provider }}" register: nios_ipv4_remove2 -- name: configure a network ipv6 - nios_network: +- name: Configure a network ipv6 + infoblox.nios_modules.nios_network: network: fe80::/64 comment: this is a test comment state: present provider: "{{ nios_provider }}" register: nios_ipv6_create1 - -- name: configure a network ipv6 with filter option - nios_network: +- name: Configure a network ipv6 with filter option + infoblox.nios_modules.nios_network: network: fe80::/64 comment: this is a test comment use_logic_filter_rules: true @@ -80,8 +75,8 @@ provider: "{{ nios_provider }}" register: nios_ipv6_update1 -- name: configure a network ipv4 with filter option - nios_network: +- name: Configure a network ipv4 with filter option + infoblox.nios_modules.nios_network: network: 192.168.11.0/24 comment: this is a test comment use_logic_filter_rules: true @@ -89,8 +84,8 @@ provider: "{{ nios_provider }}" register: nios_ipv4_create3 -- name: update a network ipv4 with filter option - nios_network: +- name: Update a network ipv4 with filter option + infoblox.nios_modules.nios_network: network: 192.168.11.0/24 comment: this is a test comment use_logic_filter_rules: false @@ -99,7 +94,7 @@ register: nios_ipv4_update3 - name: Re-run with no changes - nios_network: + infoblox.nios_modules.nios_network: network: 192.168.11.0/24 comment: this is a test comment use_logic_filter_rules: false @@ -107,8 +102,8 @@ provider: "{{ nios_provider }}" register: nios_ipv4_update4 -- name: remove an ipv4 network - nios_network: +- name: Remove an ipv4 network + infoblox.nios_modules.nios_network: network: 192.168.11.0/24 comment: this is a test comment use_logic_filter_rules: false @@ -116,18 +111,18 @@ provider: "{{ nios_provider }}" register: nios_ipv4_remove3 - -- assert: +- name: Verify idempotence and changes of network operations + ansible.builtin.assert: that: - - "nios_ipv4_create1.changed" - - "not nios_ipv4_create2.changed" - - "nios_ipv4_update1.changed" - - "not nios_ipv4_update2.changed" - - "nios_ipv4_remove1.changed" - - "not nios_ipv4_remove2.changed" - - "nios_ipv4_create3.changed" - - "nios_ipv4_update3.changed" - - "nios_ipv6_create1.changed" - - "nios_ipv6_update1.changed" - - "not nios_ipv4_update4.changed" - - "nios_ipv4_remove3.changed" + - nios_ipv4_create1.changed + - not nios_ipv4_create2.changed + - nios_ipv4_update1.changed + - not nios_ipv4_update2.changed + - nios_ipv4_remove1.changed + - not nios_ipv4_remove2.changed + - nios_ipv4_create3.changed + - nios_ipv4_update3.changed + - nios_ipv6_create1.changed + - nios_ipv6_update1.changed + - not nios_ipv4_update4.changed + - nios_ipv4_remove3.changed diff --git a/tests/integration/targets/nios_network_view/defaults/main.yaml b/tests/integration/targets/nios_network_view/defaults/main.yaml index ebf6ffc9..9ef5ba51 100644 --- a/tests/integration/targets/nios_network_view/defaults/main.yaml +++ b/tests/integration/targets/nios_network_view/defaults/main.yaml @@ -1,3 +1,3 @@ --- testcase: "*" -test_items: [] \ No newline at end of file +test_items: [] diff --git a/tests/integration/targets/nios_network_view/meta/main.yaml b/tests/integration/targets/nios_network_view/meta/main.yaml index 9472935b..a4ad32ff 100644 --- a/tests/integration/targets/nios_network_view/meta/main.yaml +++ b/tests/integration/targets/nios_network_view/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_nios_tests \ No newline at end of file + - prepare_nios_tests diff --git a/tests/integration/targets/nios_network_view/tasks/main.yml b/tests/integration/targets/nios_network_view/tasks/main.yml index 0acf4a4c..f9b6f41a 100644 --- a/tests/integration/targets/nios_network_view/tasks/main.yml +++ b/tests/integration/targets/nios_network_view/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_network_view_idempotence.yml +--- +- name: Include network view idempotence tests + ansible.builtin.include_tasks: nios_network_view_idempotence.yml diff --git a/tests/integration/targets/nios_network_view/tasks/nios_network_view_idempotence.yml b/tests/integration/targets/nios_network_view/tasks/nios_network_view_idempotence.yml index ad13e3a3..408055ad 100644 --- a/tests/integration/targets/nios_network_view/tasks/nios_network_view_idempotence.yml +++ b/tests/integration/targets/nios_network_view/tasks/nios_network_view_idempotence.yml @@ -1,58 +1,60 @@ -- name: cleanup a new network view - nios_network_view: +--- +- name: Cleanup a new network view + infoblox.nios_modules.nios_network_view: name: ansible state: absent provider: "{{ nios_provider }}" -- name: configure a new network view - nios_network_view: +- name: Configure a new network view + infoblox.nios_modules.nios_network_view: name: ansible state: present provider: "{{ nios_provider }}" register: nios_network_view_create1 -- name: configure a new network view - nios_network_view: +- name: Configure a new network view + infoblox.nios_modules.nios_network_view: name: ansible state: present provider: "{{ nios_provider }}" register: nios_network_view_create2 -- name: update the comment for network view - nios_network_view: +- name: Update the comment for network view + infoblox.nios_modules.nios_network_view: name: ansible comment: this is an example comment state: present provider: "{{ nios_provider }}" register: nios_network_view_update1 -- name: update the comment for network view - nios_network_view: +- name: Update the comment for network view + infoblox.nios_modules.nios_network_view: name: ansible comment: this is an example comment state: present provider: "{{ nios_provider }}" register: nios_network_view_update2 -- name: remove the network view - nios_network_view: +- name: Remove the network view + infoblox.nios_modules.nios_network_view: name: ansible state: absent provider: "{{ nios_provider }}" register: nios_network_view_delete1 -- name: remove the network view - nios_network_view: +- name: Remove the network view + infoblox.nios_modules.nios_network_view: name: ansible state: absent provider: "{{ nios_provider }}" register: nios_network_view_delete2 -- assert: +- name: Verify idempotence and changes of network view operations + ansible.builtin.assert: that: - - "nios_network_view_create1.changed" - - "not nios_network_view_create2.changed" - - "nios_network_view_update1.changed" - - "not nios_network_view_update2.changed" - - "nios_network_view_delete1.changed" - - "not nios_network_view_delete2.changed" + - nios_network_view_create1.changed + - not nios_network_view_create2.changed + - nios_network_view_update1.changed + - not nios_network_view_update2.changed + - nios_network_view_delete1.changed + - not nios_network_view_delete2.changed diff --git a/tests/integration/targets/nios_ptr_record/meta/main.yaml b/tests/integration/targets/nios_ptr_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_ptr_record/meta/main.yaml +++ b/tests/integration/targets/nios_ptr_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_ptr_record/tasks/main.yml b/tests/integration/targets/nios_ptr_record/tasks/main.yml index 29fbb5fe..a3213fe6 100644 --- a/tests/integration/targets/nios_ptr_record/tasks/main.yml +++ b/tests/integration/targets/nios_ptr_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_ptr_record_idempotence.yml +--- +- name: Include PTR record idempotence tests + ansible.builtin.include_tasks: nios_ptr_record_idempotence.yml diff --git a/tests/integration/targets/nios_ptr_record/tasks/nios_ptr_record_idempotence.yml b/tests/integration/targets/nios_ptr_record/tasks/nios_ptr_record_idempotence.yml index a233d80f..b1520847 100644 --- a/tests/integration/targets/nios_ptr_record/tasks/nios_ptr_record_idempotence.yml +++ b/tests/integration/targets/nios_ptr_record/tasks/nios_ptr_record_idempotence.yml @@ -1,7 +1,6 @@ --- - -- name: create an ipv4 ptr record - nios_ptr_record: +- name: Create an ipv4 ptr record + infoblox.nios_modules.nios_ptr_record: name: ptr.ansible.com ptrdname: ptr.ansible.com ipv4: 192.168.10.1 @@ -10,8 +9,8 @@ view: default register: ipv4_ptr_create1 -- name: create the same ipv4 ptr record - nios_ptr_record: +- name: Create the same ipv4 ptr record + infoblox.nios_modules.nios_ptr_record: name: ptr.ansible.com ptrdname: ptr.ansible.com ipv4: 192.168.10.1 @@ -20,8 +19,8 @@ provider: "{{ nios_provider }}" register: ipv4_ptr_create2 -- name: add a comment to an existing ipv4 ptr record - nios_ptr_record: +- name: Add a comment to an existing ipv4 ptr record + infoblox.nios_modules.nios_ptr_record: name: ptr.ansible.com ptrdname: ptr.ansible.com ipv4: 192.168.10.1 @@ -31,8 +30,8 @@ provider: "{{ nios_provider }}" register: ipv4_ptr_update1 -- name: add the same comment to the same ipv4 ptr host record - nios_ptr_record: +- name: Add the same comment to the same ipv4 ptr host record + infoblox.nios_modules.nios_ptr_record: name: ptr.ansible.com ptrdname: ptr.ansible.com ipv4: 192.168.10.1 @@ -42,8 +41,8 @@ provider: "{{ nios_provider }}" register: ipv4_ptr_update2 -- name: remove a ptr record from the system - nios_ptr_record: +- name: Remove a ptr record from the system + infoblox.nios_modules.nios_ptr_record: name: ptr.ansible.com ptrdname: ptr.ansible.com ipv4: 192.168.10.1 @@ -52,8 +51,8 @@ provider: "{{ nios_provider }}" register: ipv4_ptr_delete1 -- name: remove the same ptr record from the system - nios_ptr_record: +- name: Remove the same ptr record from the system + infoblox.nios_modules.nios_ptr_record: ptrdname: ptr.ansible.com name: ptr.ansible.com ipv4: 192.168.10.1 @@ -62,22 +61,23 @@ provider: "{{ nios_provider }}" register: ipv4_ptr_delete2 -- name: create an ipv6 ptr record - nios_ptr_record: +- name: Create an ipv6 ptr record + infoblox.nios_modules.nios_ptr_record: ptrdname: ptr6.ansible.com name: ptr6.ansible.com - ipv6: "2002:8ac3:802d:1242:20d:60ff:fe38:6d16" + ipv6: 2002:8ac3:802d:1242:20d:60ff:fe38:6d16 view: default state: present provider: "{{ nios_provider }}" register: ipv6_ptr_create1 -- assert: +- name: Verify idempotence and changes of PTR record operations + ansible.builtin.assert: that: - - "ipv4_ptr_create1.changed" - - "not ipv4_ptr_create2.changed" - - "ipv4_ptr_update1.changed" - - "not ipv4_ptr_update2.changed" - - "ipv4_ptr_delete1.changed" - - "not ipv4_ptr_delete2.changed" - - "ipv6_ptr_create1.changed" + - ipv4_ptr_create1.changed + - not ipv4_ptr_create2.changed + - ipv4_ptr_update1.changed + - not ipv4_ptr_update2.changed + - ipv4_ptr_delete1.changed + - not ipv4_ptr_delete2.changed + - ipv6_ptr_create1.changed diff --git a/tests/integration/targets/nios_srv_record/meta/main.yaml b/tests/integration/targets/nios_srv_record/meta/main.yaml index 1b01a972..a4ad32ff 100644 --- a/tests/integration/targets/nios_srv_record/meta/main.yaml +++ b/tests/integration/targets/nios_srv_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_nios_tests diff --git a/tests/integration/targets/nios_srv_record/tasks/main.yml b/tests/integration/targets/nios_srv_record/tasks/main.yml index 4e4dd166..9c14dc3f 100644 --- a/tests/integration/targets/nios_srv_record/tasks/main.yml +++ b/tests/integration/targets/nios_srv_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_srv_record_idempotence.yml +--- +- name: Include SRV record idempotence tests + ansible.builtin.include_tasks: nios_srv_record_idempotence.yml diff --git a/tests/integration/targets/nios_srv_record/tasks/nios_srv_record_idempotence.yml b/tests/integration/targets/nios_srv_record/tasks/nios_srv_record_idempotence.yml index 8f3dbfc7..f6dbf56a 100644 --- a/tests/integration/targets/nios_srv_record/tasks/nios_srv_record_idempotence.yml +++ b/tests/integration/targets/nios_srv_record/tasks/nios_srv_record_idempotence.yml @@ -1,17 +1,18 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup srv record - nios_srv_record: +- name: Cleanup srv record + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -20,8 +21,8 @@ state: absent provider: "{{ nios_provider }}" -- name: create an srv record - nios_srv_record: +- name: Create an srv record + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -31,8 +32,8 @@ provider: "{{ nios_provider }}" register: srv_record_create1 -- name: recreate an srv record - nios_srv_record: +- name: Recreate an srv record + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -42,8 +43,8 @@ provider: "{{ nios_provider }}" register: srv_record_create2 -- name: add a comment to an existing srv record - nios_srv_record: +- name: Add a comment to an existing srv record + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -54,8 +55,8 @@ provider: "{{ nios_provider }}" register: srv_record_update1 -- name: add a comment to an existing srv record - nios_srv_record: +- name: Add a comment to an existing srv record + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -66,8 +67,8 @@ provider: "{{ nios_provider }}" register: srv_record_update2 -- name: remove a srv record from the system - nios_srv_record: +- name: Remove a srv record from the system + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -77,8 +78,8 @@ provider: "{{ nios_provider }}" register: srv_record_delete1 -- name: remove a srv record from the system - nios_srv_record: +- name: Remove a srv record from the system + infoblox.nios_modules.nios_srv_record: name: ansible.com port: 5080 priority: 10 @@ -88,11 +89,12 @@ provider: "{{ nios_provider }}" register: srv_record_delete2 -- assert: +- name: Verify idempotence and changes of SRV record operations + ansible.builtin.assert: that: - - "srv_record_create1.changed" - - "not srv_record_create2.changed" - - "srv_record_update1.changed" - - "not srv_record_update2.changed" - - "srv_record_delete1.changed" - - "not srv_record_delete2.changed" + - srv_record_create1.changed + - not srv_record_create2.changed + - srv_record_update1.changed + - not srv_record_update2.changed + - srv_record_delete1.changed + - not srv_record_delete2.changed diff --git a/tests/integration/targets/nios_txt_record/defaults/main.yaml b/tests/integration/targets/nios_txt_record/defaults/main.yaml index ebf6ffc9..9ef5ba51 100644 --- a/tests/integration/targets/nios_txt_record/defaults/main.yaml +++ b/tests/integration/targets/nios_txt_record/defaults/main.yaml @@ -1,3 +1,3 @@ --- testcase: "*" -test_items: [] \ No newline at end of file +test_items: [] diff --git a/tests/integration/targets/nios_txt_record/meta/main.yaml b/tests/integration/targets/nios_txt_record/meta/main.yaml index 9472935b..a4ad32ff 100644 --- a/tests/integration/targets/nios_txt_record/meta/main.yaml +++ b/tests/integration/targets/nios_txt_record/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_nios_tests \ No newline at end of file + - prepare_nios_tests diff --git a/tests/integration/targets/nios_txt_record/tasks/main.yml b/tests/integration/targets/nios_txt_record/tasks/main.yml index 0acbc091..81d01d8b 100644 --- a/tests/integration/targets/nios_txt_record/tasks/main.yml +++ b/tests/integration/targets/nios_txt_record/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_txt_record_idempotence.yml +--- +- name: Include TXT record idempotence tests + ansible.builtin.include_tasks: nios_txt_record_idempotence.yml diff --git a/tests/integration/targets/nios_txt_record/tasks/nios_txt_record_idempotence.yml b/tests/integration/targets/nios_txt_record/tasks/nios_txt_record_idempotence.yml index 37638d85..62ebc92a 100644 --- a/tests/integration/targets/nios_txt_record/tasks/nios_txt_record_idempotence.yml +++ b/tests/integration/targets/nios_txt_record/tasks/nios_txt_record_idempotence.yml @@ -1,45 +1,47 @@ -- name: cleanup the parent object - nios_zone: +--- +- name: Cleanup the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: absent provider: "{{ nios_provider }}" -- name: create the parent object - nios_zone: +- name: Create the parent object + infoblox.nios_modules.nios_zone: name: ansible.com state: present provider: "{{ nios_provider }}" -- name: cleanup txt record - nios_txt_record: +- name: Cleanup txt record + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com - text: mytext + text: mytext state: absent provider: "{{ nios_provider }}" -- name: create txt record - nios_txt_record: +- name: Create txt record + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com text: mytext state: present provider: "{{ nios_provider }}" register: txt_create1 -- name: create txt record - nios_txt_record: +- name: Create txt record + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com text: mytext state: present provider: "{{ nios_provider }}" register: txt_create2 -- assert: +- name: Assert TXT record creation idempotence + ansible.builtin.assert: that: - - "txt_create1.changed" - - "not txt_create2.changed" + - txt_create1.changed + - not txt_create2.changed -- name: add a comment to an existing txt record - nios_txt_record: +- name: Add a comment to an existing txt record + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com text: mytext state: present @@ -47,8 +49,8 @@ provider: "{{ nios_provider }}" register: txt_update1 -- name: add a comment to an existing txt record - nios_txt_record: +- name: Add a comment to an existing txt record + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com text: mytext state: present @@ -56,27 +58,28 @@ provider: "{{ nios_provider }}" register: txt_update2 -- name: remove a txt record from the system - nios_txt_record: +- name: Remove a txt record from the system + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com text: mytext state: absent provider: "{{ nios_provider }}" register: txt_delete1 -- name: remove a txt record from the system - nios_txt_record: +- name: Remove a txt record from the system + infoblox.nios_modules.nios_txt_record: name: txt.ansible.com text: mytext state: absent provider: "{{ nios_provider }}" register: txt_delete2 -- assert: +- name: Verify idempotence and changes of TXT record operations + ansible.builtin.assert: that: - - "txt_create1.changed" - - "not txt_create2.changed" - - "txt_update1.changed" - - "not txt_update2.changed" - - "txt_delete1.changed" - - "not txt_delete2.changed" + - txt_create1.changed + - not txt_create2.changed + - txt_update1.changed + - not txt_update2.changed + - txt_delete1.changed + - not txt_delete2.changed diff --git a/tests/integration/targets/nios_zone/defaults/main.yaml b/tests/integration/targets/nios_zone/defaults/main.yaml index ebf6ffc9..9ef5ba51 100644 --- a/tests/integration/targets/nios_zone/defaults/main.yaml +++ b/tests/integration/targets/nios_zone/defaults/main.yaml @@ -1,3 +1,3 @@ --- testcase: "*" -test_items: [] \ No newline at end of file +test_items: [] diff --git a/tests/integration/targets/nios_zone/meta/main.yaml b/tests/integration/targets/nios_zone/meta/main.yaml index 9472935b..a4ad32ff 100644 --- a/tests/integration/targets/nios_zone/meta/main.yaml +++ b/tests/integration/targets/nios_zone/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_nios_tests \ No newline at end of file + - prepare_nios_tests diff --git a/tests/integration/targets/nios_zone/tasks/main.yml b/tests/integration/targets/nios_zone/tasks/main.yml index cb335970..74f61449 100644 --- a/tests/integration/targets/nios_zone/tasks/main.yml +++ b/tests/integration/targets/nios_zone/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: nios_zone_idempotence.yml +--- +- name: Include NIOS zone idempotence tests + ansible.builtin.include_tasks: nios_zone_idempotence.yml diff --git a/tests/integration/targets/nios_zone/tasks/nios_zone_idempotence.yml b/tests/integration/targets/nios_zone/tasks/nios_zone_idempotence.yml index 03d40aaf..897d537c 100644 --- a/tests/integration/targets/nios_zone/tasks/nios_zone_idempotence.yml +++ b/tests/integration/targets/nios_zone/tasks/nios_zone_idempotence.yml @@ -1,31 +1,32 @@ -- name: cleanup dns view instance - nios_dns_view: +--- +- name: Cleanup dns view instance + infoblox.nios_modules.nios_dns_view: name: ansible-dns state: absent provider: "{{ nios_provider }}" -- name: cleanup test zone - nios_zone: +- name: Cleanup test zone + infoblox.nios_modules.nios_zone: name: ansible-dns state: absent provider: "{{ nios_provider }}" -- name: configure a zone on the system - nios_zone: +- name: Configure a zone on the system + infoblox.nios_modules.nios_zone: name: ansible-dns state: present provider: "{{ nios_provider }}" register: zone_create1 -- name: configure a zone on the system - nios_zone: +- name: Configure a zone on the system + infoblox.nios_modules.nios_zone: name: ansible-dns state: present provider: "{{ nios_provider }}" register: zone_create2 -- name: update the comment and ext attributes for an existing zone - nios_zone: +- name: Update the comment and ext attributes for an existing zone + infoblox.nios_modules.nios_zone: name: ansible-dns comment: this is an example comment extattrs: @@ -34,8 +35,8 @@ provider: "{{ nios_provider }}" register: zone_update1 -- name: update the comment and ext attributes for an existing zone - nios_zone: +- name: Update the comment and ext attributes for an existing zone + infoblox.nios_modules.nios_zone: name: ansible-dns comment: this is an example comment extattrs: @@ -44,25 +45,26 @@ provider: "{{ nios_provider }}" register: zone_update2 -- name: remove the dns zone - nios_zone: +- name: Remove the dns zone + infoblox.nios_modules.nios_zone: name: ansible-dns state: absent provider: "{{ nios_provider }}" register: zone_delete1 -- name: remove the dns zone - nios_zone: +- name: Remove the dns zone + infoblox.nios_modules.nios_zone: name: ansible-dns state: absent provider: "{{ nios_provider }}" register: zone_delete2 -- assert: +- name: Verify idempotence and changes of zone operations + ansible.builtin.assert: that: - - "zone_create1.changed" - - "not zone_create2.changed" - - "zone_update1.changed" - - "not zone_update2.changed" - - "zone_delete1.changed" - - "not zone_delete2.changed" + - zone_create1.changed + - not zone_create2.changed + - zone_update1.changed + - not zone_update2.changed + - zone_delete1.changed + - not zone_delete2.changed diff --git a/tests/integration/targets/prepare_nios_tests/tasks/main.yml b/tests/integration/targets/prepare_nios_tests/tasks/main.yml index e3c03fb3..416ad282 100644 --- a/tests/integration/targets/prepare_nios_tests/tasks/main.yml +++ b/tests/integration/targets/prepare_nios_tests/tasks/main.yml @@ -1 +1,3 @@ -- include_tasks: prepare_nios_tests_idempotence.yml +--- +- name: Include idempotence tests for NIOS + ansible.builtin.include_tasks: prepare_nios_tests_idempotence.yml diff --git a/tests/integration/targets/prepare_nios_tests/tasks/prepare_nios_tests_idempotence.yml b/tests/integration/targets/prepare_nios_tests/tasks/prepare_nios_tests_idempotence.yml index 749faa20..3e468759 100644 --- a/tests/integration/targets/prepare_nios_tests/tasks/prepare_nios_tests_idempotence.yml +++ b/tests/integration/targets/prepare_nios_tests/tasks/prepare_nios_tests_idempotence.yml @@ -1,2 +1,4 @@ -- pip: +--- +- name: Install infoblox-client using pip + ansible.builtin.pip: name: infoblox-client diff --git a/tests/unit/plugins/modules/test_extensible_attribute.py b/tests/unit/plugins/modules/test_extensible_attribute.py new file mode 100644 index 00000000..faafcc89 --- /dev/null +++ b/tests/unit/plugins/modules/test_extensible_attribute.py @@ -0,0 +1,158 @@ +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . + +# Make coding more python3-ish + + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +from ansible_collections.infoblox.nios_modules.plugins.modules import nios_extensible_attribute +from ansible_collections.infoblox.nios_modules.plugins.module_utils import api +from ansible_collections.infoblox.nios_modules.tests.unit.compat.mock import patch, MagicMock, Mock +from .test_nios_module import TestNiosModule, load_fixture + + +class TestNiosExtensibleAttributeModule(TestNiosModule): + + module = nios_extensible_attribute + + def setUp(self): + super(TestNiosExtensibleAttributeModule, self).setUp() + self.module = MagicMock(name='ansible_collections.infoblox.nios_modules.plugins.modules.nios_extensible_attribute.WapiModule') + self.module.check_mode = False + self.module.params = {'provider': None} + self.mock_wapi = patch('ansible_collections.infoblox.nios_modules.plugins.modules.nios_extensible_attribute.WapiModule') + self.exec_command = self.mock_wapi.start() + self.mock_wapi_run = patch('ansible_collections.infoblox.nios_modules.plugins.modules.nios_extensible_attribute.WapiModule.run') + self.mock_wapi_run.start() + self.load_config = self.mock_wapi_run.start() + self.mock_check_type_dict = patch('ansible.module_utils.common.validation.check_type_dict') + self.mock_check_type_dict_obj = self.mock_check_type_dict.start() + + def tearDown(self): + super(TestNiosExtensibleAttributeModule, self).tearDown() + self.mock_wapi.stop() + self.mock_wapi_run.stop() + self.mock_check_type_dict.stop() + + def _get_wapi(self, test_object): + wapi = api.WapiModule(self.module) + wapi.get_object = Mock(name='get_object', return_value=test_object) + wapi.create_object = Mock(name='create_object') + wapi.update_object = Mock(name='update_object') + wapi.delete_object = Mock(name='delete_object') + return wapi + + def load_fixtures(self, commands=None): + self.exec_command.return_value = (0, load_fixture('nios_result.txt').strip(), None) + self.load_config.return_value = dict(diff=None, session='session') + + def test_create_extensible_attribute(self): + self.module.params = { + 'name': 'my_string', + 'type': 'STRING', + 'comment': 'Created by ansible', + 'state': 'present', + 'provider': None + } + + test_object = None + + test_spec = { + "name": {"ib_req": True}, + "type": {"ib_req": True}, + "comment": {}, + } + + wapi = self._get_wapi(test_object) + print("WAPI: ", wapi.__dict__) + res = wapi.run('testobject', test_spec) + + self.assertEqual(res['changed'], True) + wapi.create_object.assert_called_once_with('testobject', {'name': 'my_string', + 'type': 'STRING', + 'comment': 'Created by ansible'}) + + def test_nios_ea_update_comment(self): + self.module.params = { + 'provider': None, + 'state': 'present', + 'name': 'testStringEA', + 'type': 'STRING', + 'flag': 'I', + 'default_value': 'test', + 'comment': 'Update comment' + } + + ref = "extensibleattributedef/b25lLmV4dGVuc2libGVfYXR0cmlidXRlc19kZWYkLlRlcnJhZm9ybSBJbnRlcm5hbCBJRA:testStringEA" + + test_object = [ + { + "comment": "test comment", + "_ref": ref, + "name": "testStringEA", + "flag": "I", + "type": "STRING", + "default_value": "test" + } + ] + + test_spec = { + "name": {"ib_req": True}, + "type": {"ib_req": True}, + "comment": {}, + "flag": {}, + "default_value": {} + } + + wapi = self._get_wapi(test_object) + res = wapi.run('testobject', test_spec) + self.assertTrue(res['changed']) + wapi.update_object.assert_called_once_with( + ref, {'comment': 'Update comment', 'type': 'STRING', 'name': 'testStringEA', 'flag': 'I', 'default_value': 'test'} + ) + + def test_remove_extensible_attribute(self): + self.module.params = {'provider': None, 'state': 'absent', 'name': 'testStringEA', 'type': 'STRING', + 'flag': None, 'default_value': None, 'comment': None} + + ref = "extensibleattributedef/b25lLmV4dGVuc2libGVfYXR0cmlidXRlc19kZWYkLlRlcnJhZm9ybSBJbnRlcm5hbCBJRA:testStringEA" + + test_object = [ + { + "comment": "test comment", + "_ref": ref, + "name": "testStringEA", + "flag": "I", + "type": "STRING", + "default_value": "test" + } + ] + + test_spec = { + "name": {"ib_req": True}, + "type": {"ib_req": True}, + "comment": {}, + "flag": {}, + "default_value": {} + } + + wapi = self._get_wapi(test_object) + res = wapi.run('testobject', test_spec) + + self.assertTrue(res['changed']) + wapi.delete_object.assert_called_once_with(ref)