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_user: nginx
nginx_group: nginx nginx_group: nginx
nginx_worker_processes: 1 nginx_worker_processes: 1
@ -7,12 +8,13 @@ nginx_open_ports:
- 80 - 80
- 443 - 443
nginx_tls_enabled: False nginx_tls_enabled: False
nginx_tls_cert: "" # nginx_tls_cert:
nginx_tls_private_key: "" # nginx_tls_private_key:
nginx_tls_intermediate_ca: "" # nginx_tls_intermediate_ca:
nginx_vhosts_dir: /var/www/vhosts
nginx_pfs_enabled: False nginx_pfs_enabled: False
nginx_dhparam_size: '4069' nginx_dhparam_size: 4069
nginx_dhparam_file: '/etc/pki/tls/certs/dhparam-{{ nginx_dhparam_size }}.pem' 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_cert_file: "/etc/pki/tls/certs/my-chained.crt"
nginx_tls_intermediate_ca_file: "/etc/pki/tls/certs/my-intermediate.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" 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/" baseurl: "https://nginx.org/packages/centos/{{ ansible_distribution_major_version }}/$basearch/"
gpgkey: https://nginx.org/keys/nginx_signing.key gpgkey: https://nginx.org/keys/nginx_signing.key
gpgcheck: yes gpgcheck: yes
when: nginx_official_repo_enabled
- name: Installing nginx - name: Installing nginx
yum: yum:
@ -30,18 +31,18 @@
- name: Prepare vhost directories - name: Prepare vhost directories
file: file:
path: '{{ item }}' path: "{{ item }}"
state: directory state: directory
owner: nginx owner: nginx
group: nginx group: nginx
mode: 0750 mode: 0750
with_items: with_items:
- /var/www/vhosts - "{{ nginx_vhosts_dir }}"
- /var/www/vhosts/default - "{{ nginx_vhosts_dir }}/default"
- name: Prepare nginx directories - name: Prepare nginx directories
file: file:
path: '{{ item }}' path: "{{ item }}"
state: directory state: directory
owner: root owner: root
group: root group: root
@ -52,8 +53,8 @@
- name: Update nginx.conf - name: Update nginx.conf
template: template:
src: 'etc/nginx/nginx.conf.j2' src: etc/nginx/nginx.conf.j2
dest: '/etc/nginx/nginx.conf' dest: "/etc/nginx/nginx.conf"
owner: root owner: root
group: root group: root
mode: 0640 mode: 0640
@ -80,7 +81,7 @@
path: /etc/nginx/conf.d/default.conf path: /etc/nginx/conf.d/default.conf
state: absent state: absent
- name: Add default page config - name: Add default page configuration file
template: template:
src: 'etc/nginx/sites-available/default.j2' src: 'etc/nginx/sites-available/default.j2'
dest: '/etc/nginx/sites-available/default' dest: '/etc/nginx/sites-available/default'

View File

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