lexa-uw.nginx-configuration
Rolle zum Ändern von Nginx-Konfigurationen
Mit dieser Rolle können Sie die Nginx-Konfiguration ändern und sie zurücksetzen, wenn etwas schiefgeht.
Anforderungen
Diese Rolle benötigt Ansible 2.5 oder höher.
Rollenvariablen
nginx_config_src
Pfad zu Ihrer Nginx-Konfigurationsdatei. Erforderliche Option.
nginx_config_dest
Pfad, wo die Konfiguration auf dem Server gespeichert werden muss. (Standard: /etc/nginx/conf.d/nginx.conf).
nginx_command_to_check_config
Befehl zur Überprüfung der Nginx-Konfiguration. (Standard: nginx -t)
nginx_command_to_reload
Befehl zum Neuladen des Servers. (Standard: service nginx reload)
Rolle zum Projekt hinzufügen:
Fügen Sie die Rolle in Ihre Anforderungen ein (z.B. requirements.yml):
- src: lexa-uw.nginx-configuration
version: v1.0.0
name: nginx-configuration
Rolle installieren: ansible-galaxy install -r ./requirements.yml --roles-path ./roles/
Beispiel für ein Playbook:
- hosts: all
vars_files:
- vars/main.yml
roles:
- { role: nginx-configuration }
In vars/main.yml
nginx_config_src: templates/example.conf
nginx_config_dest: /etc/nginx/conf.d/example.conf
nginx_command_to_reload: /etc/init.d/nginx reload