Rewrite Teckids sysadmin-ansible #20

Merged
tteichler merged 49 commits from ansible-2 into master 2022-04-04 14:19:40 +02:00
Owner

Zusammenfassung

Das Ansible soll genutzt werden, um unsere Infrastruktur einheitlich zu gestalten und um spezielle Spezialkonfigurationen zu vermeiden. Der Zielzustand ist, dass man eine VM neuinstallieren kann und nach einem Ansible-Run wieder alle Dienste installiert und konfiguriert sind.

Disclaimer

Die folgenden TODOs sind nicht fest. Es darf und soll darüber diskutiert werden, was sinnvoll bzw. nicht sinnvoll ist und warum.

Generelles

  • Paketinstallationen
    • Im "alten" Ansible hatten wir Paket-Listen, die auf allen Servern installiert wurden. Das würde ich so beibehalten. Solche Listen können bei Bedarf auch für andere Hostgruppen (z.B. mail-servers, webservers,…) angelegt werden. Diese müssen dann im jeweiligen YAML-File referenziert werden.
  • Passwörter in Konfigurationsdateien
  • Monitoring
    • Aktuell wird bei der Neuinstallation eines Hosts das icinga2-agent.sh-Skript aus dem Icinga-Director kopiert und manuell auf dem Host ausgeführt. Das soll durch das Ansible abgelöst werden. Dazu wird das Skript als Template genutzt und das Agent-Ticket per API-Request aus dem Icinga-Director geholt.

Anwendungen

Anwendungen können generell mehrmals in unserer Infrastruktur betrieben werden. Wir sollten daher möglichst alles soweit generalisieren, dass es auf einem neuen Server laufen kann und Anwendungen immer für ganze Hostgruppen ausrollen. Ob in der Hostgruppe dann nur ein Server ist, ist ja erstmal egal.

  • GitLab-Runner
    • GitLab-Runner sind nicht wirklich kompliziert zu installieren. Die Paketquellen von GitLab werden im Playbook eingebunden und die Config per Template mit einem Passwort aus dem Passwordstore generiert.
  • Prometheus/Grafana
    • Die Konfigurationsdateien für Prometheus und Grafana sind bereits im Repo. Die Config von Prometheus soll aber noch so angepasst werden, dass nicht jeder Host einzeln reingeschrieben werden muss, sondern die Exporter anhand von Hostgruppen im Template eingetragen werden.
  • Kubernetes-Worker
    • Kubernetes-Worker sollten komplett automatisch installiert werden und dem Cluster joinen
  • Firewalls
    • HAProxy
      • dehydrated
      • Front- und Backends
    • keepalived
    • shorewall
    • Netzwerkkonfig
# Zusammenfassung Das Ansible soll genutzt werden, um unsere Infrastruktur einheitlich zu gestalten und um spezielle Spezialkonfigurationen zu vermeiden. Der Zielzustand ist, dass man eine VM neuinstallieren kann und nach einem Ansible-Run wieder alle Dienste installiert und konfiguriert sind. # Disclaimer Die folgenden TODOs sind nicht fest. Es darf und soll darüber diskutiert werden, was sinnvoll bzw. nicht sinnvoll ist und warum. # Generelles - [x] Paketinstallationen - Im "alten" Ansible hatten wir Paket-Listen, die auf allen Servern installiert wurden. Das würde ich so beibehalten. Solche Listen können bei Bedarf auch für andere Hostgruppen (z.B. mail-servers, webservers,…) angelegt werden. Diese müssen dann im jeweiligen YAML-File referenziert werden. - [x] Passwörter in Konfigurationsdateien - In einigen Konfigurationsdateien die per Ansible ausgerollt werden (sollen) müssen Passwörter für Datenbanken etc. angegeben werden. Hier sollten wir Möglichkeiten prüfen, diese aus dem Passwordstore zu ziehen. s. https://docs.ansible.com/ansible/latest/collections/community/general/passwordstore_lookup.html - [x] Monitoring - Aktuell wird bei der Neuinstallation eines Hosts das icinga2-agent.sh-Skript aus dem Icinga-Director kopiert und manuell auf dem Host ausgeführt. Das soll durch das Ansible abgelöst werden. Dazu wird das Skript als Template genutzt und das Agent-Ticket per API-Request aus dem Icinga-Director geholt. # Anwendungen Anwendungen können generell mehrmals in unserer Infrastruktur betrieben werden. Wir sollten daher möglichst alles soweit generalisieren, dass es auf einem neuen Server laufen kann und Anwendungen immer für ganze Hostgruppen ausrollen. Ob in der Hostgruppe dann nur ein Server ist, ist ja erstmal egal. - [x] GitLab-Runner - GitLab-Runner sind nicht wirklich kompliziert zu installieren. Die Paketquellen von GitLab werden im Playbook eingebunden und die Config per Template mit einem Passwort aus dem Passwordstore generiert. - [x] Prometheus/Grafana - Die Konfigurationsdateien für Prometheus und Grafana sind bereits im Repo. Die Config von Prometheus soll aber noch so angepasst werden, dass nicht jeder Host einzeln reingeschrieben werden muss, sondern die Exporter anhand von Hostgruppen im Template eingetragen werden. - [ ] Kubernetes-Worker - Kubernetes-Worker sollten komplett automatisch installiert werden und dem Cluster joinen - [x] Firewalls - [x] HAProxy - [x] dehydrated - [x] Front- und Backends - [x] keepalived - [x] shorewall - [x] Netzwerkkonfig
Author
Owner

