2024-09-09 13:34:05 +00:00
|
|
|
- name: Install Docker if it isn't present
|
|
|
|
import_playbook: setup-docker.yml
|
|
|
|
|
|
|
|
- name: Set up Stack Orchestrator
|
2024-09-10 05:21:24 +00:00
|
|
|
hosts: "{{ target_host }}"
|
|
|
|
|
2024-09-09 13:34:05 +00:00
|
|
|
vars:
|
2024-09-10 05:21:24 +00:00
|
|
|
target_host: "localhost"
|
|
|
|
|
|
|
|
environment:
|
|
|
|
PATH: "{{ ansible_env.PATH }}:/home/{{ansible_user}}/bin"
|
2024-09-09 13:34:05 +00:00
|
|
|
|
|
|
|
tasks:
|
2024-09-10 05:21:24 +00:00
|
|
|
- name: Check if Stack Orchestrator is installed
|
|
|
|
shell: which laconic-so
|
|
|
|
register: is_so_present
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Exit if Stack Orchestrator is present
|
|
|
|
debug:
|
|
|
|
msg: "Stack Orchestrator already on host, ending play"
|
|
|
|
- meta: end_play
|
|
|
|
when: is_so_present.rc == 0
|
|
|
|
|
2024-09-09 13:34:05 +00:00
|
|
|
- name: Install jq
|
|
|
|
apt:
|
|
|
|
name: jq
|
|
|
|
state: present
|
|
|
|
update_cache: yes
|
|
|
|
become: yes
|
|
|
|
|
|
|
|
- name: Ensure that directory ~/bin exists and is writable
|
|
|
|
file:
|
|
|
|
path: "{{ ansible_env.HOME }}/bin"
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
|
|
|
|
- name: Download the laconic-so binary
|
|
|
|
get_url:
|
|
|
|
url: https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/latest/laconic-so
|
|
|
|
dest: "{{ ansible_env.HOME }}/bin/laconic-so"
|
|
|
|
mode: '0755'
|
|
|
|
force: yes
|
|
|
|
|
|
|
|
- name: Ensure ~/.laconic-so directory exists
|
|
|
|
file:
|
|
|
|
path: "{{ ansible_env.HOME }}/.laconic-so"
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
|
|
|
|
- name: Save the distribution url to ~/.laconic-so directory
|
|
|
|
copy:
|
|
|
|
dest: "{{ ansible_env.HOME }}/.laconic-so/config.yml"
|
|
|
|
content: |
|
|
|
|
distribution-url: https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/latest/laconic-so
|
|
|
|
mode: '0644'
|