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

Open
wants to merge 16 commits into
base: v2
Choose a base branch
from

Conversation

VishrutiBuddhadev
Copy link

  • Generated resources for ipam_host
  • Written integration tests
  • deprecate b1_ipam_host and b1_ipam_host_gather

@VishrutiBuddhadev VishrutiBuddhadev marked this pull request as ready for review December 10, 2024 16:30
@VishrutiBuddhadev VishrutiBuddhadev changed the title ipam_host implementation for Bloxone Ansible v2 ipam_host support for Bloxone Ansible v2 Dec 11, 2024
@VishrutiBuddhadev VishrutiBuddhadev changed the title ipam_host support for Bloxone Ansible v2 ipam_host Support for Bloxone Ansible v2 Dec 11, 2024
@unasra unasra changed the title ipam_host Support for Bloxone Ansible v2 IPAM Host Support for Bloxone Ansible v2 Dec 16, 2024
@unasra unasra self-requested a review December 17, 2024 05:28
""" # noqa: E501

EXAMPLES = r"""
- name: "Create a Host"
Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

state: "present"
register: ip_space

- name: "Create a Subnet"
Copy link
Collaborator

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 ?

Copy link
Author

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

Copy link
Collaborator

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 !

Copy link
Author

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

state: "present"
register: host

- name: "Create an IP space"
Copy link
Collaborator

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

state: "present"
register: subnet

- name: "Create a Host with Addresses"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: "Create a Host with Addresses"
- name: "Create a Host with Additional Fields"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed


- name: "Create an IP space"
infoblox.bloxone.ipam_ip_space:
name: "{{ name }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "{{ name }}"
name: "example_host"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

infoblox.bloxone.ipam_host:
name: "{{ name }}"
tags:
tag1: "{{ tag1_value }}"
Copy link
Collaborator

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

Copy link
Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

Copy link
Author

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
Copy link
Collaborator

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 .

Copy link
Author

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

Copy link
Collaborator

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 !

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

""" # noqa: E501

EXAMPLES = r"""
- name: Create a Host
Copy link
Collaborator

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 !

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

infoblox.bloxone.ipam_host_info:
id: "{{ host.id }}"
register: host_info
- assert:
Copy link
Collaborator

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.

Copy link
Author

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
Copy link
Collaborator

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

Copy link
Author

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:
Copy link
Collaborator

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.

Suggested change
dependencies:
dependencies: [ setup_ip_space , setup_subnet ]

Copy link
Author

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
Copy link
Collaborator

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants