blob: 5b971b305e37235930bc056b11d9992b639c76c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
This part of the repo is responsible for provisioning our
home-lab services using Ansible on top of the infrastructure already
created via Terraform.
The basic pattern is to confiure the service, and then add the upstream host
to our reverse proxy (Caddy) configuration.

# TODOs (in-progress)
1. reverse-proxy (Caddy) init
1. minio user,bucket init
1. static sites using minio bucket
# Done
1. Adding service to reverse-proxy (Caddy) via api
1. Media Downloader for `*arr` services
1. Torrent server
1. Plex
1. Password Manager
1. Nextcloud
1. Metrics monitoring
---
# Pre-reqs
* `pip`3 - `sudo apt install python3 python3-pip`
* `ansible` - `pip install --user ansible`
# Execution
1. (First Time Only) Fork this repo, if you haven't already.
1. (FTO) Make sure that your [`hosts`](./hosts) have been created in the [Terraform](../terraform) section.
1. (FTO) Edit `group_vars/all/vault.example` to your liking.
```bash
echo "YourSecretPassword" > vaultkey
ansible-vault encrypt --output group_vars/all/vault --encrypt-vault-id vaultkey group_vars/all/vault.example
git checkout group_vars/all/vault.example
```
1. View/edit your encrypted vault:
```bash
ansible-vault view/edit group_vars/all/vault
```
1. (FTO) Run the `init.yaml` playbook with a `limit` and `tag` to install a service
```bash
ansible-playbook playbooks/init.yaml --limit=[app name] --tags=install
```
1. Run the playbook with a `limit` and `tag` to modify a service
```bash
ansible-playbook playbooks/... --limit=[app name] --tags=config
```
# Ansible Roles
You can think of each Role being an "app".
Each Role has a `setup.yaml` task file responsible for installing the app.
It may or may not have other task files (eg. `config.yaml`) depending on what other
functionality this Role supports for this app.
The `main.yaml` file in the Role determines the flow logic for which task files
are getting run based on Tags.
# Artifacts
The directory `playbooks/artifacts/` is a place where we save the output for some of the roles.
This not only serves the purpose to tracking important state info for our configurations,
but it also allows us to use some of this info in other parts of Ansible for cleaner automation.
> Never commit this dir to git. It contains sensitive info! Its already configured to
be ignored by git.
|