README.md 1.74 KB
Newer Older
Robert Pilstål's avatar
Robert Pilstål committed
1
# Setup example for site with single or multiple webservers, an optional load balancer and a database.
Johan Jatko's avatar
Johan Jatko committed
2 3

 - Needs ansible version 2.8 or higher.
Robert Pilstål's avatar
Robert Pilstål committed
4 5 6

## Usage

7 8
### App deployment demo

Robert Pilstål's avatar
Robert Pilstål committed
9 10 11 12 13 14
- First edit path to your local (bare) repository with your application in `roles/app/defaults/main.yaml`. If you have yours online (which you should) you can edit the `app` role to mimic the deployment procedure used in Johan's original.
- Make sure that you have ssh-keys setup both locally, and in `dust` dash
  - https://wiki.archlinux.org/index.php/SSH_keys#Generating_an_SSH_key_pair
  - https://wiki.archlinux.org/index.php/OpenSSH#Client_usage
  - https://dust.ludd.ltu.se/cloud/public-key
- Then boot a VM at http://dust.ludd.ltu.se ; noting the port for `ssh` access.
15
- Edit `hosts` to reflect the port, and your login-name on `dust`. Set the host under `app` group.
Robert Pilstål's avatar
Robert Pilstål committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

Afterh those steps, you should be able to fully configure your host with;

```sh
ansible-playbook -i hosts site.yaml
```

Once finished, you can use `ssh` to forward the remote `node` port to your local workstation, ex.;

```sh
REMOTE_NODE_PORT=4000;
LOCAL_NODE_PORT=${REMOTE_NODE_PORT};
DUST_SSH_PORT=25000;
DUST_USER_NAME=robpil;
DUST_IP=130.240.207.20;
ssh -p ${DUST_SSH_PORT} -L ${LOCAL_NODE_PORT}:localhost:${REMOTE_NODE_PORT}  ${DUST_USER_NAME}@${DUST_IP};
```

In the above example, then surf to http://localhost:4000 to enjoy your app.
35 36 37 38 39 40 41 42 43

### `systemd-nspawn` verdaccio deployment example
Set your host under the `nspawn` group in `hosts` file. Then run

```sh
ansible-playbook -i hosts site.yaml --tags nspawn
```

After it has finished, you can forward the `4873` port from the remote using the `m7011e_demo_port_forwards.sh` script, and access your `verdaccio` service at [http://localhost:4873](http://localhost:4873)