Remove steps to execute playbooks locally

This commit is contained in:
Adw8
2024-10-22 15:36:46 +05:30
parent 6b49d1878f
commit 2ac535b175
7 changed files with 31 additions and 83 deletions
+8 -24
View File
@@ -1,8 +1,10 @@
# nitro-contracts-setup
## Setup Ansible
## Prerequisites
To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine
- Setup Ansible: To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine.
- Setup user: Follow steps from [Setup a user](../user-setup/README.md#setup-a-user) to setup a new user with passwordless sudo
## Setup
@@ -34,33 +36,13 @@ The following commands have to be executed in the [`nitro-contracts-setup`](./)
## Deploy Contracts
### On Local Host
- To deploy nitro contracts locally, execute the `deploy-contracts.yml` Ansible playbook:
```bash
LANG=en_US.utf8 ansible-playbook deploy-contracts.yml --extra-vars='{ "target_host": "localhost"}' --user $USER -kK
```
NOTE: By default, deployments are created in an `out` directory. To change this location, update the `nitro_directory` variable in the [setup-vars.yml](./setup-vars.yml) file
- For skipping container build, set `"skip_container_build" : true` in the `--extra-vars` parameter:
```bash
LANG=en_US.utf8 ansible-playbook deploy-contracts.yml --extra-vars='{"target_host" : "localhost", "skip_container_build": true}' --user $USER -kK
```
### On Remote Host
To run the playbook on a remote host:
- Create a new `hosts.ini` file:
```bash
cp ../hosts.example.ini hosts.ini
```
- Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine:
- Edit the [`hosts.ini`](./hosts.ini) file:
```ini
[<deployment_host>]
@@ -88,12 +70,14 @@ To run the playbook on a remote host:
# }
```
- Execute the `deploy-contracts.yml` Ansible playbook for remote deployment:
- Execute the `deploy-contracts.yml` Ansible playbook to deploy nitro contracts:
```bash
LANG=en_US.utf8 ansible-playbook -i hosts.ini deploy-contracts.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK
```
NOTE: By default, deployments are created in an `out` directory. To change this location, update the `nitro_directory` variable in the [setup-vars.yml](./setup-vars.yml) file
- For skipping container build, run with `"skip_container_build" : true` in the `--extra-vars` parameter:
```bash
+1 -1
View File
@@ -1,3 +1,3 @@
target_host: "localhost"
target_host: "nitro_host"
nitro_directory: out
skip_container_build: false