Skip to content

Commit

Permalink
addressed review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
JchhatbarInfoblox committed Dec 13, 2024
1 parent 07cb653 commit 7a9df57
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
2 changes: 0 additions & 2 deletions changelogs/fragments/38-range.yml

This file was deleted.

2 changes: 2 additions & 0 deletions changelogs/fragments/48-range.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deprecated_features:
- b1_ipam_range - is deprecated in favor of `ipam_range`.
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ plugin_routing:
b1_ipam_range:
deprecation:
removal_version: 3.0.0
warning_text: Use infoblox.bloxone.ipam_range instead.
warning_text: Use infoblox.bloxone.ipam_range instead.
2 changes: 1 addition & 1 deletion plugins/modules/b1_ipam_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
version_added: "1.0.1"
deprecated:
removed_in: "3.0.0"
why: "This module is being deprecated and will be removed in version 3.0.0."
why: "This module is being deprecated and will be removed in version 3.0.0. Use M(ipam_range) instead."
alternative: "Use the M(ipam_range) module instead."
description:
- Create, Update and Delete the IPAM range on Infoblox BloxOne DDI. This module manages the IPAM IPAM range object using BloxOne REST APIs.
Expand Down
46 changes: 30 additions & 16 deletions tests/integration/targets/ipam_range/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
api_key: "{{ api_key }}"
block:

# Create a random IP space name to avoid conflicts
- ansible.builtin.set_fact:
tag_value: "site-{{ 999999 | random | string }}"
range_start: "10.0.0.1"
Expand Down Expand Up @@ -184,7 +183,6 @@
- range_info.objects | length == 1
- range_info.objects[0].tags.location == tag_value

# Test case for creating a range with a name
- name: "Create a Range with name"
infoblox.bloxone.ipam_range:
start: "{{ range_start }}"
Expand All @@ -206,7 +204,6 @@
- range_info.objects | length == 1
- range_info.objects[0].name == "Test Range"

# Test case for creating a range with exclusion ranges
- name: "Create a Range with exclusion ranges"
infoblox.bloxone.ipam_range:
start: "{{ range_start }}"
Expand All @@ -233,7 +230,6 @@
- range_info.objects[0].exclusion_ranges[0].end == "10.0.0.20"
- range_info.objects[0].exclusion_ranges[0].comment == "Exclude this range"

# Test case for creating a range with a threshold
- name: "Create a Range with threshold"
infoblox.bloxone.ipam_range:
start: "{{ range_start }}"
Expand All @@ -260,24 +256,42 @@
- range_info.objects[0].threshold.high == 90
- range_info.objects[0].threshold.low == 10

- name: "Create a Range with inheritance sources"
infoblox.bloxone.ipam_range:
start: "{{ range_start }}"
end: "{{ range_end }}"
space: "{{ _ip_space.id }}"
inheritance_sources:
dhcp_options:
action: "block"
state: "present"
register: range
- name: Get information about the Range
infoblox.bloxone.ipam_range_info:
filters:
start: "{{ range_start }}"
end: "{{ range_end }}"
space: "{{ _ip_space.id }}"
register: range_info
- assert:
that:
- range is not failed
- range_info.objects | length == 1
- range_info.objects[0].inheritance_sources.dhcp_options.action == "block"


always:
# Cleanup if the test fails
- name: "Delete a Range"
infoblox.bloxone.ipam_range:
start: "{{ range_start }}"
end: "{{ range_end }}"
space: "{{ _ip_space.id }}"
state: "absent"

- name: "Delete Subnet"
infoblox.bloxone.ipam_subnet:
address: "10.0.0.0/24"
space: "{{ _ip_space.id }}"
state: "absent"
ignore_errors: true
- ansible.builtin.include_role:
name: "setup_subnet"
tasks_from: "cleanup.yml"

- name: "Delete IP Space"
infoblox.bloxone.ipam_ip_space:
name: "{{ name }}"
state: "absent"
ignore_errors: true
- ansible.builtin.include_role:
name: "setup_ip_space"
tasks_from: "cleanup.yml"

0 comments on commit 7a9df57

Please sign in to comment.