Make yq installation OS agnostic

This commit is contained in:
Prathamesh Musale 2025-06-19 11:27:06 +05:30
parent 4a75025e23
commit 05ef8b48bf
2 changed files with 7 additions and 3 deletions

View File

@ -32,7 +32,6 @@
- [ansible](playbooks/README.md#ansible-installation)
## Stop SAPO testnet node
- Run the following steps in machine where your SAPO testnet validator node is already running (machine 1)

View File

@ -11,9 +11,14 @@
path: "{{ ansible_env.HOME }}/.laconic-tools/yq"
register: yq_file
- name: Detect OS and architecture
set_fact:
yq_os: "{{ 'darwin' if ansible_system == 'Darwin' else 'linux' }}"
yq_arch: "{{ ansible_architecture | regex_replace('x86_64', 'amd64') | regex_replace('aarch64', 'arm64') }}"
- name: Download yq to user's tools directory
shell: |
curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o {{ ansible_env.HOME }}/.laconic-tools/yq
curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_{{ yq_os }}_{{ yq_arch }} -o {{ ansible_env.HOME }}/.laconic-tools/yq
chmod +x {{ ansible_env.HOME }}/.laconic-tools/yq
when: not yq_file.stat.exists
args: