parent
328ec744cc
commit
a86b34cf34
4 changed files with 27 additions and 0 deletions
roles/nginx
|
@ -1,5 +1,6 @@
|
|||
nginx__deploy_redirect_conf: true
|
||||
nginx__deploy_tls_conf: true
|
||||
nginx__deploy_logging_conf: true
|
||||
nginx__configurations: [ ]
|
||||
nginx__use_custom_nginx_conf: false
|
||||
nginx__custom_nginx_conf: ""
|
||||
|
|
2
roles/nginx/files/logging.conf
Normal file
2
roles/nginx/files/logging.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
error_log syslog:server=unix:/run/systemd/journal/dev-log,nohostname,severity=warn debug;
|
||||
access_log syslog:server=unix:/run/systemd/journal/dev-log,nohostname,severity=info main;
|
|
@ -23,6 +23,12 @@ argument_specs:
|
|||
type: bool
|
||||
required: false
|
||||
default: true
|
||||
nginx__deploy_logging_conf:
|
||||
description: >-
|
||||
Whether or not to deploy a `logging.conf` to `/etc/nginx/conf.d/logging.conf`.
|
||||
type: bool
|
||||
required: false
|
||||
default: true
|
||||
nginx__configurations:
|
||||
description: A list of nginx configurations.
|
||||
type: list
|
||||
|
|
|
@ -100,6 +100,24 @@
|
|||
ansible.builtin.set_fact:
|
||||
nginx__config_files_to_exist: "{{ nginx__config_files_to_exist + [ 'redirect.conf' ] }}" # noqa: jinja[spacing]
|
||||
|
||||
- name: handle the case, where logging.conf should be deployed
|
||||
when: nginx__deploy_logging_conf
|
||||
block:
|
||||
- name: make sure logging.conf is deployed
|
||||
ansible.builtin.copy:
|
||||
force: true
|
||||
dest: /etc/nginx/conf.d/logging.conf
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: root
|
||||
src: logging.conf
|
||||
become: true
|
||||
notify: Restart `nginx.service`
|
||||
|
||||
- name: add logging.conf to nginx__config_files_to_exist
|
||||
ansible.builtin.set_fact:
|
||||
nginx__config_files_to_exist: "{{ nginx__config_files_to_exist + [ 'logging.conf' ] }}" # noqa: jinja[spacing]
|
||||
|
||||
- name: make sure all given configuration files are deployed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ item.content }}"
|
||||
|
|
Loading…
Add table
Reference in a new issue