talas-group/04_INFRA_DEPLOIEMENT/Ansible/roles/postgres-explain-visualizer/tasks/check_install.yml
senke 66471934af Initial commit: Talas Group project management & documentation
Knowledge base of ~80+ markdown files across 14 domains (00-13),
Logseq graph, hardware design files (KiCAD), infrastructure configs,
and talas-wiki static site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 20:10:41 +02:00

45 lines
1.2 KiB
YAML

---
# file: roles/postgres-explain-visualizer/tasks/release_check.yml
- name: "check if /opt/pev exists"
stat:
path: /opt/pev
register: pev_install_dir
check_mode: no
- name: "check pev version"
slurp:
src: /opt/pev/VERSION
register: pev_current_version
changed_when: false
check_mode: no
when: pev_install_dir.stat.exists
- name: "decode pev_current_version"
set_fact:
pev_current_version: "{{ pev_current_version.content | b64decode }}"
changed_when: false
check_mode: no
when: pev_install_dir.stat.exists
- name: "get the latest version from github"
uri:
url: https://api.github.com/repos/dalibo/explain.dalibo.com/tags
return_content: true
check_mode: false
register: pev_github_release_version
delegate_to: localhost
become: false
run_once: yes
- name: "set fact pev_needed_version"
set_fact:
pev_needed_version: "{{ pev_github_release_version.json | json_query('[0].name') }}"
when: pev_github_release_version.json is defined
- name: "do we need to update?"
debug:
msg: "Update needed for pev, from {{ pev_current_version }} to {{ pev_needed_version }} (use: --extra-vars pev_update_now=true)"
when:
- pev_install_dir.stat.exists
- pev_current_version != pev_needed_version