-
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
Infra Host and Service Support for Ansible V2 #53
Conversation
#TODO: add tests | ||
# The following require additional plugins to be supported. | ||
# - internal_secondaries | ||
# - nsgs |
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.
incorrect comment?
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/infra_host.py
Outdated
pass # Handled by BloxoneAnsibleModule | ||
|
||
|
||
class HostsModule(BloxoneAnsibleModule): |
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.
nit: should be HostModule? Also, i am thinking if it should be InfraHostModule
, since we also have dns host, dhcp host, etc.
class HostsModule(BloxoneAnsibleModule): | |
class HostModule(BloxoneAnsibleModule): |
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
tags: run | ||
# Create an Ip Space | ||
- name: "Create an IP space" | ||
tags: run |
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 this tag required?
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.
used for testing , now removed.
csp_url: "{{ csp_url }}" | ||
api_key: "{{ api_key }}" | ||
block: | ||
# Create a random View name to avoid conflicts |
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 a random View name to avoid conflicts | |
# Create a random IP Space name to avoid conflicts |
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 file is no longer being modified in this PR
filters: | ||
display_name: "{{ display_name }}+incorrect_name" | ||
retry_if_not_found: true | ||
timeout: "15s" # Timeout is set to 15 seconds |
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.
I think, ansible has support for timeout, and maybe that can be used as well.
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.
There is even support for retries
and until
. Maybe we should use that instead of retry_if_not_found
.
https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html
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.
For Host info , examples for retries and until have been added.
For Service , as discussed , in future we can implement a module particularly for Service's state !
# If no results, set results to empty list | ||
if not resp.results: | ||
resp.results = [] |
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 check is needed for the other endpoints too? Maybe have this in the generator atleast for new code.
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.
For DDI objects , no it's not required as an empty results list is returned when no object is found , hence this issue hasn't come up until now.
Added to the generator
plugins/modules/infra_host_info.py
Outdated
tag_filters: | ||
location: "site-1" | ||
|
||
- name: Get Information after Host is ready using retries and timeout |
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.
nit:
- name: Get Information after Host is ready using retries and timeout | |
- name: Get Host Information with retries |
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
* Initial Commit * added new lines * Resolved Linter issues * fixed examples * added support for infra service * added examples * fixed linter errors * Added Retry and Timeouts to host * Fixed sanity tests * Fixed Lint issues * added wait for state and timeout for service * Updated descriptions * modified infra_host * Updated Descriptions * Removed wait for state and timeouts from service * resolved linter issues * Resolved sanity errors * Addressed review comments
* Initial Commit * added new lines * Resolved Linter issues * fixed examples * added support for infra service * added examples * fixed linter errors * Added Retry and Timeouts to host * Fixed sanity tests * Fixed Lint issues * added wait for state and timeout for service * Updated descriptions * modified infra_host * Updated Descriptions * Removed wait for state and timeouts from service * resolved linter issues * Resolved sanity errors * Addressed review comments
This PR contains :