---
- 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
vars_files:
- vars/applications.yml
vars:
_letsencrypt_cert_dir: /etc/letsencrypt/live
- name: Install server configuration
copy:
src: nginx/nginx.conf
dest: /etc/nginx/nginx.conf
- name: Install application configurations
when: item.value.published.host is defined
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') }})"