diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..788482a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hosts.ini diff --git a/README.md b/README.md index c29e4fe..01c977b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - Set Locale Encoding to `UTF-8` - Ansible requires the locale encoding to be `UTF-8`. You can either use the `LANG` prefix when running Ansible commands or set the system-wide locale. + Ansible requires the locale encoding to be `UTF-8`. You can either use the `LANG` prefix when running Ansible commands or set the system-wide locale - Option 1: Use `LANG` Prefix in Commands @@ -32,12 +32,51 @@ LANG="en_US.UTF-8" ``` - - Reboot your system or log out and log back in to apply the changes. + - Reboot your system or log out and log back in to apply the changes - Reference: +## Setup Remote Hosts + +To run the playbook on a remote machine, setup the required ansible inventory: + +- Create a new `hosts.ini` file: + + ```bash + cp example-hosts.ini hosts.ini + ``` + +- Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine: + + ```bash + [] + ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' + ``` + + - Replace `` with the appropriate host group for the deployment + - Replace `` with the alias of your choice + - Replace `` with the IP address or hostname of the target machine + - Replace `` with the SSH username (e.g., dev, ubuntu) + +- Verify that you are able to connect to the host using the following command + + ```bash + ansible all -m ping -i hosts.ini -k + + # Expected output: + + # | SUCCESS => { + # "ansible_facts": { + # "discovered_interpreter_python": "/usr/bin/python3.10" + # }, + # "changed": false, + # "ping": "pong" + # } + ``` + ## Playbooks - [l2-setup](./l2-setup/README.md) - [nitro-node-setup](./nitro-nodes-setup/README.md) - [nitro-bridge-setup](./nitro-bridge-setup/README.md) +- [nitro-contracts-setup](./nitro-contracts-setup/) diff --git a/example-hosts.ini b/example-hosts.ini index da832ab..05fd65c 100644 --- a/example-hosts.ini +++ b/example-hosts.ini @@ -1,2 +1,2 @@ -[nitro_host] - ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' \ No newline at end of file +[deployment_host] + ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' \ No newline at end of file diff --git a/l2-setup/README.md b/l2-setup/README.md index f8e7998..b9fe17c 100644 --- a/l2-setup/README.md +++ b/l2-setup/README.md @@ -4,42 +4,13 @@ To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine -## Setup Remote Hosts +## Setup for Remote Host -To run the playbook on a remote machine, follow these steps: +To run the playbook on a remote host: -- In the [`l2-setup`](./) directory, create a new file named hosts.ini: +- Follow steps from [setup remote hosts](../README.md#setup-remote-hosts) - ```bash - cp ../example-hosts.ini hosts.ini - ``` - -- Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine - - ```bash - [nitro_host] - ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' - ``` - - - Replace `` with the alias of your choice. - - Replace `` with the IP address or hostname of the target machine. - - Replace `` with the SSH username (e.g., dev, ubuntu). - -- Verify that you are able to connect to the host using the following command - - ```bash - ansible all -m ping -i hosts.ini -k - - # Expected output: - - # | SUCCESS => { - # "ansible_facts": { - # "discovered_interpreter_python": "/usr/bin/python3.10" - # }, - # "changed": false, - # "ping": "pong" - # } - ``` +- Update / append the [`hosts.ini`](../hosts.ini) file for your remote host with `` set as `l2_host` ## Setup and Run Optimism @@ -85,10 +56,10 @@ The following commands have to be executed in [`l2-setup`](./) directory LANG=en_US.utf8 ansible-playbook run-optimism.yml --extra-vars='{ "target_host": "localhost"}' -kK --user $USER ``` - - For remote deployment, provide an inventory and specify the `"target_host": nitro_host` in the `--extra-vars` parameter: + - For remote deployment, provide an inventory and specify the `"target_host": l2_host` in the `--extra-vars` parameter: ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{ "target_host": "nitro_host"}' -kK + LANG=en_US.utf8 ansible-playbook -i ../hosts.ini run-optimism.yml --extra-vars='{ "target_host": "l2_host"}' -kK ``` NOTE: By default, deployments are created in a `out` directory. To change this location, update the `l2_directory` variable in the [setup-vars.yml](./setup-vars.yml) file. @@ -96,7 +67,7 @@ The following commands have to be executed in [`l2-setup`](./) directory - For skipping container build, set `"skip_container_build" : true` in the `--extra-vars` parameter: ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{"target_host" : "nitro_host", "skip_container_build": true}' -kK + LANG=en_US.utf8 ansible-playbook -i ../hosts.ini run-optimism.yml --extra-vars='{"target_host" : "l2_host", "skip_container_build": true}' -kK ``` - To run using existing contracts deployment @@ -106,7 +77,7 @@ The following commands have to be executed in [`l2-setup`](./) directory - Run the ansible playbook with `"existing_contracts_deployment": true` in the `--extra-vars` parameter: ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{"target_host" : "nitro_host", "existing_contracts_deployment": true}' -kK + LANG=en_US.utf8 ansible-playbook -i ../hosts.ini run-optimism.yml --extra-vars='{"target_host" : "l2_host", "existing_contracts_deployment": true}' -kK ``` ## Check Deployment Status diff --git a/nitro-bridge-setup/README.md b/nitro-bridge-setup/README.md index 3b5834c..a1d1193 100644 --- a/nitro-bridge-setup/README.md +++ b/nitro-bridge-setup/README.md @@ -4,42 +4,13 @@ To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine -## Setup Remote Hosts +## Setup for Remote Host -To run the playbook on a remote machine, follow these steps: +To run the playbook on a remote host: -- In the [`nitro-bridge-setup`](./) directory, create a new file named hosts.ini: +- Follow steps from [setup remote hosts](../README.md#setup-remote-hosts) - ```bash - cp ../example-hosts.ini hosts.ini - ``` - -- Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine - - ```bash - [nitro_host] - ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' - ``` - - - Replace `` with the alias of your choice. - - Replace `` with the IP address or hostname of the target machine. - - Replace `` with the SSH username (e.g., dev, ubuntu). - -- Verify that you are able to connect to the host using the following command - - ```bash - ansible all -m ping -i hosts.ini -k - - # Expected output: - - # | SUCCESS => { - # "ansible_facts": { - # "discovered_interpreter_python": "/usr/bin/python3.10" - # }, - # "changed": false, - # "ping": "pong" - # } - ``` +- Update / append the [`hosts.ini`](../hosts.ini) file for your remote host with `` set as `nitro_host` ## Run Nitro Bridge diff --git a/nitro-contracts-setup/README.md b/nitro-contracts-setup/README.md index d9fe612..b3e9dbe 100644 --- a/nitro-contracts-setup/README.md +++ b/nitro-contracts-setup/README.md @@ -4,42 +4,13 @@ To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine -## Setup Remote Hosts +## Setup for Remote Host -To run the playbook on a remote machine, follow these steps: +To run the playbook on a remote host: -- In the [`nitro-contracts-setup`](./) directory, create a new file named hosts.ini: +- Follow steps from [setup remote hosts](../README.md#setup-remote-hosts) - ```bash - cp ../example-hosts.ini hosts.ini - ``` - -- Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine - - ```bash - [nitro_host] - ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' - ``` - - - Replace `` with the alias of your choice. - - Replace `` with the IP address or hostname of the target machine. - - Replace `` with the SSH username (e.g., dev, ubuntu). - -- Verify that you are able to connect to the host using the following command - - ```bash - ansible all -m ping -i hosts.ini -k - - # Expected output: - - # | SUCCESS => { - # "ansible_facts": { - # "discovered_interpreter_python": "/usr/bin/python3.10" - # }, - # "changed": false, - # "ping": "pong" - # } - ``` +- Update / append the [`hosts.ini`](../hosts.ini) file for your remote host with `` set as `nitro_host` ## Deploy Nitro Contracts diff --git a/nitro-nodes-setup/README.md b/nitro-nodes-setup/README.md index 3a908b8..090c1d8 100644 --- a/nitro-nodes-setup/README.md +++ b/nitro-nodes-setup/README.md @@ -4,42 +4,13 @@ To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine -## Setup Remote Hosts +## Setup for Remote Host -To run the playbook on a remote machine, follow these steps: +To run the playbook on a remote host: -- In the [`nitro-nodes-setup`](./) directory, create a new file named hosts.ini: +- Follow steps from [setup remote hosts](../README.md#setup-remote-hosts) - ```bash - cp ../example-hosts.ini hosts.ini - ``` - -- Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine - - ```bash - [nitro_host] - ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' - ``` - - - Replace `` with the alias of your choice. - - Replace `` with the IP address or hostname of the target machine. - - Replace `` with the SSH username (e.g., dev, ubuntu). - -- Verify that you are able to connect to the host using the following command - - ```bash - ansible all -m ping -i hosts.ini -k - - # Expected output: - - # | SUCCESS => { - # "ansible_facts": { - # "discovered_interpreter_python": "/usr/bin/python3.10" - # }, - # "changed": false, - # "ping": "pong" - # } - ``` +- Update / append the [`hosts.ini`](../hosts.ini) file for your remote host with `` set as `nitro_host` ## Run a nitro node