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

Add new module azure_rm_afdrules to support Azure Frontdoor Standard and Premium #1604

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

jartoo
Copy link
Contributor

@jartoo jartoo commented Jun 18, 2024

SUMMARY

This module manages Frontdoor Rules for the Standard and Premium services. I propose building this as a separate module in lieu of complicating the azure_cdn_profile module so as to make the management of each of the elements easier. Azure Frontdoor is quite complex, so matching the modules with the Python SDK APIs seems to be the prudent design choice.

Continues to work on #1041 This does not complete this issue, yet.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

Module: azure_rm_afdrules

ADDITIONAL INFORMATION

Provides the ability to manage Rules, per the Python SDK here: https://learn.microsoft.com/en-us/python/api/azure-mgmt-cdn/azure.mgmt.cdn.operations.rulesoperations?view=azure-python

Integration Tests: passed
Sanity Tests: passed


@Fred-sun
Copy link
Collaborator

@jartoo self.actions and conditions, if not configured in the playbook, this parameter is None, so before comparing, please make sure that this value is not None, thank you!

@Fred-sun
Copy link
Collaborator

@jartoo plugins/module_utils/azure_rm_common_ext.py has a function 'default_compare' for comparison, For example, self.default_compare({}, new_parameters, old_parameters, '', dict(compare=[])), You can take a try! Thank you very much!

@Fred-sun Fred-sun added question Further information is requested medium_priority Medium priority work in In trying to solve, or in working with contributors labels Jun 27, 2024
@jartoo
Copy link
Contributor Author

jartoo commented Jun 28, 2024

Will take a look at this...thanks!

@jartoo
Copy link
Contributor Author

jartoo commented Jun 28, 2024

Using idempotent_check() would work if the structures are identical. The problem with using that function in this case is that each Action and Condition type_name changes the variables that are used. I also do not force the user of the module to declare the type_name for each and hard code that in based on the name of the Action and Condition to simplify usage. Because the structures of the dict is therefore different, I am not sure I can use that function as the query from the Python SDK returns a structure that is actually a subset of all the possible parameters. But this did open my eyes to the AzureRMModuleBaseExt class and some of the options you have built in there. Please correct me if I am misunderstanding the use case applicability here. I will work on checking for None however, and resubmit with those changes shortly. Thanks!

@jartoo
Copy link
Contributor Author

jartoo commented Jun 28, 2024

The structure is also slightly different, where I flattened the parameters section to reduce the hierarchy complexity...

@Fred-sun
Copy link
Collaborator

Fred-sun commented Jul 8, 2024

@jartoo You seem to have restored the changes of the dev branch, please check this PR again, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium_priority Medium priority question Further information is requested work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants