55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
---
|
|
- import_playbook: initialize.yml
|
|
|
|
|
|
- name: Install Nginx
|
|
hosts: jupiter
|
|
handlers:
|
|
- name: restart-nginx
|
|
import_tasks: tasks/nginx/services.yml
|
|
tasks:
|
|
- import_tasks: tasks/nginx/install.yml
|
|
|
|
- name: Set required SELinux options
|
|
become: true
|
|
seboolean:
|
|
name: httpd_can_network_connect
|
|
persistent: true
|
|
state: true
|
|
notify:
|
|
- restart-nginx
|
|
|
|
|
|
- name: Configure Nginx
|
|
hosts: jupiter
|
|
vars_files:
|
|
- vars/applications.yml
|
|
vars:
|
|
_letsencrypt_cert_dir: /etc/letsencrypt/live
|
|
handlers:
|
|
- name: restart-nginx
|
|
import_tasks: tasks/nginx/services.yml
|
|
tasks:
|
|
- name: Install server configuration
|
|
become: true
|
|
copy:
|
|
src: nginx/nginx.conf
|
|
dest: /etc/nginx/nginx.conf
|
|
notify:
|
|
- restart-nginx
|
|
|
|
- name: Install application configurations
|
|
when: item.value.published.host is defined
|
|
become: true
|
|
template:
|
|
src: nginx/{{ item.key }}.nginx.conf.j2
|
|
dest: /etc/nginx/conf.d/{{ item.key }}.conf
|
|
owner: nginx
|
|
group: "{{ ansible_user }}"
|
|
mode: 0755
|
|
loop: "{{ omni_compose_apps | dict2items }}"
|
|
loop_control:
|
|
label: "{{ item.key }} ({{ item.value.published.host | default('none') }})"
|
|
notify:
|
|
- restart-nginx
|