Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPAM Host Support for Bloxone Ansible v2 #52

Merged
merged 24 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f2071d3
generated resources for ipam_host and added examples
VishrutiBuddhadev Dec 10, 2024
36236b0
written integration tests for ipam_host
VishrutiBuddhadev Dec 10, 2024
4124d2e
deprecate b1_ipam_host and b1_ipam_host_gather
VishrutiBuddhadev Dec 10, 2024
38a69ee
Merge branch 'v2' into ipam_host
VishrutiBuddhadev Dec 10, 2024
cf5cfd2
fixed sanity issues and added empty line at the end
VishrutiBuddhadev Dec 11, 2024
00d9e16
removed instances of inherit
VishrutiBuddhadev Dec 11, 2024
b15c0b2
fixed documentation and added empty line at the end of file
VishrutiBuddhadev Dec 11, 2024
ca9c709
refactored integration tests
VishrutiBuddhadev Dec 12, 2024
1047ea3
addressed review comments
VishrutiBuddhadev Dec 17, 2024
b3f49dc
fixed sanity issues
VishrutiBuddhadev Dec 17, 2024
7efcdff
modified examples
VishrutiBuddhadev Dec 19, 2024
c6ed192
fixed sanity issues
VishrutiBuddhadev Dec 19, 2024
bd79d18
Merge branch 'v2' into ipam_host
VishrutiBuddhadev Dec 19, 2024
96fd2a9
addressed review comments
VishrutiBuddhadev Dec 19, 2024
ed20b91
added new line at the end
VishrutiBuddhadev Dec 19, 2024
4a8dc18
Merge branch 'v2' into ipam_host
VishrutiBuddhadev Dec 23, 2024
3bc54b2
modified examples
VishrutiBuddhadev Jan 3, 2025
fafa557
modified examples
VishrutiBuddhadev Jan 3, 2025
07626de
added code for cleanup
VishrutiBuddhadev Jan 6, 2025
24b33a1
addressed review comments
VishrutiBuddhadev Jan 6, 2025
210defc
added new line
VishrutiBuddhadev Jan 6, 2025
faa4cdd
addressed review comments
VishrutiBuddhadev Jan 8, 2025
3c195b8
addressed review comments
VishrutiBuddhadev Jan 9, 2025
4af66b3
Merge branch 'v2' into ipam_host
mathewab Jan 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/modules/b1_ipam_host_gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

DOCUMENTATION = """
---
module: b1_ipam_ip_space
module: b1_ipam_host
author: "Akhilesh Kabade (@akhilesh-kabade-infoblox)"
short_description: Gather IPAM host facts
deprecated:
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ipam_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
DOCUMENTATION = r"""
---
module: ipam_host
short_description: Manage IpamHost
short_description: Manage IPAM host
description:
- Manage IpamHost
- Manage IPAM host
version_added: 2.0.0
author: Infoblox Inc. (@infobloxopen)
options:
Expand Down Expand Up @@ -134,12 +134,12 @@
RETURN = r"""
id:
description:
- ID of the IpamHost object
- ID of the IPAM host object
type: str
returned: Always
item:
description:
- IpamHost object
- IPAM host object
type: complex
returned: Always
contains:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/ipam_host/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
dependencies: [setup_ip_space, setup_subnet]
dependencies: [setup_ip_space, setup_subnet, setup_view, setup_auth_zone]
33 changes: 33 additions & 0 deletions tests/integration/targets/ipam_host/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,29 @@
- host is not changed
- host is not failed

- name: Create a Host with auto generate records set to true
infoblox.bloxone.ipam_host:
name: "{{ name }}"
auto_generate_records: true
host_names:
- name: "example-host"
zone: "{{ _auth_zone.id }}"
addresses:
- address: "10.0.0.1"
space: "{{ _ip_space.id }}"
state: "present"
register: host
- name: Get information about the host
infoblox.bloxone.ipam_host_info:
filters:
name: "{{ name }}"
register: host_info
- assert:
that:
- host is not failed
- host_info.objects | length == 1
- host_info.objects[0].id == host.id

- name: Create a Host with comment
infoblox.bloxone.ipam_host:
name: "{{ name }}"
Expand Down Expand Up @@ -165,6 +188,16 @@
state: "absent"
ignore_errors: true

- name: "Delete an Auth Zone"
ansible.builtin.include_role:
name: setup_auth_zone
tasks_from: cleanup.yml

- name: "Delete DNS View"
ansible.builtin.include_role:
name: setup_view
tasks_from: cleanup.yml

- name: "Delete IP Space"
ansible.builtin.include_role:
name: setup_ip_space
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/targets/setup_auth_zone/tasks/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- module_defaults:
group/infoblox.bloxone.all:
csp_url: "{{ csp_url }}"
api_key: "{{ api_key }}"
block:
- name: "Delete an Auth Zone"
infoblox.bloxone.dns_auth_zone:
fqdn: "{{ _fqdn_auth_zone }}"
state: "absent"
ignore_errors: true
11 changes: 11 additions & 0 deletions tests/integration/targets/setup_view/tasks/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- module_defaults:
group/infoblox.bloxone.all:
csp_url: "{{ csp_url }}"
api_key: "{{ api_key }}"
block:
- name: "Delete DNS View"
infoblox.bloxone.dns_view:
name: "{{ dns_view_name }}"
state: absent
ignore_errors: true
4 changes: 2 additions & 2 deletions tests/integration/targets/setup_view/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
block:
# Create a random View name to avoid conflicts
- ansible.builtin.set_fact:
name: "test-view-{{ 999999 | random | string }}"
dns_view_name: "test-view-{{ 999999 | random | string }}"

- name: Create a View
infoblox.bloxone.dns_view:
name: "{{ name }}"
name: "{{ dns_view_name }}"
state: present
register: _view
Loading