2020-09-10 18:58:06 +02:00
## Configuration
1. Install Ansible on your machine (`pacman -S ansible`).
2. You should have an account with sudoers rights on the target.
3. Add an host to your `~/.ssh/config` to simplify the login process:
```
Host aperture-labs
HostName v5.planet-casio.com
User < username >
```
## Use a role
Usually, it looks like this:
```
# Dummy try with --check
2020-09-10 21:56:13 +02:00
ansible-playbook -i inventory/main.yml role.yml -vv --diff --check --ask-become-pass
2020-09-10 18:58:06 +02:00
# Real try
2020-09-10 21:56:13 +02:00
ansible-playbook -i inventory/main.yml role.yml -v --ask-become-pass
2020-09-10 18:58:06 +02:00
```
2020-09-10 21:56:13 +02:00
The file `inventory/main.yml` already contains an host: the main VPS, `aperture-labs` .
2020-09-10 18:58:06 +02:00
See [Configuration ](#Configuration ) to add the host to your SSH config.
2020-09-10 21:56:13 +02:00
## Variables
2020-09-10 18:58:06 +02:00
2020-09-10 21:56:13 +02:00
Variables are defined in `inventory/host_vars/aperture-labs.yml` .
They can be overriden, see [the documentation ](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable ).
2020-09-10 18:58:06 +02:00
2020-09-10 21:56:13 +02:00
They may be mandatory for execution of roles.
2020-09-10 18:58:06 +02:00
2020-09-10 21:56:13 +02:00
| Variable name | Comment |
|------------------|----------------------------------------------|
| sites_enabled | List of sites to enable from sites-available |
| proxy_ports | List of ports to use with proxy_pass |
| allowed_users | List of users allowed to login through SSH |