Skip to content

Commit

Permalink
Refactor Branch to modify Collection name from "bloxone" to "universa…
Browse files Browse the repository at this point in the history
…l_ddi" (infobloxopen#73)

* changed name from bloxone to universal_ddi

* remove v1 files

* removed bloxone/universal_ddi.py lookup file

* Removed sanity folder consisting of ignore files for v1 modules

* updated version added

* added changes for kerberos

* updated sanity tests

* added removed files

* updated records and modified deprecations

* changed version_added to 2.0

* added review comments

---------

Co-authored-by: Ashish Mathew <54074687+mathewab@users.noreply.github.com>
  • Loading branch information
unasra and mathewab authored Feb 3, 2025
1 parent a6ebe65 commit 3ed8fd9
Show file tree
Hide file tree
Showing 131 changed files with 1,600 additions and 1,600 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v4
with:
path: infoblox.bloxone
path: infoblox.universal_ddi

- name: Set up integration_config.yml
run: |
echo "portal_key: ${{ secrets.INFOBLOX_PORTAL_KEY }}" > infoblox.bloxone/tests/integration/integration_config.yml
echo "portal_url: ${{ secrets.INFOBLOX_PORTAL_URL }}" >> infoblox.bloxone/tests/integration/integration_config.yml
echo "portal_key: ${{ secrets.INFOBLOX_PORTAL_KEY }}" > infoblox.universal_ddi/tests/integration/integration_config.yml
echo "portal_url: ${{ secrets.INFOBLOX_PORTAL_URL }}" >> infoblox.universal_ddi/tests/integration/integration_config.yml
- uses: ansible-community/ansible-test-gh-action@v1.15.0
with:
collection-src-directory: infoblox.bloxone
collection-src-directory: infoblox.universal_ddi
ansible-core-version: 'stable-2.15'
target-python-version: '3.11'
testing-type: integration
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
- name: Checkout the repository
uses: actions/checkout@v4
with:
path: infoblox.bloxone
path: infoblox.universal_ddi

- uses: ansible-community/ansible-test-gh-action@v1.15.0
with:
collection-src-directory: infoblox.bloxone
collection-src-directory: infoblox.universal_ddi
ansible-core-version: ${{ matrix.ansible }}
target-python-version: ${{ matrix.python }}
testing-type: sanity
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Infoblox BloxOne Collection for Ansible

The Infoblox BloxOne Collection (`infoblox.bloxone`) includes a variety of Ansible modules to help automate the management of BloxOne services.
The Infoblox BloxOne Collection (`infoblox.universal_ddi`) includes a variety of Ansible modules to help automate the management of BloxOne services.

## Version Information

