Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e - Add step for installing `zstd` in macOS - Use ansible command module for running docker commands Co-authored-by: Shreerang Kale <shreerangkale@gmail.com> Reviewed-on: #30 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
30 lines
967 B
YAML
30 lines
967 B
YAML
---
|
|
# Setup tasks for all playbooks
|
|
- name: Create tools directory in user's home
|
|
file:
|
|
path: "{{ ansible_env.HOME }}/.laconic-tools"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Check if yq exists
|
|
stat:
|
|
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_{{ 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:
|
|
creates: "{{ ansible_env.HOME }}/.laconic-tools/yq"
|
|
|
|
- name: Set yq path variable
|
|
set_fact:
|
|
yq_path: "{{ ansible_env.HOME }}/.laconic-tools/yq"
|