diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 24bbfe05..b3b0d8f2 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -24,7 +24,7 @@ jobs: python-version: '3.11' - 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 + run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check - name: Build a collection tarball run: ansible-galaxy collection build --output-path "${GITHUB_WORKSPACE}/.cache/collection-tarballs" diff --git a/plugins/lookup/nios_next_network.py b/plugins/lookup/nios_next_network.py index 9324fe4c..776f63c9 100644 --- a/plugins/lookup/nios_next_network.py +++ b/plugins/lookup/nios_next_network.py @@ -69,10 +69,10 @@ networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '192.168.10.0/24', cidr=25, exclude=['192.168.10.0/25'], provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}" -- name: return the available ipv6 network addresses for network-container 2001:1:111:1::0/64 - set_fact: - networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '2001:1:111:1::0/64', cidr=126, - provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}" +- name: return the available ipv6 network addresses for network-container 2001:1:111:1::0/64 + set_fact: + networkaddr: "{{ lookup('infoblox.nios_modules.nios_next_network', '2001:1:111:1::0/64', cidr=126, + provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}" """ RETURN = """ @@ -90,6 +90,7 @@ from ..module_utils.api import NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER import ipaddress + class LookupModule(LookupBase): def run(self, terms, variables=None, **kwargs): @@ -106,7 +107,7 @@ def run(self, terms, variables=None, **kwargs): raise AnsibleError('missing CIDR argument in the form of xx') if network.prefixlen >= cidr: - raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr,network.prefixlen)) + raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr, network.prefixlen)) container_type = None network_objects = None @@ -125,14 +126,14 @@ def run(self, terms, variables=None, **kwargs): # check for valid subnetting cidr if network.prefixlen >= cidr: - raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr,network.prefixlen)) + raise AnsibleError('cidr %s must be greater than parent network cidr %s' % (cidr, network.prefixlen)) provider = kwargs.pop('provider', {}) wapi = WapiLookup(provider) if container_type is None: raise AnsibleError('unable to identify network-container type') - + network_objects = wapi.get_object(container_type, {'network': network.with_prefixlen}) if network_objects is None: diff --git a/tests/requirements.txt b/tests/requirements.txt index f0ae0e93..708b417d 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,5 +1,3 @@ -pip==20.3.4; python_version == '2.6' or python_version=='2.7' -pip==22.2.2; python_version > '3.0' infoblox-client pytest pytest-xdist diff --git a/tests/unit/requirements.txt b/tests/unit/requirements.txt index 065df589..c64045e9 100644 --- a/tests/unit/requirements.txt +++ b/tests/unit/requirements.txt @@ -1,5 +1,3 @@ -pip==20.3.4; python_version == '2.6' or python_version=='2.7' -pip==22.2.2; python_version > '3.0' infoblox-client pytest pytest-forked