### What's new in v2
- The collection has been renamed from `b1ddi_modules` to `bloxone`.
- The modules are renamed to follow the BloxOne API naming conventions. The old module names are deprecated and will be removed in the next major release.
- The collection has been renamed from `b1ddi_modules` to `universal_ddi`.
- The modules are renamed to follow the Universal DDI API naming conventions. The old module names are deprecated and will be removed in the next major release.
- The modules are rewritten to use the [Universal DDI Python client](https://github.com/infobloxopen/universal-ddi-python-client) library. This provides a more consistent experience across the modules and supports a wider range of BloxOne services.

## Requirements
Expand All @@ -18,7 +18,7 @@ The Infoblox BloxOne Collection (`infoblox.bloxone`) includes a variety of Ansib

## Installation

The `infoblox.bloxone` collection can be installed from git repository.
The `infoblox.universal_ddi` collection can be installed from git repository.

```shell
ansible-galaxy collection install git+https://github.com/infobloxopen/bloxone-ansible.git,v2
Expand Down
2 changes: 1 addition & 1 deletion changelogs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ sections:
- Bugfixes
- - known_issues
- Known Issues
title: Infoblox.Bloxone
title: infoblox.universal_ddi
trivial_section_name: trivial
use_fqcn: true
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace: infoblox

# The name of the collection. Has the same character restrictions as 'namespace'
name: bloxone
name: universal_ddi

# The version of the collection. Must be compatible with semantic versioning
version: 2.0.0
Expand Down Expand Up @@ -33,7 +33,7 @@ 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', 'bloxone', 'dns', 'ipam', 'dhcp', 'ddi', 'networking']
tags: ['infoblox', 'universal_ddi', 'dns', 'ipam', 'dhcp', 'ddi', '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
Expand Down
46 changes: 23 additions & 23 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,103 +61,103 @@ plugin_routing:
b1_ipam_ip_space:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_ip_space instead.
warning_text: Use infoblox.universal_ddi.ipam_ip_space instead.
b1_ipam_ip_space_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_ip_space_info instead.
warning_text: Use infoblox.universal_ddi.ipam_ip_space_info instead.

b1_ipam_subnet:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_subnet instead.
warning_text: Use infoblox.universal_ddi.ipam_subnet instead.
b1_ipam_subnet_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_subnet_info instead.
warning_text: Use infoblox.universal_ddi.ipam_subnet_info instead.

b1_dns_view:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_view instead.
warning_text: Use infoblox.universal_ddi.dns_view instead.
b1_dns_view_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_view_info instead.
warning_text: Use infoblox.universal_ddi.dns_view_info instead.

b1_ipam_address_block:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_address_block instead.
warning_text: Use infoblox.universal_ddi.ipam_address_block instead.
b1_ipam_address_block_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_address_block_info instead.
warning_text: Use infoblox.universal_ddi.ipam_address_block_info instead.

b1_dns_auth_zone:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_auth_zone instead.
warning_text: Use infoblox.universal_ddi.dns_auth_zone instead.
b1_dns_zone_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_auth_zone_info instead.
warning_text: Use infoblox.universal_ddi.dns_auth_zone_info instead.

b1_ipam_range:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_range instead.
warning_text: Use infoblox.universal_ddi.ipam_range instead.

b1_ipam_host:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_host instead.
warning_text: Use infoblox.universal_ddi.ipam_host instead.
b1_ipam_host_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_host_info instead.
warning_text: Use infoblox.universal_ddi.ipam_host_info instead.

b1_ipam_ipv4_reservation:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_address instead.
warning_text: Use infoblox.universal_ddi.ipam_address instead.
b1_ipam_ipv4_reservation_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_address_info instead.
warning_text: Use infoblox.universal_ddi.ipam_address_info instead.

b1_a_record:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record instead.
warning_text: Use infoblox.universal_ddi.dns_record instead.
b1_a_record_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record_info instead.
warning_text: Use infoblox.universal_ddi.dns_record_info instead.

b1_cname_record:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record instead.
warning_text: Use infoblox.universal_ddi.dns_record instead.
b1_cname_record_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record_info instead.
warning_text: Use infoblox.universal_ddi.dns_record_info instead.

b1_ns_record:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record instead.
warning_text: Use infoblox.universal_ddi.dns_record instead.
b1_ns_record_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record_info instead.
warning_text: Use infoblox.universal_ddi.dns_record_info instead.

b1_ptr_record:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record instead.
warning_text: Use infoblox.universal_ddi.dns_record instead.
b1_ptr_record_gather:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.dns_record_info instead.
warning_text: Use infoblox.universal_ddi.dns_record_info instead.
6 changes: 3 additions & 3 deletions plugins/lookup/bloxone.py → plugins/lookup/universal_ddi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

DOCUMENTATION = """
---
name: bloxone
name: universal_ddi
author:
- "Vedant Sethia (@vedantsethia)"
- "Chris Marrison (@ccmarris)"
Expand Down Expand Up @@ -38,7 +38,7 @@
EXAMPLES = """
- name: fetch all IP Space objects
ansible.builtin.set_fact:
ip_space: "{{ lookup('bloxone', '/ipam/ipspace' , filters={'name': 'vsethia-ip-space'}, tfilters={'Tagname': '<value>'}, fields=['id', 'name', 'comment'] , provider={'host': '{{host}}', 'api_key': '{{api_key}}'}) }}"
ip_space: "{{ lookup('universal_ddi', '/ipam/ipspace' , filters={'name': 'vsethia-ip-space'}, tfilters={'Tagname': '<value>'}, fields=['id', 'name', 'comment'] , provider={'host': '{{host}}', 'api_key': '{{api_key}}'}) }}"
""" # noqa: E501

Expand Down Expand Up @@ -128,7 +128,7 @@ class LookupModule(LookupBase):
def run(self, terms, variables=None, **kwargs):
if not HAS_REQUESTS_LIB:
raise AnsibleError(
"The 'bloxone' lookup cannot be run without the 'requests' library installed."
"The 'universal_ddi' lookup cannot be run without the 'requests' library installed."
) from REQUESTS_LIB_IMP_ERR
try:
obj_type = terms[0]
Expand Down
4 changes: 2 additions & 2 deletions plugins/module_utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
UNIVERSAL_DDI_CLIENT_IMP_ERR = traceback.format_exc()


class BloxoneAnsibleModule(AnsibleModule):
class UniversalDDIAnsibleModule(AnsibleModule):
def __init__(self, *args, **kwargs):
# Add common arguments to the module argument_spec
args_full = universal_ddi_client_common_argument_spec()
Expand All @@ -30,7 +30,7 @@ def __init__(self, *args, **kwargs):
pass
kwargs["argument_spec"] = args_full

super(BloxoneAnsibleModule, self).__init__(*args, **kwargs)
super(UniversalDDIAnsibleModule, self).__init__(*args, **kwargs)
self._client = None

if not HAS_UNIVERSAL_DDI_CLIENT:
Expand Down
14 changes: 7 additions & 7 deletions plugins/modules/dns_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@
type: dict
extends_documentation_fragment:
- infoblox.bloxone.common
- infoblox.universal_ddi.common
""" # noqa: E501

EXAMPLES = r"""
- name: Create ACL
infoblox.bloxone.dns_acl:
infoblox.universal_ddi.dns_acl:
name: "example-acl"
state: "present"
- name: Create ACL with additional fields
infoblox.bloxone.dns_acl:
infoblox.universal_ddi.dns_acl:
name: "example-acl"
comment: "example comment"
list:
Expand All @@ -149,7 +149,7 @@
state: "present"
- name: Delete ACL
infoblox.bloxone.dns_acl:
infoblox.universal_ddi.dns_acl:
name: "example-acl"
state: "absent"
"""
Expand Down Expand Up @@ -273,16 +273,16 @@
returned: Always
""" # noqa: E501

from ansible_collections.infoblox.bloxone.plugins.module_utils.modules import BloxoneAnsibleModule
from ansible_collections.infoblox.universal_ddi.plugins.module_utils.modules import UniversalDDIAnsibleModule

try:
from dns_config import ACL, AclApi
from universal_ddi_client import ApiException, NotFoundException
except ImportError:
pass # Handled by BloxoneAnsibleModule
pass # Handled by UniversalDDIAnsibleModule


class AclModule(BloxoneAnsibleModule):
class AclModule(UniversalDDIAnsibleModule):
def __init__(self, *args, **kwargs):
super(AclModule, self).__init__(*args, **kwargs)

Expand Down
16 changes: 8 additions & 8 deletions plugins/modules/dns_acl_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@
required: false
extends_documentation_fragment:
- infoblox.bloxone.common
- infoblox.universal_ddi.common
""" # noqa: E501

EXAMPLES = r"""
- name: Get ACL by ID
infoblox.bloxone.dns_acl_info:
infoblox.universal_ddi.dns_acl_info:
id: "{{ acl_id }}"
- name: Get ACL by filters
infoblox.bloxone.dns_acl_info:
infoblox.universal_ddi.dns_acl_info:
filters:
name: "{{ acl_name }}"
- name: Get ACL by filter query
infoblox.bloxone.dns_acl_info:
infoblox.universal_ddi.dns_acl_info:
filter_query: "name=='{{ acl_name }}'"
- name: Get ACL by tag filters
infoblox.bloxone.dns_acl_info:
infoblox.universal_ddi.dns_acl_info:
tag_filters:
location: "us-west"
"""
Expand Down Expand Up @@ -186,16 +186,16 @@
returned: Always
""" # noqa: E501

from ansible_collections.infoblox.bloxone.plugins.module_utils.modules import BloxoneAnsibleModule
from ansible_collections.infoblox.universal_ddi.plugins.module_utils.modules import UniversalDDIAnsibleModule

try:
from dns_config import AclApi
from universal_ddi_client import ApiException, NotFoundException
except ImportError:
pass # Handled by BloxoneAnsibleModule
pass # Handled by UniversalDDIAnsibleModule


class AclInfoModule(BloxoneAnsibleModule):
class AclInfoModule(UniversalDDIAnsibleModule):
def __init__(self, *args, **kwargs):
super(AclInfoModule, self).__init__(*args, **kwargs)
self._existing = None
Expand Down
Loading

0 comments on commit 3ed8fd9

Please sign in to comment.