1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_role_nginx.git synced 2024-08-16 16:19:48 +02:00
ansible_role_nginx/tasks/main.yml

38 lines
994 B
YAML
Raw Normal View History

2020-11-02 04:51:35 +01:00
---
2021-02-04 14:43:54 +01:00
- name: simple versionscheck
ansible.builtin.include_tasks: versioncheck.yml
2021-02-04 14:43:54 +01:00
when: submodules_versioncheck | bool
2020-11-02 04:51:35 +01:00
- name: Install nginx
ansible.builtin.include_tasks: installation.yml
2020-11-02 04:51:35 +01:00
2021-10-18 00:42:23 +02:00
- name: create nginx user and group
ansible.builtin.include_tasks: users.yml
2020-11-02 04:51:35 +01:00
- name: Configure nginx
ansible.builtin.include_tasks: nginx.yml
2020-11-02 04:51:35 +01:00
- name: start nginx webserver
ansible.builtin.systemd:
2020-11-02 04:51:35 +01:00
name: nginx
state: started
enabled: true
2020-11-02 04:51:35 +01:00
- name: configure nginx default site
ansible.builtin.include_tasks: default_site.yml
when: nginx__infrastructure_domain__enabled | bool
2020-11-02 04:51:35 +01:00
- name: Configure nginx sites
ansible.builtin.include_tasks: single_site.yml
2020-11-02 04:51:35 +01:00
with_items: '{{ nginx_sites }}'
loop_control:
loop_var: site
# Restart nginx before doing acme stuff
- name: Flush handlers to restart nginx now
ansible.builtin.meta: flush_handlers
2020-11-02 04:51:35 +01:00
- name: Configure acmetool and obtain certificates
ansible.builtin.include_tasks: acme.yml
2021-02-04 18:22:01 +01:00
when: nginx__acmetool_enabled