1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-15 18:56:24 +00:00

Add markdown linting support

This commit is contained in:
David Young
2021-10-20 15:25:05 +13:00
committed by GitHub
parent 938d4c7f3b
commit 64a76273c1
127 changed files with 655 additions and 1348 deletions

View File

@@ -16,7 +16,7 @@ The ansible playbooks / roles in premix are intended to automate the deployment
## Details
**Duplication should be avoided**
### Duplication should be avoided
This means that ansible will use the same source files which we use to deploy swarm stacks manually (*i.e., /kanboard/*). This has some implications:
@@ -26,7 +26,7 @@ This means that ansible will use the same source files which we use to deploy sw
In an ansible-based deployment, we **don't** clone the premix repo to /var/data/config. Instead, we clone it somewhere local, and then use the playbook to launch the stack, including the creation of ceph shared storage at /var/data/config. The necessary files are then **copied** from the cloned repo into `/var/data/config`, so that they can be altered by the user, backed up, etc. This separation of code from config makes it easier for users to pull down updates to the premix repo, without having to worry about merge conflicts etc for the files they've manually changed during deployment.
**Configuration should be centralized**
### Configuration should be centralized
What we _don't_ want, is to manually be editing `<recipe>/<recipe>.env` files all over, and tracking changes to all of these. To this end, there's a `config` dictionary defined, which includes a subsection for each recipe. Here's an example:
@@ -43,4 +43,4 @@ config:
AWS_ACCESS_KEY_ID: {{ "{{ vault_config.traefik.aws_access_key_id }}" }}
AWS_SECRET_ACCESS_KEY: {{ "{{ vault_config.traefik.aws_secret_access_key }}" }}
AWS_REGION: ""
```
```

View File

@@ -16,7 +16,7 @@ Now we'll be creating 3 files..
Create a new file at `ansible/hosts.your-username` containing a variation on this:
```
```bash
[your-username:children]
proxmox_servers
proxmox_vms
@@ -62,11 +62,11 @@ bebop ansible_host=192.168.38.203
The variables used in the playbook are defined in the `ansible/group_vars/all/main.yml`. **Your** variables are going to be defined in a group_vars file based on your username, so that they're [treated with a higher preference](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable) than the default values.
Create a folder under `ansible/group_vars/<your-username>` to match the group name you inserted in line \#1 of your hosts file, and copy `ansible/group_vars/all/main.yml` into this folder. Any variables found in this file will override any variables specified in `ansible/group_vars/all/main.yml`, but any variables _not_ found in your file will be inherited from `ansible/group_vars/all/main.yml`.
Create a folder under `ansible/group_vars/<your-username>` to match the group name you inserted in line \#1 of your hosts file, and copy `ansible/group_vars/all/main.yml` into this folder. Any variables found in this file will override any variables specified in `ansible/group_vars/all/main.yml`, but any variables _not_ found in your file will be inherited from `ansible/group_vars/all/main.yml`.
To further streamline config, a "empty" dictionary variable named `recipe_config` is configured in `ansible/group_vars/all/main.yml`. In your own vars file (`ansible/group_vars/<your-username>/main.yml`), populate this variable with your own preferred values, copied from `recipe_default_config`. When the playbook runs, your values will be combined with the default values.
!!! tip "Commit `ansible/group_vars/<your-username>/` to your own repo"
!!! tip "Commit `ansible/group_vars/<your-username>/` to your own repo"
For extra geek-fu, you could commit the contents of ``ansible/group_vars/<your-username>/` to your own repo, so that you can version/track your own config!
### Secrets
@@ -79,19 +79,19 @@ Enter [Ansible Vault](https://docs.ansible.com/ansible/latest/user_guide/vault.h
Create a password file, containing a vault password (*just generate one yourself*), and store it _outside_ of the repo:
```
```bash
echo mysecretpassword > ~/.ansible/vault-password-geek-cookbook-premix
```
Create an ansible-vault encrypted file in the `group_vars/<your-username>/vault.yml` using this password file:
```
```bash
ansible-vault create --vault-id geek-cookbook-premix vars/vault.yml
```
Insert your secret values into this file (*refer to `group_vars/all/01_fake_vault.yml` for placeholders*), using a prefix of `vault_`, like this:
```
```bash
vault_proxmox_host_password: mysekritpassword
```
@@ -100,7 +100,7 @@ vault_proxmox_host_password: mysekritpassword
The vault file is encrypted using a secret you store outside the repo, and now you can safely check in and version `group_vars/<your-username>/vault.yml` without worrying about exposing secrets in cleartext!
!!! tip "Editing ansible-vault files with VSCode"
If you prefer to edit your vault file using VSCode (*with all its YAML syntax checking*) to nasty-ol' CLI editors, you can set your EDITOR ENV variable by running ` export EDITOR="code --wait"`.
If you prefer to edit your vault file using VSCode (*with all its YAML syntax checking*) to nasty-ol' CLI editors, you can set your EDITOR ENV variable by running `export EDITOR="code --wait"`.
## Serving
@@ -114,13 +114,13 @@ To run the playbook selectively (i.e., maybe just deploy traefik), add the name
I.e., to deploy only ceph:
```
```bash
ansible-playbook -i hosts.your-username deploy.yml -t ceph
```
To deploy traefik (overlay), traefikv1, and traefik-forward-auth:
```
```bash
ansible-playbook -i hosts.your-username deploy.yml -t traefik,traefikv1,traefik-forward-auth
```
@@ -130,7 +130,7 @@ Deploying on full autopilot above installs _a lot_ of stuff (and more is being a
To deploy the base infrastructure:
```
```bash
ansible-playbook -i hosts.your-username deploy.yml -t infrastructure
```
@@ -139,6 +139,3 @@ This will run the playbook up through the `traefik-forward-auth` role and leave
### Deploy (with debugging)
If something went wrong, append `-vv` to your deploy command, for extra-verbose output :thumbsup:

View File

@@ -1,3 +1,5 @@
# Warning
!!! warning "This section is under construction :hammer:"
This section is a serious work-in-progress, and reflects the current development on the [sponsors](https://github.com/sponsors/funkypenguin)'s "premix" repository
So... There may be errors and inaccuracies. Jump into [Discord](http://chat.funkypenguin.co.nz) in the #dev channel if you're encountering issues 😁

View File

@@ -1,3 +1,5 @@
# Warning
!!! warning "This section is under construction :hammer:"
This section is a serious work-in-progress, and reflects the current development on the [sponsors](https://github.com/sponsors/funkypenguin)'s "premix" repository
So... There may be errors and inaccuracies. Jump into [Discord](http://chat.funkypenguin.co.nz) in the #dev channel if you're encountering issues 😁