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

DNS Record Support for Bloxone Ansible v2 #46

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

Conversation

Tejashree-RS
Copy link

No description provided.

@Tejashree-RS Tejashree-RS marked this pull request as ready for review December 18, 2024 13:10
@unasra unasra self-requested a review January 3, 2025 11:15
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Show resolved Hide resolved
plugins/modules/dns_record.py Show resolved Hide resolved
tests/integration/targets/dns_a_record/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/dns_a_record/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/dns_a_record/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/dns_a_record_info/tasks/main.yml Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Show resolved Hide resolved
tests/integration/targets/dns_a_record/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/dns_a_record/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/dns_a_record_info/tasks/main.yml Outdated Show resolved Hide resolved
tests/integration/targets/setup_view/tasks/cleanup.yml Outdated Show resolved Hide resolved
description:
- "The DNS resource record type-specific non-protocol options."
- "Valid value for I(A) (Address) and I(AAAA) (IPv6 Address) records:"
- "Option | Description -----------|----------------------------------------- create_ptr | A boolean flag which can be set to I(true) for POST operation to automatically create the corresponding PTR record. check_rmz | A boolean flag which can be set to I(true) for POST operation to check the existence of reverse zone for creating the corresponding PTR record. Only applicable if the I(create_ptr) option is set to I(true)."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Anstibull Docs need to be evaluated here to see how these dashes are presented in the docs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The antsibull-docs generation has a lot of errors as below.

/Users/mathewa/Projects/ansible-doc-site/rst/collections/infoblox/bloxone/dns_record_module.rst:2360: ERROR: Undefined substitution referenced: "--------------".

Of what's generated, this is what it looks like

image

plugins/modules/dns_record_info.py Outdated Show resolved Hide resolved
plugins/modules/dns_record_info.py Outdated Show resolved Hide resolved
plugins/modules/dns_record_info.py Outdated Show resolved Hide resolved
plugins/modules/dns_record_info.py Outdated Show resolved Hide resolved
@unasra
Copy link
Collaborator

unasra commented Jan 13, 2025

LGTM
@mathewab Please have a look !

@unasra unasra requested a review from mathewab January 13, 2025 18:35
@mathewab mathewab changed the title DNS A Record Support for Bloxone Ansible v2 DNS Record Support for Bloxone Ansible v2 Jan 14, 2025
changelogs/fragments/46-a-record.yml Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
plugins/modules/dns_record.py Outdated Show resolved Hide resolved
Comment on lines 509 to 510
else:
update_body = self.validate_readonly_on_update(self.existing, update_body, ["type", "zone"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this to handle some case for the default view?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

changelogs/fragments/46-a-record.yml Outdated Show resolved Hide resolved
raise e
else:
if self.params["zone"] is not None:
filter = f"zone=='{self.params['zone']}' and type=='{self.params['type']}'"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should also contain name_in_zone . Ideally this should contain view and rdata but I understand that there is an issue in the API backend that doesn't allow filtering on those. That can be filtered manually after we get the results.

Copy link
Author

Choose a reason for hiding this comment

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

Modified

if self.params["name_in_zone"] is not None:
filter = f"zone=='{self.params['zone']}' and type=='{self.params['type']}' and name_in_zone=='{self.params['name_in_zone']}'"
else:
filter = f"zone=='{self.params['zone']}' and type=='{self.params['type']}'"

elif self.params["absolute_name_spec"] is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

as commented in the JIRA ticket, we can keep the zone,name_in_zone as the required combination. We can therefore remove absolute_name_spec and view checks from the find function. zone will have to be marked as required

@@ -590,6 +585,9 @@ def main():
argument_spec=module_args,
supports_check_mode=True,
required_if=[("state", "present", ["rdata", "type"])],
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can add zone here, and remove the next three criteria. absolute_name_spec effectively becomes read only, since the API will give an error, but we don't have to mark it as read only in the module for now.

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.

3 participants