Skip to content

Commit

Permalink
[FIX] Ansible lint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JchhatbarInfoblox committed Jul 9, 2024
1 parent 68f64ce commit 3eea9ea
Show file tree
Hide file tree
Showing 114 changed files with 1,092 additions and 1,009 deletions.
85 changes: 42 additions & 43 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: CI
on:
# Run CI against all pushes (direct commits) and Pull Requests
# Run CI against all pushes (direct commits) and Pull Requests
push:
pull_request:
schedule:
- cron: '0 2 * * 1'
- cron: 0 2 * * 1

jobs:
build:
Expand All @@ -21,7 +22,7 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
python-version: "3.10"

- name: Install ansible (${{ matrix.ansible-version }})
run: pip install pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
Expand All @@ -35,11 +36,10 @@ jobs:
name: collection
path: .cache/collection-tarballs


###
# Unit tests
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html
###
# Unit tests
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html

unit:
name: Unit Tests
Expand All @@ -48,21 +48,21 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ["3.8", "3.9", "3.10", "3.11"]
ansible-version: [stable-2.14, stable-2.15, stable-2.16, devel]
exclude:
- ansible-version: devel
python-version: '3.8'
python-version: "3.8"
- ansible-version: devel
python-version: '3.9'
python-version: "3.9"
- ansible-version: stable-2.16
python-version: '3.8'
python-version: "3.8"
- ansible-version: stable-2.16
python-version: '3.9'
python-version: "3.9"
- ansible-version: stable-2.15
python-version: '3.8'
python-version: "3.8"
- ansible-version: stable-2.14
python-version: '3.8'
python-version: "3.8"

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -83,29 +83,30 @@ jobs:
run: |
ansible-galaxy collection install .cache/collection-tarballs/*.tar.gz
git clone https://github.com/ansible/ansible.git -b ${{ matrix.ansible-version }}
if [ "${{ matrix.ansible-version }}" != "devel" ]; then cp -rf ansible/test/units/compat /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/; fi
if [ "${{ matrix.ansible-version }}" != "devel" ]; then
cp -rf ansible/test/units/compat /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/; fi
cp -rf ansible/test/units/modules/utils.py /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/plugins/modules/
sed -i 's/units/ansible_collections.infoblox.nios_modules.tests.unit/' /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/plugins/modules/utils.py
if [ -f /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/requirements.txt ]; then pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/requirements.txt; fi
if [ -f /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/requirements.txt ]; then
pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/unit/requirements.txt; fi
- name: Run Unit tests using ansible-test
run: ansible-test units -v --color --python ${{ matrix.python-version }} --coverage
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/

- name: Generate coverage report
run: |
if [ "${{ matrix.ansible-version }}" == "stable-2.14" ]; then
if [ "${{ matrix.ansible-version }}" == "stable-2.14" ]; then
pip install coverage==6.5.0;
elif [ "${{ matrix.ansible-version }}" == "stable-2.15" ]; then
pip install coverage==6.5.0;
fi
ansible-test coverage xml -v --group-by command --group-by version
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/


###
# Integration tests
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
###
# Integration tests
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html

integration:
name: Integration tests
Expand All @@ -114,21 +115,21 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ["3.8", "3.9", "3.10", "3.11"]
ansible-version: [stable-2.14, stable-2.15, stable-2.16, devel]
exclude:
- ansible-version: devel
python-version: '3.8'
python-version: "3.8"
- ansible-version: devel
python-version: '3.9'
python-version: "3.9"
- ansible-version: stable-2.16
python-version: '3.8'
python-version: "3.8"
- ansible-version: stable-2.16
python-version: '3.9'
python-version: "3.9"
- ansible-version: stable-2.15
python-version: '3.8'
python-version: "3.8"
- ansible-version: stable-2.14
python-version: '3.8'
python-version: "3.8"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
Expand All @@ -152,19 +153,19 @@ jobs:

- name: Setup Integration test Pre-requisites
run: |
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
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
# Run the integration tests
- name: Run integration test
run: |
echo $ANSIBLE_NIOSSIM_CONTAINER
ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python-version }} --docker --coverage
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:3.0.0
ANSIBLE_NIOSSIM_CONTAINER: quay.io/ansible/nios-test-container:3.0.0
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/

# ansible-test support producing code coverage date
# ansible-test support producing code coverage date
- name: Generate coverage report
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/
Expand All @@ -173,11 +174,10 @@ jobs:
with:
fail_ci_if_error: false


###
# Sanity tests (REQUIRED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html
###
# Sanity tests (REQUIRED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html

sanity:
name: Sanity Tests
Expand All @@ -187,14 +187,13 @@ jobs:
fail-fast: false
matrix:
ansible-version: [stable-2.14, stable-2.15, stable-2.16, devel]

steps:
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: '3.10'
python-version: "3.10"

- name: Install ansible (${{ matrix.ansible-version }}) version
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
Expand Down
55 changes: 28 additions & 27 deletions changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
plugins:
become: {}
cache: {}
Expand Down Expand Up @@ -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: {}
Expand Down
Loading

0 comments on commit 3eea9ea

Please sign in to comment.