From 6693b42ab716acc3ed08c14ecf1ef80f2471f0f3 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 17 Sep 2024 16:32:23 +0530 Subject: [PATCH 1/4] Add task to install yq --- nitro-nodes-setup/run-nitro-nodes.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nitro-nodes-setup/run-nitro-nodes.yml b/nitro-nodes-setup/run-nitro-nodes.yml index 77245d3..036d940 100644 --- a/nitro-nodes-setup/run-nitro-nodes.yml +++ b/nitro-nodes-setup/run-nitro-nodes.yml @@ -9,6 +9,13 @@ PATH: "{{ ansible_env.PATH }}:/home/{{ansible_user}}/bin" tasks: + - name: Install yq + get_url: + url: https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + dest: /usr/bin/yq + mode: '0755' + become: yes + - name: Create directory for nitro-stack file: path: "{{ nitro_directory }}" -- 2.45.2 From e1afdc917214ff608b3b50e543373bc5d0c8e987 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 17 Sep 2024 16:34:19 +0530 Subject: [PATCH 2/4] Handle prompt when cloning required repositories --- nitro-nodes-setup/run-nitro-nodes.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/nitro-nodes-setup/run-nitro-nodes.yml b/nitro-nodes-setup/run-nitro-nodes.yml index 036d940..d1798c9 100644 --- a/nitro-nodes-setup/run-nitro-nodes.yml +++ b/nitro-nodes-setup/run-nitro-nodes.yml @@ -30,15 +30,23 @@ recurse: yes - name: Clone go-nitro stack repo - command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull + expect: + command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 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 + expect: + command: laconic-so --stack {{ ansible_env.HOME }}/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node setup-repositories --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 ignore_errors: yes - name: Build containers - command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild + command: laconic-so --stack {{ ansible_env.HOME }}/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild when: not skip_container_build - name: Generate spec file for L1 nitro node -- 2.45.2 From f2268b6fda1e7846bef4075aa140b4f552b5cbb3 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 17 Sep 2024 17:27:38 +0530 Subject: [PATCH 3/4] Add task to fetch nitro node config file --- nitro-nodes-setup/run-nitro-nodes.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nitro-nodes-setup/run-nitro-nodes.yml b/nitro-nodes-setup/run-nitro-nodes.yml index d1798c9..648f32e 100644 --- a/nitro-nodes-setup/run-nitro-nodes.yml +++ b/nitro-nodes-setup/run-nitro-nodes.yml @@ -118,3 +118,8 @@ command: laconic-so deployment --dir l2-nitro-deployment start args: chdir: "{{ nitro_directory }}" + + - name: Fetch the nitro-node-config file + get_url: + url: https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/stage2/nitro-node-config.yml + dest: "{{ nitro_directory }}" -- 2.45.2 From aa3c21192ba274caa4f139f355f089ac6e534316 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 17 Sep 2024 18:08:59 +0530 Subject: [PATCH 4/4] Handle git prompts for other playbooks --- l2-setup/run-optimism.yml | 14 +++++++++++--- nitro-bridge-setup/run-nitro-bridge.yml | 20 +++++++++++++------- nitro-contracts-setup/deploy-contracts.yml | 20 +++++++++++++------- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/l2-setup/run-optimism.yml b/l2-setup/run-optimism.yml index 0555a8b..bdbb76e 100644 --- a/l2-setup/run-optimism.yml +++ b/l2-setup/run-optimism.yml @@ -21,14 +21,22 @@ group: "{{ansible_user}}" state: directory recurse: yes - become: yes - name: Clone fixturenet-optimism-stack - command: laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-optimism-stack --pull + expect: + command: laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-optimism-stack --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 ignore_errors: yes - name: Clone required repositories for fixturenet-optimism - command: laconic-so --stack ~/cerc/fixturenet-optimism-stack/stack/fixturenet-optimism setup-repositories --pull + expect: + command: laconic-so --stack {{ ansible_env.HOME }}/cerc/fixturenet-optimism-stack/stack/fixturenet-optimism setup-repositories --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 + ignore_errors: yes - name: Build container images for L2 command: laconic-so --stack ~/cerc/fixturenet-optimism-stack/stack/fixturenet-optimism build-containers --force-rebuild diff --git a/nitro-bridge-setup/run-nitro-bridge.yml b/nitro-bridge-setup/run-nitro-bridge.yml index d9d33b4..4693179 100644 --- a/nitro-bridge-setup/run-nitro-bridge.yml +++ b/nitro-bridge-setup/run-nitro-bridge.yml @@ -13,11 +13,6 @@ file: path: "{{ nitro_directory }}" state: directory - become: yes - - - 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: Change owner of nitro-directory file: @@ -26,10 +21,21 @@ group: "{{ansible_user}}" state: directory recurse: yes - become: yes + + - name: Clone go-nitro stack repo + expect: + command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 + ignore_errors: yes - name: Clone repositories required for nitro-stack - command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories --git-ssh --pull + expect: + command: laconic-so --stack {{ ansible_env.HOME }}/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 ignore_errors: yes - name: Build containers diff --git a/nitro-contracts-setup/deploy-contracts.yml b/nitro-contracts-setup/deploy-contracts.yml index e5c9c29..57a70c1 100644 --- a/nitro-contracts-setup/deploy-contracts.yml +++ b/nitro-contracts-setup/deploy-contracts.yml @@ -13,11 +13,7 @@ file: path: "{{ nitro_directory }}" state: directory - become: yes - - 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: Change owner of nitro-directory file: @@ -26,10 +22,21 @@ group: "{{ansible_user}}" state: directory recurse: yes - become: yes + + - name: Clone go-nitro stack repo + expect: + command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 + ignore_errors: yes - name: Clone repositories required for nitro-stack - command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories --git-ssh --pull + expect: + command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 ignore_errors: yes - name: Build containers @@ -45,7 +52,6 @@ stat: path: "{{ nitro_directory }}/nitro-contracts-deployment" register: nitro_contracts_deployment - become: yes - name: Create a deployment for nitro contracts command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-contracts deploy create --spec-file nitro-contracts-spec.yml --deployment-dir nitro-contracts-deployment -- 2.45.2