add string returns for metrics and properties

This commit is contained in:
2026-03-16 09:17:44 -07:00
parent adb1387693
commit 61421305ed
16 changed files with 524 additions and 390 deletions

34
tasks/purge.yaml Normal file
View File

@ -0,0 +1,34 @@
- name: Cosmostat - Clean up old ws_node image tags
block:
# Grab a list of all tags the image has
- name: Get all ws_node image tags
command: |
docker images --format "{{.Repository}}:{{.Tag}}" \
--filter=reference="ws_node:*"
register: all_tags_raw
changed_when: false
# Turn that raw string into a list of just the tag names
- name: Parse tag names out of the list
set_fact:
all_tags: >-
{{ all_tags_raw.stdout_lines |
map('regex_replace', '^ws_node:', '') |
list }}
# Keep everything *except* the one that ends with “:latest”
- name: Build list of tags that should be removed
set_fact:
tags_to_remove: "{{ all_tags | difference(['latest']) }}"
# Remove each old tag
- name: Delete old ws_node image tags
community.docker.docker_image:
name: ws_node
tag: "{{ item }}"
state: absent
loop: "{{ tags_to_remove }}"
when: tags_to_remove | length > 0
when: tags_to_remove | length > 0
tags:
- cleanup