Add more configuration files and templates
This commit is contained in:
parent
0b862e9110
commit
ee907705a8
16 changed files with 213 additions and 24 deletions
37
tasks/configure.yml
Normal file
37
tasks/configure.yml
Normal file
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
- name: "Configuration | Copy main configuration"
|
||||
ansible.builtin.template:
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/nginx.conf
|
||||
mode: 0644
|
||||
notify: reload nginx
|
||||
|
||||
- name: "Configuration | Copy configuration snippets"
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/nginx/snippets/{{ item }}"
|
||||
mode: 0644
|
||||
loop:
|
||||
- add_headers.conf
|
||||
- letsentcrypt.conf
|
||||
notify: reload nginx
|
||||
|
||||
- name: "Configuration | Copy configuration templates"
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/etc/nginx/conf.d/{{ item }}"
|
||||
mode: 0644
|
||||
loop:
|
||||
- bad_clients.conf
|
||||
- reverse_proxy.conf
|
||||
- ssl.conf
|
||||
notify: reload nginx
|
||||
when: nginx_type is 'gateway' or nginx_type is 'standalone'
|
||||
|
||||
- name: "Configuration | Copy request limit configuration"
|
||||
ansible.builtin.copy:
|
||||
src: request_limits.conf
|
||||
dest: /etc/nginx/conf.d/
|
||||
mode: 0644
|
||||
notify: reload nginx
|
||||
when: nginx_type is 'gateway' or nginx_type is 'standalone'
|
|
@ -1,6 +1,12 @@
|
|||
---
|
||||
- import_tasks: packages.yml
|
||||
- name: "Install packages"
|
||||
ansible.builtin.import_tasks: packages.yml
|
||||
tags: packages
|
||||
|
||||
- import_tasks: monitoring.yml
|
||||
- name: "Configure"
|
||||
ansible.builtin.import_tasks: configure.yml
|
||||
tags: configure
|
||||
|
||||
- name: "Enable monitoring"
|
||||
ansible.builtin.import_tasks: monitoring.yml
|
||||
tags: monitoring
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: "monitoring | Aktiviere Munin-Plugin"
|
||||
file:
|
||||
- name: "Monitoring | Enable Munin plugin"
|
||||
ansible.builtin.file:
|
||||
src: "/usr/share/munin/plugins/nginx_{{ item }}"
|
||||
dest: "/etc/munin/plugins/nginx_{{ item }}"
|
||||
state: link
|
||||
|
@ -8,22 +8,26 @@
|
|||
- request
|
||||
- status
|
||||
notify: restart munin-node
|
||||
when: "'munin-node' in ansible_facts.packages"
|
||||
|
||||
- name: "monitoring | Kopiere Datei für lokale Statusausgabe"
|
||||
template:
|
||||
- name: "Monitoring | Copy statistics configuration file"
|
||||
ansible.builtin.template:
|
||||
src: local-statistics.j2
|
||||
dest: /etc/nginx/sites-available/local-statistics
|
||||
mode: 0644
|
||||
notify: reload nginx
|
||||
|
||||
- name: "monitoring | Aktiviere Lokale Status-Ausgabe"
|
||||
file:
|
||||
- name: "Monitoring | Enable local statistics"
|
||||
ansible.builtin.file:
|
||||
src: /etc/nginx/sites-available/local-statistics
|
||||
dest: /etc/nginx/sites-enabled/local-statistics
|
||||
state: link
|
||||
notify: reload nginx
|
||||
|
||||
- name: "monitoring | Kopiere Monit-Überwachung"
|
||||
template:
|
||||
- name: "Monitoring | Copy Monit configuration"
|
||||
ansible.builtin.template:
|
||||
src: monit.j2
|
||||
dest: /etc/monit/conf-enabled/nginx
|
||||
mode: 0644
|
||||
notify: reload monit
|
||||
when: "'monit' in ansible_facts.packages"
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
---
|
||||
- name: "packages | Installiere Debian-Pakete"
|
||||
apt:
|
||||
- name: "Packages | Get installed packages"
|
||||
ansible.builtin.package_facts:
|
||||
manager: apt
|
||||
|
||||
- name: "Packages | Install deb packages"
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- liblwp-useragent-determined-perl
|
||||
- "{{ nginx.version | default('nginx-full') }}"
|
||||
- "{{ nginx_package_name | default('nginx-full') }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue