Add a readme
This commit is contained in:
parent
03d4e50b05
commit
6b37b7c932
2 changed files with 59 additions and 49 deletions
|
@ -1,52 +1,10 @@
|
||||||
|
# ANSIBLE
|
||||||
|
|
||||||
## Provisionning
|
## How to proceed
|
||||||
|
|
||||||
1. Need a public IP address
|
For each machine, **one by one** do:
|
||||||
2. Deploy Debian sid/buster
|
- Check that cluster is healthy
|
||||||
3. Add a DNS entry like xxxx.machine.deuxfleurs.fr A 0.0.0.0 in Cloudflare + Havelock
|
- Run `ansible-playbook -i production --limit <machine> site.yml`
|
||||||
4. Setup the fqdn in /etc/hosts (127.0.1.1 xxxx.machine.deuxfleurs.fr)
|
- Reboot
|
||||||
5. Switch the SSH port to the port 110
|
- Check that cluster is healthy
|
||||||
6. Add the server to the ./production file
|
|
||||||
7. Reboot machine
|
|
||||||
8. Deploy Ansible
|
|
||||||
9. Check that everything works as intended
|
|
||||||
10. Update NS 1.cluster.deuxfleurs.fr
|
|
||||||
|
|
||||||
## Useful commands
|
|
||||||
|
|
||||||
Show every variables collected by Ansible for a given host:
|
|
||||||
|
|
||||||
```
|
|
||||||
ansible -i production villequin.machine.deuxfleurs.fr -m setup
|
|
||||||
```
|
|
||||||
|
|
||||||
Run playbook for only one host:
|
|
||||||
|
|
||||||
```
|
|
||||||
ansible-playbook -i production --limit villequin.machine.deuxfleurs.fr site.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
Dump hostvars:
|
|
||||||
|
|
||||||
```
|
|
||||||
ansible -m debug villequin.machine.deuxfleurs.fr -i ./production -a "var=hostvars"
|
|
||||||
```
|
|
||||||
|
|
||||||
Deploy only one tag:
|
|
||||||
|
|
||||||
```
|
|
||||||
ansible-playbook -i production site.yml --tags "container"
|
|
||||||
```
|
|
||||||
|
|
||||||
Redeploy everything:
|
|
||||||
|
|
||||||
```
|
|
||||||
ansible-playbook -i production site.yml
|
|
||||||
```
|
|
||||||
|
|
||||||
Upgrade packages and force overwirte to fix bad packing done by GlusterFS:
|
|
||||||
|
|
||||||
```
|
|
||||||
apt-get -o Dpkg::Options::="--force-overwrite" dist-upgrade -y
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
52
ansible/README.more.md
Normal file
52
ansible/README.more.md
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
|
||||||
|
## Provisionning
|
||||||
|
|
||||||
|
1. Need a public IP address
|
||||||
|
2. Deploy Debian sid/buster
|
||||||
|
3. Add a DNS entry like xxxx.machine.deuxfleurs.fr A 0.0.0.0 in Cloudflare + Havelock
|
||||||
|
4. Setup the fqdn in /etc/hosts (127.0.1.1 xxxx.machine.deuxfleurs.fr)
|
||||||
|
5. Switch the SSH port to the port 110
|
||||||
|
6. Add the server to the ./production file
|
||||||
|
7. Reboot machine
|
||||||
|
8. Deploy Ansible
|
||||||
|
9. Check that everything works as intended
|
||||||
|
10. Update NS 1.cluster.deuxfleurs.fr
|
||||||
|
|
||||||
|
## Useful commands
|
||||||
|
|
||||||
|
Show every variables collected by Ansible for a given host:
|
||||||
|
|
||||||
|
```
|
||||||
|
ansible -i production villequin.machine.deuxfleurs.fr -m setup
|
||||||
|
```
|
||||||
|
|
||||||
|
Run playbook for only one host:
|
||||||
|
|
||||||
|
```
|
||||||
|
ansible-playbook -i production --limit villequin.machine.deuxfleurs.fr site.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Dump hostvars:
|
||||||
|
|
||||||
|
```
|
||||||
|
ansible -m debug villequin.machine.deuxfleurs.fr -i ./production -a "var=hostvars"
|
||||||
|
```
|
||||||
|
|
||||||
|
Deploy only one tag:
|
||||||
|
|
||||||
|
```
|
||||||
|
ansible-playbook -i production site.yml --tags "container"
|
||||||
|
```
|
||||||
|
|
||||||
|
Redeploy everything:
|
||||||
|
|
||||||
|
```
|
||||||
|
ansible-playbook -i production site.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
Upgrade packages and force overwirte to fix bad packing done by GlusterFS:
|
||||||
|
|
||||||
|
```
|
||||||
|
apt-get -o Dpkg::Options::="--force-overwrite" dist-upgrade -y
|
||||||
|
```
|
||||||
|
|
Reference in a new issue