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

CDN purging is no longer working #1152

Closed
ericfaure007 opened this issue Apr 26, 2023 · 1 comment · Fixed by #1154
Closed

CDN purging is no longer working #1152

ericfaure007 opened this issue Apr 26, 2023 · 1 comment · Fixed by #1154
Labels
bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority

Comments

@ericfaure007
Copy link

SUMMARY

CDN purging is no longer working.
It was working on azure.azcollection lower than 1.15.0.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

azure_rm_cdnendpoint

ANSIBLE VERSION
$ ansible --version
ansible [core 2.14.5]
  config file = None
  configured module search path = ['/home/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/jenkins/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.13 (main, Nov  9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
$ ansible-galaxy collection list azure.azcollection

# /usr/local/lib/python3.9/site-packages/ansible_collections
Collection         Version
------------------ -------
azure.azcollection 1.15.0 
CONFIGURATION
$ ansible-config dump --only-changed
CONFIG_FILE() = /tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg
DEFAULT_KEEP_REMOTE_FILES(/tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg) = False
DEFAULT_REMOTE_USER(/tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg) = ansible
DEFAULT_ROLES_PATH(/tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg) = ['/tmp/workspace/Slot/FE_Pipeline/test/ansible/roles']
NETCONF_SSH_CONFIG(/tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg) = True
PERSISTENT_COMMAND_TIMEOUT(/tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg) = 200
PERSISTENT_CONNECT_TIMEOUT(/tmp/workspace/Slot/FE_Pipeline/test/ansible/ansible.cfg) = 200
OS / ENVIRONMENT

ansible is run from jenkins agent on openshift platform.
Target is Azure CDN, and the playbook run CDN purge.

STEPS TO REPRODUCE

Run the ansible playbook as usual: ansible-playbook -i inventory playbook.yaml

- name: Azure Storage Blob Sync | Purge CDN
  azure_rm_cdnendpoint:
    resource_group: "rg-infra-{{ SUBSCRIPTION_NAME }}"
    name: "{{ cdn_endpoint_name }}"
    profile_name: "{{ cdn_profile_name }}"
    state: present
    purge: true
    purge_content_paths: "/*"
    profile: "{{ SUBSCRIPTION }}"
    origins:
      - name: webui-primary
        host_name: "{{ cdn_origin_hostname }}"
    is_compression_enabled: true
EXPECTED RESULTS

By running this part of the ansible playbook, CDN should be purged.
It should run several minutes, time for the CDN to be purged.

ACTUAL RESULTS

It's running only a few seconds and purge is not happenning.

TASK [azure-storageblob-sync : Azure Storage Blob Sync | Purge CDN] *************************************************************************************************************************************************************************
task path: /tmp/workspace/Slot/FE_Pipeline/test/ansible/roles/azure-storageblob-sync/tasks/main.yml:39
redirecting (type: modules) ansible.builtin.azure_rm_cdnendpoint to azure.azcollection.azure_rm_cdnendpoint
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: 1000560000
<localhost> EXEC /bin/sh -c 'echo ~1000560000 && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/jenkins/.ansible/tmp `"&& mkdir "` echo /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640 `" && echo ansible-tmp-1682509661.4389656-1452-83571301050640="` echo /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.azure_rm_cdnendpoint to azure.azcollection.azure_rm_cdnendpoint
Using module file /usr/local/lib/python3.9/site-packages/ansible_collections/azure/azcollection/plugins/modules/azure_rm_cdnendpoint.py
<localhost> PUT /home/jenkins/.ansible/tmp/ansible-local-1253tp7tie31/tmpfm1a5mhw TO /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640/AnsiballZ_azure_rm_cdnendpoint.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640/ /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640/AnsiballZ_azure_rm_cdnendpoint.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640/AnsiballZ_azure_rm_cdnendpoint.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/jenkins/.ansible/tmp/ansible-tmp-1682509661.4389656-1452-83571301050640/ > /dev/null 2>&1 && sleep 0'
[WARNING]: Azure API profile latest does not define an entry for CdnManagementClient
changed: [localhost] => {
    "changed": true,
    "host_name": "xxxxxxxxxxxxxxxx.azureedge.net",
    "id": "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxx/resourcegroups/rg-infra-rnd/providers/Microsoft.Cdn/profiles/cdn_profile_name/endpoints/cdn_endpoint_name",
    "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",
            "content_types_to_compress": null,
            "is_compression_enabled": true,
            "is_http_allowed": true,
            "is_https_allowed": true,
            "location": null,
            "log_mode": null,
            "log_path": null,
            "name": "cdn_endpoint_name",
            "origin_host_header": null,
            "origin_path": null,
            "origins": [
                {
                    "host_name": "cdn_origin_hostname",
                    "http_port": null,
                    "https_port": null,
                    "name": "webui-primary"
                }
            ],
            "password": null,
            "profile": "rnd",
            "profile_name": "cdn_profile_name",
            "purge": true,
            "purge_content_paths": [
                "/*"
            ],
            "query_string_caching_behavior": "ignore_query_string",
            "resource_group": "rg-infra-rnd",
            "secret": null,
            "started": null,
            "state": "present",
            "subscription_id": null,
            "tags": null,
            "tenant": null,
            "thumbprint": null,
            "x509_certificate_path": null
        }
    }
}
@Fred-sun Fred-sun added bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority labels Apr 27, 2023
@Fred-sun
Copy link
Collaborator

Fixes by #1154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has_pr PR fixes have been made medium_priority Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants