https://github.com/brantem/wakwaw
https://github.com/brantem/wakwaw
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brantem/wakwaw
- Owner: brantem
- Created: 2024-06-17T07:29:18.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-06-25T16:10:54.000Z (11 months ago)
- Last Synced: 2025-01-27T07:30:16.724Z (4 months ago)
- Language: Go
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wakwaw
### Prerequisites
- [OpenTofu](https://opentofu.org/docs/intro/install/)
- [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
- [DigitalOcean Personal Access Token](https://docs.digitalocean.com/reference/api/create-personal-access-token/)
- Permissions: `create`, `read`, `update`, and `delete` for droplet, firewall, ssh_key, and vpc.
- [Cloudflare Global API Key](https://developers.cloudflare.com/fundamentals/api/get-started/keys/#view-your-global-api-key)### Setup
1. Create a `terraform.tfvars` file in the `tofu` directory.
- Required: `do_token` (DigitalOcean Personal Access Token) & `region` (choose the region closest to you).
2. Copy the example environment file and update it:
```sh
cp swarm/.env.example swarm/.env
```- Required: `DOMAIN` (your domain), `ACME_EMAIL` (your email), `CF_API_EMAIL` (Cloudflare Global API email), and `CF_API_KEY` (Cloudflare Global API key).
- To generate an encrypted password, run:```sh
htpasswd -nb -B USERNAME PASSWORD
```- The output will be in the format: `USERNAME:ENCRYPTED_PASSWORD`.
3. Apply the Terraform configuration:
```sh
tofu -chdir=tofu apply
```4. Set the correct permissions for your SSH key:
```sh
chmod 600 id_rsa
```5. Run the Ansible playbook:
```sh
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook ansible/main.yml -i hosts --private-key id_rsa
```- If you encounter the error `Error connecting: Error while fetching server API version: Not supported URL scheme http+docker`, run:
```sh
ansible-galaxy collection install community.docker --upgrade
```### Update
1. Apply the Terraform configuration:
```sh
tofu -chdir=tofu apply
```2. Run the Ansible playbook:
```sh
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook ansible/main.yml -i hosts --private-key id_rsa
```#### If you only want to deploy
```sh
ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook ansible/deploy.yml -i hosts --private-key id_rsa -e "stack_name=NAME"
```### Destroy
1. Destroy the Terraform-managed infrastructure:
```sh
tofu -chdir=tofu destroy
```### Available services
| Name | URL | UI | Auth |
| ---------- | ------------------------------------- | --- | -------------------------------------------------------------------- |
| traefik | https://traefik.example.com | yes | `username: TRAEFIK_USERNAME`
`password: TRAEFIK_PASSWORD` |
| portainer | https://wakwaw.example.com/portainer | yes | `username: admin`
`password: PORTAINER_PASSWORD` |
| minio | https://wakwaw.example.com/minio/ | yes | `username: MINIO_USERNAME`
`password: MINIO_PASSWORD` |
| grafana | https://wakwaw.example.com/grafana | yes | `username: GRAFANA_USERNAME`
`password: GRAFANA_PASSWORD` |
| prometheus | https://wakwaw.example.com/prometheus | yes | `username: PROMETHEUS_USERNAME`
`password: PROMETHEUS_PASSWORD` |