Prathamesh Musale
cd314d2fdf
Part of [Automate testnet nitro deployments using Ansible](https://www.notion.so/Automate-testnet-nitro-deployments-using-Ansible-0d15579430204b8daba9a8aa31e07568) Add Ansible playbooks to: - Setup Docker if not present - Setup Stack Orchestrator if not present Co-authored-by: Adw8 <adwaitgharpure@gmail.com> Co-authored-by: Neeraj <neeraj.rtly@gmail.com> Reviewed-on: #6 Co-authored-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to> Co-committed-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
- name: Install Docker if it isn't present
|
|
import_playbook: setup-docker.yml
|
|
|
|
- name: Set up Stack Orchestrator
|
|
hosts: "{{ target_host }}"
|
|
|
|
vars:
|
|
target_host: "localhost"
|
|
|
|
environment:
|
|
PATH: "{{ ansible_env.PATH }}:/home/{{ansible_user}}/bin"
|
|
|
|
tasks:
|
|
- 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
|
|
|
|
- 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'
|