forked from cerc-io/testnet-ops
86 lines
3.5 KiB
YAML
86 lines
3.5 KiB
YAML
|
- name: Setup go-nitro on host
|
||
|
hosts: "{{ target_host }}"
|
||
|
|
||
|
vars_files:
|
||
|
- vars.yml
|
||
|
|
||
|
environment:
|
||
|
PATH: "{{ ansible_env.PATH }}:/home/{{ansible_user}}/bin"
|
||
|
|
||
|
tasks:
|
||
|
- name: Clone go-nitro stack repo
|
||
|
command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: Clone repositories required for nitro-stack
|
||
|
command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node setup-repositories --git-ssh --pull
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: Build containers
|
||
|
command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild
|
||
|
when: not skip_container_build
|
||
|
|
||
|
- name: Copy over spec file for L1 alice
|
||
|
template:
|
||
|
src: "./templates/specs/l1-alice-spec.yml.j2"
|
||
|
dest: "{{ nitro_directory }}/l1alice-nitro-spec.yml"
|
||
|
|
||
|
- name: Copy over spec file for L1 charlie
|
||
|
template:
|
||
|
src: "./templates/specs/l1-charlie-spec.yml.j2"
|
||
|
dest: "{{ nitro_directory }}/l1charlie-nitro-spec.yml"
|
||
|
|
||
|
- name: Copy over spec file for L2 alice
|
||
|
template:
|
||
|
src: "./templates/specs/l2-alice-spec.yml.j2"
|
||
|
dest: "{{ nitro_directory }}/l2alice-nitro-spec.yml"
|
||
|
|
||
|
- name: Copy over spec file for L2 charlie
|
||
|
template:
|
||
|
src: "./templates/specs/l2-charlie-spec.yml.j2"
|
||
|
dest: "{{ nitro_directory }}/l2charlie-nitro-spec.yml"
|
||
|
|
||
|
- name: Check if deployment exists for Alice's L1 nitro node
|
||
|
stat:
|
||
|
path: "{{ nitro_directory }}/l1alice-nitro-deployment"
|
||
|
register: l1alice_deployment
|
||
|
|
||
|
- name: Create a deployment for Alice's L1 nitro node
|
||
|
command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l1alice-nitro-spec.yml --deployment-dir l1alice-nitro-deployment
|
||
|
args:
|
||
|
chdir: "{{ nitro_directory }}"
|
||
|
when: not l1alice_deployment.stat.exists
|
||
|
|
||
|
- name: Check if deployment exists for Charlie's L1 nitro node
|
||
|
stat:
|
||
|
path: "{{ nitro_directory }}/l1charlie-nitro-deployment"
|
||
|
register: l1charlie_deployment
|
||
|
|
||
|
- name: Create a deployment for Charlie's L1 nitro node
|
||
|
command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l1charlie-nitro-spec.yml --deployment-dir l1charlie-nitro-deployment
|
||
|
args:
|
||
|
chdir: "{{ nitro_directory }}"
|
||
|
when: not l1charlie_deployment.stat.exists
|
||
|
|
||
|
- name: Check if deployment exists for Alice's L2 nitro node
|
||
|
stat:
|
||
|
path: "{{ nitro_directory }}/l2alice-nitro-deployment"
|
||
|
register: l2alice_deployment
|
||
|
|
||
|
- name: Create a deployment for Alice's L2 nitro node
|
||
|
command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l2alice-nitro-spec.yml --deployment-dir l2alice-nitro-deployment
|
||
|
args:
|
||
|
chdir: "{{ nitro_directory }}"
|
||
|
when: not l2alice_deployment.stat.exists
|
||
|
|
||
|
- name: Check if deployment exists for Charlie's L2 nitro node
|
||
|
stat:
|
||
|
path: "{{ nitro_directory }}/l2charlie-nitro-deployment"
|
||
|
register: l2charlie_deployment
|
||
|
|
||
|
- name: Create a deployment for Charlie's L2 nitro node
|
||
|
command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node deploy create --spec-file l2charlie-nitro-spec.yml --deployment-dir l2charlie-nitro-deployment
|
||
|
args:
|
||
|
chdir: "{{ nitro_directory }}"
|
||
|
when: not l2charlie_deployment.stat.exists
|