Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infrastructure/ansible/roles/to_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Requirements

* For snapshot:
* [jq](https://stedolan.github.io/jq/)
* [json_diff](https://json-delta.readthedocs.io/en/latest/)
* [jd](https://github.com/josephburnett/jd)

Role Variables
--------------
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/ansible/roles/to_api/tasks/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

- name: "Perform diff of {{ to_api_target_cdn }} crconfig"
delegate_to: localhost
shell: "json_diff -u {{ precommit_snapshot_file.path }} {{ pending_snapshot_file.path }}"
shell: "jd {{ precommit_snapshot_file.path }} {{ pending_snapshot_file.path }}"
register: diff_output
ignore_errors: True

Expand All @@ -110,14 +110,14 @@
delegate_to: localhost
assert:
that:
- "{{ diff_output.stdout_lines | count }} == 3"
- "{{ diff_output.stdout_lines | count }} == 0"
msg: "There are pending changes to the {{to_api_target_cdn}} crconfig when we expect there to be none. Please rerun with -v or manually review the diff. Aborting."
when: to_api_assert_clean_snapshot

- name: "Writing snapshot ({{ to_api_target_cdn }})"
delegate_to: localhost
uri:
url: "{{ to_api_base_url }}/api/{{ to_api_version }}/snapshot/{{ to_api_target_cdn }}"
url: "{{ to_api_base_url }}/api/{{ to_api_version }}/snapshot?cdn={{ to_api_target_cdn }}"
method: PUT
follow_redirects: all
return_content: yes
Expand Down