added 1 commit

  • 975ddc6c - Rewrite Teckids sysadmin-ansible

Compare with previous version

added 1 commit <ul><li>975ddc6c - Rewrite Teckids sysadmin-ansible</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6988&start_sha=4a8e54b6a539ebf86752516d26c904e6e293bba6)
Author
Owner

added 1 commit

  • 72f80688 - Add ci config

Compare with previous version

added 1 commit <ul><li>72f80688 - Add ci config</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6989&start_sha=511030bbd0c117204eaf9294edda74c616bfe7c1)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>d9d45747 - Add ci config</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6991&start_sha=72f80688d3ee20e22a6be1c7b59316959b6d9df3)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>5736008e - Reformat prepare steps</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6992&start_sha=d9d457473a6029bc7cc6f1dda142c1f64c6d9c50)
Author
Owner

added 1 commit

  • e1c2798a - Install icinga2 agent on ubuntu servers

Compare with previous version

added 1 commit <ul><li>e1c2798a - Install icinga2 agent on ubuntu servers</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6994&start_sha=5736008e01d9b04c424b7bd157c54db0faeea742)
Author
Owner

added 1 commit

  • 5b6cdb96 - Install icinga2 agent on ubuntu servers

Compare with previous version

added 1 commit <ul><li>5b6cdb96 - Install icinga2 agent on ubuntu servers</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6996&start_sha=e1c2798ac0371263111149e72ea7d3fab91e5d43)
Author
Owner

added 1 commit

  • 180a36e9 - Add variables for gitlab runner and use token from password store

Compare with previous version

added 1 commit <ul><li>180a36e9 - Add variables for gitlab runner and use token from password store</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=6998&start_sha=5b6cdb96240ffb438a40b9641fc24dad1c1f7960)
Author
Owner

added 1 commit

  • 82f7e848 - Add variables for gitlab runner and use token from password store

Compare with previous version

added 1 commit <ul><li>82f7e848 - Add variables for gitlab runner and use token from password store</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7000&start_sha=180a36e99d60344fd56622212802f7a8af4f3f73)
Author
Owner

changed the description

changed the description
Author
Owner

changed the description

changed the description
Author
Owner

changed the description

changed the description
Author
Owner

added 5 commits

Compare with previous version

added 5 commits <ul><li>bd3e9591 - Update gitignore</li><li>cd90587c - Remove deprecated config option</li><li>e9673e6f - Update server packages</li><li>a7654b5a - Update run script</li><li>8ff513ca - Rewrite prometheus config</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7017&start_sha=82f7e84860589d45b0db01c36a6bffc086a90bd2)
Author
Owner

marked the checklist item Monitoring as completed

marked the checklist item **Monitoring** as completed
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>bb5f480c - Fix name of host groups</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7019&start_sha=8ff513ca47fe0a1061111ee28bc2afc72f804b84)
Author
Owner

marked the checklist item Prometheus/Grafana as completed

marked the checklist item **Prometheus/Grafana** as completed
Author
Owner

marked the checklist item Passwörter in Konfigurationsdateien as completed

marked the checklist item **Passwörter in Konfigurationsdateien** as completed
Author
Owner

marked the checklist item Paketinstallationen as completed

marked the checklist item **Paketinstallationen** as completed
Author
Owner

added 2 commits

Compare with previous version

added 2 commits <ul><li>29621ed4 - Fix token lookup</li><li>3f4e9b68 - Rewrite config, fix file paths</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7107&start_sha=bb5f480c938eb4cc00f2ad94455b4bb5a19a6d17)
Author
Owner

added 2 commits

Compare with previous version

added 2 commits <ul><li>dc591c60 - Configure GitLab via ansible</li><li>3615229c - Fix variable names</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7118&start_sha=3f4e9b68043bd4df9fc8c58b1c32f1805edf24d0)
Author
Owner

marked the checklist item GitLab-Runner as completed

marked the checklist item **GitLab-Runner** as completed
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>07995737 - Add monitoring scripts</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7120&start_sha=3615229c196abfdd033a0cefc70517f44983c4b0)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>402f93d3 - Get ticket from api</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=7128&start_sha=07995737741e4e3db248ab98ec0ab803510db290)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>cb5931ba - Remove ubuntu servers</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=8107&start_sha=402f93d398be41b0ea386e7c316b30898aed378c)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>92a3d60d - Cleanup</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=8109&start_sha=cb5931ba6bb50e84a3e5db34ea42ff124c6be295)
Author
Owner

mentioned in issue sysadmin#225

