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

improve nginx installation method

This commit is contained in:
L3D 2021-02-04 13:43:08 +01:00
parent 86bd6f0d14
commit 0e3088a642
Signed by: l3d
GPG key ID: CD08445BFF4313D1
3 changed files with 14 additions and 22 deletions

View file

@ -24,4 +24,6 @@ snippet_files:
#default_robots_file: 'robots_disallow_all.txt'
nginx__dhparam_size: 2048
nginx__dhparam_size: 4096
nxinx__state: 'present'

View file

@ -1,11 +1,15 @@
---
- name: Update apt cache
become: true
apt:
cache_valid_time: 3600
update_cache: true
when:
- ansible_pkg_mgr == "apt"
- name: Install nginx
apt:
package:
become: true
package:
name:
- 'nginx'
state: latest
update_cache: yes
cache_valid_time: 43200
tags:
- installation
state: "{{ nxinx__state }}"

View file

@ -1,19 +1,9 @@
---
- name: Install nginx
include_tasks: installation.yml
tags:
- repository
- installation
- name: Configure nginx
include_tasks: nginx.yml
tags:
- configuration
- nginx
- dhparam
- name: Start nginx webserver
service:
@ -24,7 +14,6 @@
- operation
- nginx
- name: Configure nginx default site
include_tasks: default_site.yml
tags:
@ -32,7 +21,6 @@
- nginx
- sites
- name: Configure nginx sites
include_tasks: single_site.yml
with_items: '{{ nginx_sites }}'
@ -43,12 +31,10 @@
- nginx
- sites
# Restart nginx before doing acme stuff
- name: Flush handlers to restart nginx now
meta: flush_handlers
- name: Configure acmetool and obtain certificates
include_tasks: acme.yml
tags: