# stack-orchestrator-setup ## Setup Ansible To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine. ## Setup Stack Orchestrator This playbook will install Docker and Stack Orchestrator (laconic-so) on the machine if they aren't already present. Run the following commands in the [`stack-orchestrator-setup`](./) directory. ### On Local Host To setup stack orchestrator and docker locally, execute the `setup-laconic-so.yml` Ansible playbook: ```bash LANG=en_US.utf8 ansible-playbook setup-laconic-so.yml --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: ```ini [deployment_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" # } ``` - Execute the `setup-laconic-so.yml` Ansible playbook for setting up stack orchestrator and docker on a remote machine: ```bash LANG=en_US.utf8 ansible-playbook setup-laconic-so.yml -i hosts.ini --extra-vars='{ "target_host": "deployment_host"}' --user $USER -kK ``` ## Verify Installation - After the installation is complete, verify if `$HOME/bin` is already included in your PATH by running: ```bash echo $PATH | grep -q "$HOME/bin" && echo "$HOME/bin is already in PATH" || echo "$HOME/bin is not in PATH" ``` If the command outputs `"$HOME/bin is not in PATH"`, you'll need to add it to your `PATH`. - To add `$HOME/bin` to your PATH, run the following command: ```bash export PATH="$HOME/bin:$PATH" ``` - To make this change permanent, add the following line to your shell configuration file (`~/.bashrc` or `~/.zshrc`, depending on your shell): ```bash # For bash users echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc source ~/.bashrc # For zsh users echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc source ~/.zshrc ``` - Once the PATH is set, verify the installation by running the following commands: ```bash # Check version of docker docker --version # Check version of docker compose docker compose version # Check version of Stack Orchestrator laconic-so version ```