mentioned in issue sysadmin#225
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>06246004 - Fix lint issues</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=10525&start_sha=92a3d60d95f361c2caef228b88ac329ba08692f5)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>5b97acd4 - Fix retention time</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=10527&start_sha=06246004de7d6db7a572a68e3ea4b78e40e55423)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>b4c0b8e6 - Block sl</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=11517&start_sha=5b97acd4903a7c4aab1a42b88ebb57b48ed714dd)
Author
Owner

changed the description

changed the description
Author
Owner

assigned to @debdolph

assigned to @debdolph
Author
Owner

changed the description

changed the description
Author
Owner

changed the description

changed the description
Author
Owner

added 2 commits

Compare with previous version

added 2 commits <ul><li>734e7f5f - cleanu</li><li>3a0cb70a - Add k8s-Hosts</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20010&start_sha=b4c0b8e65fa66c78dbad0539aef20543b60c1851)
Author
Owner

added 11 commits

Compare with previous version

added 11 commits <ul><li>c465e34c - Add firewall setup</li><li>9547ead0 - Add config for firewalls</li><li>3b26a2f0 - Remove whitespaces</li><li>2f562221 - Use template for keepalived config</li><li>54f6a91e - Use FQCN</li><li>16b02679 - Fix playbook</li><li>2e57a65b - Check shorewall config</li><li>c73bdb6a - Add HAProxy check</li><li>c879b0bc - Configure foreman</li><li>57b1f591 - Disable keepalived restart</li><li>e6ffb428 - Merge branch &#39;firewall&#39; into &#39;ansible-2&#39;</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20047&start_sha=3a0cb70a4222f61bc0e195c00e4a554893229b21)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>be4105c7 - Move to roles</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20050&start_sha=e6ffb4287263a683aa6babe8ade8074f8c9061c1)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>778eba26 - Cleanup firewall role</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20073&start_sha=be4105c7282a067fec33ae39cb687e16458c4328)
Author
Owner

marked the checklist item Prometheus/Grafana as incomplete

marked the checklist item **Prometheus/Grafana** as incomplete
Author
Owner

marked the checklist item GitLab-Runner as incomplete

marked the checklist item **GitLab-Runner** as incomplete
Author
Owner

marked the checklist item Firewalls as completed

marked the checklist item **Firewalls** as completed
Author
Owner

marked the checklist item HAProxy as completed

marked the checklist item **HAProxy** as completed
Author
Owner

marked the checklist item dehydrated as completed

marked the checklist item **dehydrated** as completed
Author
Owner

marked the checklist item Front- und Backends as completed

marked the checklist item **Front- und Backends** as completed
Author
Owner

marked the checklist item keepalived as completed

marked the checklist item **keepalived** as completed
Author
Owner

marked the checklist item shorewall as completed

marked the checklist item **shorewall** as completed
Author
Owner

marked the checklist item Monitoring as incomplete

marked the checklist item **Monitoring** as incomplete
Author
Owner

added 5 commits

  • e0e04cd7 - Initialize role, add Hosts to inventory
  • 235547dc - Add basic preparation of kubernetes nodes
  • a8c86e79 - Update common role
  • 101c70cb - Add upgrade config for workers and masters
  • 876e6305 - Merge branch 'k8s-ansible' into 'ansible-2'

Compare with previous version

added 5 commits <ul><li>e0e04cd7 - Initialize role, add Hosts to inventory</li><li>235547dc - Add basic preparation of kubernetes nodes</li><li>a8c86e79 - Update common role</li><li>101c70cb - Add upgrade config for workers and masters</li><li>876e6305 - Merge branch &#39;k8s-ansible&#39; into &#39;ansible-2&#39;</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20206&start_sha=778eba268b1f3be23a42aeaf4eba2f6de6723985)
Author
Owner

added 2 commits

Compare with previous version

added 2 commits <ul><li>01399d7c - Fix path to certs</li><li>cdda9353 - Get dns key for dehydrated</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20211&start_sha=876e630591201e7beb8b3dd5810e302aa7628ff7)
Author
Owner

added 2 commits

Compare with previous version

added 2 commits <ul><li>d1d84ee2 - Fix common role</li><li>0d0986a8 - Add note about foreman</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20212&start_sha=cdda9353c32cfc03f8dadb014505f3263bb4aa63)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>29d1738f - Update shorewall config</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20214&start_sha=0d0986a89717a242b20c7e0e8d5112bb285fc62b)
Author
Owner

changed the description

changed the description
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>ae4b7813 - Update shorewall config</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20218&start_sha=29d1738f6aa9d203698b55efb43af9858459b439)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>99685bee - Cleanup</li></ul> [Compare with previous version](/Teckids/team-sysadmin/sysadmin-ansible/-/merge_requests/10/diffs?diff_id=20220&start_sha=ae4b7813e58d6d9eec190dae38eee73699884109)
Author
Owner

mentioned in commit fce83e5857

mentioned in commit fce83e58576b8150f981fb06ea94a1913d61166d
tteichler merged commit fce83e5857 into master 2022-04-04 14:19:40 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
teckids/sysadmin-ansible!20
No description provided.