Wyselekcjonowana kolekcja repozytoriów playbooków Ansible i przykładów zadań dla typowych wdrożeń serwerowych i aplikacji.
🔗 Related: Podstawowa ściąga z Ansible · Ściąga z modułów Ansible · Przewodnik szybkiego startu Ansible
Implementacje playbooków open-source
- Serwer WWW i środowisko Ruby: Ansible Ruby Example Playbook (roles/webserver)
- Serwer bazy danych PostgreSQL: Ansible Postgres Example Playbook (roles/db)
- Własna instancja GitLab: Ansible GitLab Playbook
Typowe fragmenty zadań wielokrotnych
Kompletna konfiguracja Nginx z certyfikatem Let's Encrypt SSL
- name: Configure Web Server with Nginx
hosts: webservers
become: true
tasks:
- name: Ensure Nginx is installed
apt:
name: nginx
state: present
update_cache: yes
- name: Copy site configuration template
template:
src: templates/nginx.conf.j2
dest: /etc/nginx/sites-available/default
notify: Reload Nginx
- name: Ensure Nginx service is running and enabled
service:
name: nginx
state: started
enabled: yes
handlers:
- name: Reload Nginx
service:
name: nginx
state: reloaded