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:
parent
86bd6f0d14
commit
0e3088a642
3 changed files with 14 additions and 22 deletions
|
@ -24,4 +24,6 @@ snippet_files:
|
||||||
#default_robots_file: 'robots_disallow_all.txt'
|
#default_robots_file: 'robots_disallow_all.txt'
|
||||||
|
|
||||||
|
|
||||||
nginx__dhparam_size: 2048
|
nginx__dhparam_size: 4096
|
||||||
|
|
||||||
|
nxinx__state: 'present'
|
||||||
|
|
|
@ -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
|
- name: Install nginx
|
||||||
apt:
|
become: true
|
||||||
package:
|
package:
|
||||||
|
name:
|
||||||
- 'nginx'
|
- 'nginx'
|
||||||
state: latest
|
state: "{{ nxinx__state }}"
|
||||||
update_cache: yes
|
|
||||||
cache_valid_time: 43200
|
|
||||||
tags:
|
|
||||||
- installation
|
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Install nginx
|
- name: Install nginx
|
||||||
include_tasks: installation.yml
|
include_tasks: installation.yml
|
||||||
tags:
|
|
||||||
- repository
|
|
||||||
- installation
|
|
||||||
|
|
||||||
|
|
||||||
- name: Configure nginx
|
- name: Configure nginx
|
||||||
include_tasks: nginx.yml
|
include_tasks: nginx.yml
|
||||||
tags:
|
|
||||||
- configuration
|
|
||||||
- nginx
|
|
||||||
- dhparam
|
|
||||||
|
|
||||||
|
|
||||||
- name: Start nginx webserver
|
- name: Start nginx webserver
|
||||||
service:
|
service:
|
||||||
|
@ -24,7 +14,6 @@
|
||||||
- operation
|
- operation
|
||||||
- nginx
|
- nginx
|
||||||
|
|
||||||
|
|
||||||
- name: Configure nginx default site
|
- name: Configure nginx default site
|
||||||
include_tasks: default_site.yml
|
include_tasks: default_site.yml
|
||||||
tags:
|
tags:
|
||||||
|
@ -32,7 +21,6 @@
|
||||||
- nginx
|
- nginx
|
||||||
- sites
|
- sites
|
||||||
|
|
||||||
|
|
||||||
- name: Configure nginx sites
|
- name: Configure nginx sites
|
||||||
include_tasks: single_site.yml
|
include_tasks: single_site.yml
|
||||||
with_items: '{{ nginx_sites }}'
|
with_items: '{{ nginx_sites }}'
|
||||||
|
@ -43,12 +31,10 @@
|
||||||
- nginx
|
- nginx
|
||||||
- sites
|
- sites
|
||||||
|
|
||||||
|
|
||||||
# Restart nginx before doing acme stuff
|
# Restart nginx before doing acme stuff
|
||||||
- name: Flush handlers to restart nginx now
|
- name: Flush handlers to restart nginx now
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
|
|
||||||
- name: Configure acmetool and obtain certificates
|
- name: Configure acmetool and obtain certificates
|
||||||
include_tasks: acme.yml
|
include_tasks: acme.yml
|
||||||
tags:
|
tags:
|
||||||
|
|
Loading…
Reference in a new issue