update readme, etc.
This commit is contained in:
parent
7f52e47c25
commit
163f770e2b
7 changed files with 69 additions and 10 deletions
60
README.md
60
README.md
|
@ -1,5 +1,63 @@
|
|||
# Beispiel Ansible
|
||||
|
||||
## Erste schritte
|
||||
|
||||
```sh
|
||||
# Installiere ansible
|
||||
apt update
|
||||
apt install -y ansible
|
||||
|
||||
# Kopiere die "skeleton" rolle
|
||||
cp -r roles/{skeleton,webserver}
|
||||
|
||||
# Editiere die inventory datei
|
||||
$EDITOR inventory
|
||||
```
|
||||
|
||||
Wenn die rolle kopiert ist, musst du sie in der `site.yml` noch importieren:
|
||||
|
||||
```yaml
|
||||
- name: Import webserver role
|
||||
hosts:
|
||||
- all
|
||||
roles:
|
||||
- webserver
|
||||
```
|
||||
|
||||
## Relevante befehle/tasks
|
||||
|
||||
### Rolle ausführen
|
||||
|
||||
```sh
|
||||
# Auf deinem Rechner
|
||||
ansible-playbook site.yml
|
||||
```
|
||||
|
||||
### Webserver neuladen
|
||||
|
||||
```sh
|
||||
# Auf dem Raspi
|
||||
sudo nginx -s reload
|
||||
```
|
||||
|
||||
(oder)
|
||||
|
||||
```yaml
|
||||
# In deiner Rolle
|
||||
- name: Reload nginx
|
||||
ansible.builtin.systemd_service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
- [ ] Write a proper readme for the poor intern cursed with this playbook
|
||||
- [ ] Installiere einen Webserver (apache/traefik/nginx/lighttpd)
|
||||
- [ ] Serviere `files/index.html` (unter `/var/www/html/index.html` ablegen)
|
||||
- [ ] Bonusaufgabe: aktiviere eine Password-Authentifizierung (Basic Auth)
|
||||
|
||||
## Relevante Dokumentation
|
||||
|
||||
- [Paket Installieren](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/package_module.html)
|
||||
- [Datei kopieren](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html)
|
||||
- [NGINX basic auth](https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/)
|
||||
|
|
1
files/index.html
Normal file
1
files/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<img src="https://snaile.de/glizzy.gif">
|
|
@ -1,2 +1,2 @@
|
|||
---
|
||||
# defaults file for basic
|
||||
# defaults file for skeleton
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
---
|
||||
# handlers file for basic
|
||||
# handlers file for skeleton
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
---
|
||||
# tasks file for basic
|
||||
# tasks file for skeleton
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
---
|
||||
# vars file for basic
|
||||
# vars file for skeleton
|
||||
|
|
10
site.yml
10
site.yml
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: Import example role
|
||||
hosts:
|
||||
- all
|
||||
roles:
|
||||
- example
|
||||
# - name: Import skeleton role
|
||||
# hosts:
|
||||
# - all
|
||||
# roles:
|
||||
# - skeleton
|
||||
|
|
Loading…
Add table
Reference in a new issue