-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: v2
Are you sure you want to change the base?
Conversation
VishrutiBuddhadev
commented
Dec 10, 2024
- Generated resources for ipam_host
- Written integration tests
- deprecate b1_ipam_host and b1_ipam_host_gather
plugins/modules/ipam_host.py
Outdated
""" # noqa: E501 | ||
|
||
EXAMPLES = r""" | ||
- name: "Create a Host" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing in the EXAMPLES isnt aligned with other part of doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
plugins/modules/ipam_host.py
Outdated
state: "present" | ||
register: ip_space | ||
|
||
- name: "Create a Subnet" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is subnet required here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To create a host with addresses both IP Space and Subnet are required. So I have added it to examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there isnt any usage of subnet in any of the tasks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I don't create a subnet, it gives this error No existing Subnet to contain 10.0.0.1 IP Address
plugins/modules/ipam_host.py
Outdated
state: "present" | ||
register: host | ||
|
||
- name: "Create an IP space" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create IP Space at the beginning of the examples with (required as parent)
specified in the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
plugins/modules/ipam_host.py
Outdated
state: "present" | ||
register: subnet | ||
|
||
- name: "Create a Host with Addresses" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: "Create a Host with Addresses" | |
- name: "Create a Host with Additional Fields" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
plugins/modules/ipam_host.py
Outdated
|
||
- name: "Create an IP space" | ||
infoblox.bloxone.ipam_ip_space: | ||
name: "{{ name }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: "{{ name }}" | |
name: "example_host" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
plugins/modules/ipam_host_info.py
Outdated
infoblox.bloxone.ipam_host: | ||
name: "{{ name }}" | ||
tags: | ||
tag1: "{{ tag1_value }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide an actual tag value and not a placeholder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tag2: "value2" | ||
state: "present" | ||
register: host | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- host_info.objects[0].tags.tag1 == "value1" | ||
- host_info.objects[0].tags.tag2 == "value2" | ||
|
||
- name: Create an IP space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use setup_ip_space
and setup_subnet
instead of creating them here .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
space: "{{ ip_space.id }}" | ||
state: "present" | ||
register: host | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line . Keep lines only between different plays !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
plugins/modules/ipam_host_info.py
Outdated
""" # noqa: E501 | ||
|
||
EXAMPLES = r""" | ||
- name: Create a Host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block can be removed , no need to create the host , host.id can be used as a placeholder in the GET Calls below !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
plugins/modules/ipam_host_info.py
Outdated
infoblox.bloxone.ipam_host_info: | ||
id: "{{ host.id }}" | ||
register: host_info | ||
- assert: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assertions aren't required in examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed assertions!
--- | ||
dependencies: | ||
- setup_ip_space | ||
- setup_subnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a Line at the end of the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,4 @@ | |||
--- | |||
dependencies: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make Dependencies a list instead.
dependencies: | |
dependencies: [ setup_ip_space , setup_subnet ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modified
name: "{{ name }}" | ||
state: "present" | ||
check_mode: true | ||
register: host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Info Call and assertion statements are missing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added