ansible/roles/nginx/tasks/configure.yml

45 lines
1.1 KiB
YAML
Raw Normal View History

2021-01-09 17:54:42 +00:00
---
- block:
- name: configure nginx.conf
copy:
content: "{{ nginx['nginx.conf'] }}"
dest: "/etc/nginx/nginx.conf"
notify: reload nginx
when: nginx['nginx.conf'] is defined
- name: add configs nginx to conf.d
copy:
content: "{{ item.data }}"
dest: "/etc/nginx/conf.d/{{ item.name }}"
loop: "{{ nginx['conf.d'] }}"
notify: reload nginx
when: nginx['conf.d'] is defined
2023-06-10 05:04:09 +00:00
- name: create stream.d dir
file:
name: /etc/nginx/stream.d
state: directory
2021-01-09 17:54:42 +00:00
- name: add configs nginx to stream.d
copy:
content: "{{ item.data }}"
dest: "/etc/nginx/stream.d/{{ item.name }}"
loop: "{{ nginx['stream.d'] }}"
notify: reload nginx
when: nginx['stream.d'] is defined
- name: check if ssl dir exist
file: path=/etc/nginx/ssl state=directory
when: nginx.ssl is defined
- name: add ssl certs and keys
copy:
content: "{{ item.data }}"
dest: "/etc/nginx/ssl/{{ item.name }}"
loop: "{{ nginx.ssl }}"
notify: reload nginx
when: nginx.ssl is defined
tags:
- nginx-configure