some fixes

This commit is contained in:
Robert Kaussow 2018-08-09 21:20:06 +02:00
parent 63e9ff2289
commit 152f0af922
3 changed files with 49 additions and 48 deletions

View File

@ -1,4 +1,5 @@
---
nginx_official_repo_enabled: True
nginx_user: nginx
nginx_group: nginx
nginx_worker_processes: 1
@ -7,12 +8,13 @@ nginx_open_ports:
- 80
- 443
nginx_tls_enabled: False
nginx_tls_cert: ""
nginx_tls_private_key: ""
nginx_tls_intermediate_ca: ""
# nginx_tls_cert:
# nginx_tls_private_key:
# nginx_tls_intermediate_ca:
nginx_vhosts_dir: /var/www/vhosts
nginx_pfs_enabled: False
nginx_dhparam_size: '4069'
nginx_dhparam_file: '/etc/pki/tls/certs/dhparam-{{ nginx_dhparam_size }}.pem'
nginx_dhparam_size: 4069
nginx_dhparam_file: "/etc/pki/tls/certs/dhparam-{{ nginx_dhparam_size }}.pem"
nginx_tls_cert_file: "/etc/pki/tls/certs/my-chained.crt"
nginx_tls_intermediate_ca_file: "/etc/pki/tls/certs/my-intermediate.crt"
nginx_tls_private_key_file: "/etc/pki/tls/private/my-private.key"

View File

@ -8,6 +8,7 @@
baseurl: "https://nginx.org/packages/centos/{{ ansible_distribution_major_version }}/$basearch/"
gpgkey: https://nginx.org/keys/nginx_signing.key
gpgcheck: yes
when: nginx_official_repo_enabled
- name: Installing nginx
yum:
@ -30,18 +31,18 @@
- name: Prepare vhost directories
file:
path: '{{ item }}'
path: "{{ item }}"
state: directory
owner: nginx
group: nginx
mode: 0750
with_items:
- /var/www/vhosts
- /var/www/vhosts/default
- "{{ nginx_vhosts_dir }}"
- "{{ nginx_vhosts_dir }}/default"
- name: Prepare nginx directories
file:
path: '{{ item }}'
path: "{{ item }}"
state: directory
owner: root
group: root
@ -52,8 +53,8 @@
- name: Update nginx.conf
template:
src: 'etc/nginx/nginx.conf.j2'
dest: '/etc/nginx/nginx.conf'
src: etc/nginx/nginx.conf.j2
dest: "/etc/nginx/nginx.conf"
owner: root
group: root
mode: 0640
@ -80,7 +81,7 @@
path: /etc/nginx/conf.d/default.conf
state: absent
- name: Add default page config
- name: Add default page configuration file
template:
src: 'etc/nginx/sites-available/default.j2'
dest: '/etc/nginx/sites-available/default'

View File

@ -5,12 +5,10 @@ worker_processes {{ nginx_worker_processes }};
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections {{ nginx_worker_connections }};
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;