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_afdorigingroup to support Azure Frontdoor Standard and Premium #1590

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

Conversation

jartoo
Copy link
Contributor

@jartoo jartoo commented Jun 6, 2024

SUMMARY

This module manages Frontdoor Origin Groups 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 to manage. 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_afdorigingroup

ADDITIONAL INFORMATION

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


@Fred-sun
Copy link
Collaborator

Fred-sun commented Jun 7, 2024

ERROR: plugins/modules/azure_rm_afdorigingroup.py:20:161: E501: line too long (273 > 160 characters)
ERROR: plugins/modules/azure_rm_afdorigingroup.py:131:161: E501: line too long (170 > 160 characters)
ERROR: plugins/modules/azure_rm_afdorigingroup.py:145:43: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:145:45: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:146:26: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:146:28: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:149:34: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:149:36: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:150:19: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:150:21: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:151:23: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:151:25: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:152:27: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:152:29: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:154:20: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:154:22: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:156:36: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:156:38: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:157:71: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:157:73: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:178:55: E231: missing whitespace after ','
ERROR: plugins/modules/azure_rm_afdorigingroup.py:179:51: E231: missing whitespace after ','
ERROR: plugins/modules/azure_rm_afdorigingroup.py:227:49: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:228:49: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:263:161: E501: line too long (176 > 160 characters)
ERROR: plugins/modules/azure_rm_afdorigingroup.py:267:161: E501: line too long (186 > 160 characters)
ERROR: plugins/modules/azure_rm_afdorigingroup.py:269:161: E501: line too long (207 > 160 characters)
ERROR: plugins/modules/azure_rm_afdorigingroup.py:273:1: W293: blank line contains whitespace
ERROR: plugins/modules/azure_rm_afdorigingroup.py:307:24: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:307:26: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:308:40: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:308:42: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:309:47: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:309:49: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:326:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:327:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:328:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:344:24: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:344:26: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:345:40: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:345:42: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:346:47: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:346:49: E251: unexpected spaces around keyword / parameter equals
ERROR: plugins/modules/azure_rm_afdorigingroup.py:360:1: W293: blank line contains whitespace
ERROR: plugins/modules/azure_rm_afdorigingroup.py:363:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:364:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:365:17: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:409:56: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:410:56: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_afdorigingroup.py:418:1: E305: expected 2 blank lines after class or function definition, found 1

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

Please fix the sanity error!

plugins/modules/azure_rm_afdorigingroup.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup_info.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup.py Outdated Show resolved Hide resolved
@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 7, 2024
@jartoo
Copy link
Contributor Author

jartoo commented Jun 7, 2024

Again, sorry about not knowing to run the Sanity Checks...thanks!

Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

small change request!

plugins/modules/azure_rm_afdorigingroup.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Fred-sun Fred-sun left a comment

Choose a reason for hiding this comment

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

small change request!

plugins/modules/azure_rm_afdorigingroup.py Outdated Show resolved Hide resolved
plugins/modules/azure_rm_afdorigingroup.py Outdated Show resolved Hide resolved
@Fred-sun
Copy link
Collaborator

@xuzhang3 This PR relies on #1588, Please merge #1588 at first!Thanks!

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged new_module_pr Add new modules and removed work in In trying to solve, or in working with contributors labels Jun 28, 2024
@xuzhang3 xuzhang3 changed the title Add new module azure_rm_afdorigingroup to support Azure Frontdoor Standard and Premium Add new module azure_rm_afdorigingroup to support Azure Frontdoor Standard and Premium Jul 1, 2024
@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jul 1, 2024

@jartoo can you help resolve the file conflict.

@jartoo
Copy link
Contributor Author

jartoo commented Jul 2, 2024

I merged the upstream changes, but feel this may be an issue with the other modules as they all are making changes to the pipeline and runtime yml files in the same place..haha..

@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jul 3, 2024

If other PRs changed these files, this may affect them, otherwise it's fine.. Changes the runtime.yml to v.215 as v2.14 has been EOL (https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix)

@xuzhang3
Copy link
Collaborator

xuzhang3 commented Jul 3, 2024

test failed

TASK [azure_rm_afdorigingroup : Create Standard Frontdoor Profile] *************

Including module_utils file ansible_collections/azure/azcollection/plugins/__init__.py
Including module_utils file ansible_collections/azure/azcollection/plugins/module_utils/__init__.py
Using module file /home/cloudtest/.ansible/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnprofile.py
Pipelining is enabled.
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: cloudtest
<testhost> EXEC /bin/sh -c 'AZURE_CLIENT_ID=*** AZURE_MANAGED_BY_TENANT_ID=*** AZURE_PRINCIPAL_ID=*** AZURE_ROLE_DEFINITION_ID=*** AZURE_SECRET='"'"'***'"'"' AZURE_SUBSCRIPTION_ID=*** AZURE_SUBSCRIPTION_SEC_ID=*** AZURE_TENANT=*** RESOURCE_GROUP=ansibletest-5edfa200-890a-4913-8f88-5a7293781860 RESOURCE_GROUP_DATALAKE=ansibletest-6b787ba4-45b4-4277-a38d-ca7d1fb6b2eb RESOURCE_GROUP_SECONDARY=ansibletest2-0a4dc91a-9495-4ce5-962a-4ef702f762be /home/cloudtest/ansible-venv/bin/python && sleep 0'
fatal: [testhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "ad_user": null,
            "adfs_authority_url": null,
            "api_profile": "latest",
            "append_tags": true,
            "auth_source": "auto",
            "cert_validation_mode": null,
            "client_id": null,
            "cloud_environment": "AzureCloud",
            "disable_instance_discovery": false,
            "location": "Global",
            "log_mode": null,
            "log_path": null,
            "name": "prof-c5f561237",
            "password": null,
            "profile": null,
            "resource_group": "ansibletest-5edfa200-890a-4913-8f88-5a7293781860",
            "secret": null,
            "sku": "standard_azurefrontdoor",
            "state": "present",
            "subscription_id": null,
            "tags": null,
            "tenant": null,
            "thumbprint": null,
            "x509_certificate_path": null
        }
    },
    "msg": "value of sku must be one of: standard_verizon, premium_verizon, custom_verizon, standard_akamai, standard_chinacdn, standard_microsoft, got: standard_azurefrontdoor"
}

@jartoo
Copy link
Contributor Author

jartoo commented Jul 5, 2024

I think the learning for me in the future is to keep all of the modules together in a single Pull Request as there are some cross dependendices between then. Good learning. I will update this pull request with the recently merged cdn and endpoint module changes then update to incorporate those... 😊

@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!

@Fred-sun Fred-sun added work in In trying to solve, or in working with contributors and removed ready_for_review The PR has been modified and can be reviewed and merged labels Jul 8, 2024
@Fred-sun
Copy link
Collaborator

@jartoo Several PRS have been retained for some time. If you do not have time, could you authorize me to maintain these PRS together? 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 new_module_pr Add new modules 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.

3 participants