You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by jh...@apache.org on 2022/08/08 18:49:00 UTC

[trafficcontrol] branch master updated: Ansible Dataset Loader: Filter out ALL CDN before performing CDN snapshots or queueing CDNs (#6975)

This is an automated email from the ASF dual-hosted git repository.

jhg03a pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 743f1d49c0 Ansible Dataset Loader: Filter out ALL CDN before performing CDN snapshots or queueing CDNs (#6975)
743f1d49c0 is described below

commit 743f1d49c0047458b95e6c047363863e8120ec39
Author: Zach Hoffman <zr...@apache.org>
AuthorDate: Mon Aug 8 12:48:55 2022 -0600

    Ansible Dataset Loader: Filter out ALL CDN before performing CDN snapshots or queueing CDNs (#6975)
    
    This is a preventative measure should a CDN name be supplied that is alphabetically before ALL (not the default behavior with MKGA).
---
 .../ansible/roles/dataset_loader/tasks/dataset_loader.yml         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml
index 5827a07b61..d08ca675f1 100644
--- a/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml
+++ b/infrastructure/ansible/roles/dataset_loader/tasks/dataset_loader.yml
@@ -1035,7 +1035,7 @@
   uri:
     url: "{{ dl_to_url }}/api/{{ dl_to_api_version }}/snapshot?cdn={{ item.name }}"
     method: PUT
-  with_items: "{{ get_all_cdns.json.response[1:] }}"
+  with_items: "{{ get_all_cdns.json | json_query(no_all_cdn_query) }}"
   register: snapshot_out
   failed_when: (snapshot_out.status == 400 and snapshot_out.json | to_json | from_json | json_query(error_query) | length != 0) or (snapshot_out.status > 400 and snapshot_out.status < 600)
   no_log: true
@@ -1043,6 +1043,8 @@
   delay: 10
   vars:
     error_query: "alerts[?level=='error'].text[?!contains(@,'already exists')]"
+    all_cdn: ALL
+    no_all_cdn_query: "response[?name != `{{ all_cdn }}`]"
 
 - name: Queue Caches in all CDNs
   uri:
@@ -1050,7 +1052,7 @@
     method: POST
     body:
       action: "queue"
-  with_items: "{{ get_all_cdns.json.response[1:] }}"
+  with_items: "{{ get_all_cdns.json | json_query(no_all_cdn_query) }}"
   register: queue_out
   failed_when: (queue_out.status == 400 and queue_out.json | to_json | from_json | json_query(error_query) | length != 0) or (queue_out.status > 400 and queue_out.status < 600)
   no_log: true
@@ -1058,3 +1060,5 @@
   delay: 10
   vars:
     error_query: "alerts[?level=='error'].text[?!contains(@,'action must be')]"
+    all_cdn: ALL
+    no_all_cdn_query: "response[?name != `{{ all_cdn }}`]"