Update README
This commit is contained in:
parent
9b9a0e5545
commit
49bb55087d
1 changed files with 12 additions and 18 deletions
30
README.md
30
README.md
|
@ -1,15 +1,15 @@
|
||||||
# vps
|
# vps
|
||||||
|
|
||||||
This repository contains all the files I use to manage services hosted on [viyurz.fr](https://viyurz.fr).
|
This repository contains all the files I use to manage my services hosted on [viyurz.fr](https://viyurz.fr).
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
### Ansible
|
### Initial setup
|
||||||
|
|
||||||
Install Ansible:
|
Run the setup script:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo apt install -y ansible
|
./setup.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### SSL certificates
|
### SSL certificates
|
||||||
|
@ -34,6 +34,10 @@ sudo zerossl-bot certonly --nginx -m viyurz@viyurz.fr -d turn.viyurz.fr
|
||||||
sudo certbot certonly --nginx -d mail.viyurz.fr
|
sudo certbot certonly --nginx -d mail.viyurz.fr
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Secrets
|
||||||
|
|
||||||
|
Copy the existing `secrets.yml.example` file to `secrets.yml` and fill the variables.
|
||||||
|
|
||||||
### Storagebox
|
### Storagebox
|
||||||
|
|
||||||
Add credential:
|
Add credential:
|
||||||
|
@ -45,22 +49,12 @@ username=MYUSERNAME
|
||||||
password=MYPASSWORD
|
password=MYPASSWORD
|
||||||
```
|
```
|
||||||
|
|
||||||
Copy & edit file `fstab`.
|
Copy the file `fstab` and edit it accordingly (username and potentially uids/gids).
|
||||||
|
|
||||||
## Secrets
|
|
||||||
|
|
||||||
Copy the existing `secrets.yml.example` to `secrets.yml`, run `ansible-vault encrypt secrets.yml` to encrypt the file with a password, and finally edit the newly encrypted file with `ansible-vault edit secrets.yml`.
|
|
||||||
|
|
||||||
If you want to change the vault password run `ansible-vault rekey secrets.yml`.
|
|
||||||
|
|
||||||
## Backups
|
## Backups
|
||||||
|
|
||||||
Run the `backup-services.yml` playbook once to setup the passphrase file.
|
Create a cronjob to periodically backup all projects:
|
||||||
|
|
||||||
After that, you can create a root cronjob to run this playbook without requiring interactivity:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
0 4 * * * export ANSIBLE_ROLES_PATH=/home/viyurz/vps/roles/; /usr/bin/ansible-playbook /home/viyurz/vps/playbooks/backup-services.yml -e include_secrets=false -e selected_projects=''
|
0 4 * * * /home/viyurz/vps/manage.py backup ''
|
||||||
```
|
```
|
||||||
|
|
||||||
Here we leave `selected_projects` empty to backup all projects.
|
|
||||||
|
|
Loading…
Reference in a new issue