mirror of https://github.com/Aidaho12/haproxy-wi
parent
c30dc1bfba
commit
3b60d556b4
|
@ -45,3 +45,11 @@
|
||||||
https_proxy: "{{PROXY}}"
|
https_proxy: "{{PROXY}}"
|
||||||
tags:
|
tags:
|
||||||
- system
|
- system
|
||||||
|
|
||||||
|
- name: Set correct owner
|
||||||
|
hosts: "{{ variable_host }}"
|
||||||
|
become: yes
|
||||||
|
tasks:
|
||||||
|
- name: Set
|
||||||
|
shell: "chown nginx:nginx -R {{ nginx_dir }}"
|
||||||
|
|
||||||
|
|
|
@ -53,12 +53,31 @@
|
||||||
- name: Copy Nginx configuration in place
|
- name: Copy Nginx configuration in place
|
||||||
template:
|
template:
|
||||||
src: default.conf.j2
|
src: default.conf.j2
|
||||||
dest: "{{nginx_dir}}/conf.d"
|
dest: "{{nginx_dir}}/conf.d/default.conf"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
force: no
|
force: no
|
||||||
when: "'nginx' not in ansible_facts.packages"
|
when: "'nginx' not in ansible_facts.packages"
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: Copying over nginx.conf
|
||||||
|
template:
|
||||||
|
src: nginx.conf.j2
|
||||||
|
dest: "{{ nginx_dir }}/nginx.conf"
|
||||||
|
mode: "0666"
|
||||||
|
force: no
|
||||||
|
remote_src: true
|
||||||
|
become: true
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: Copying over mime.types
|
||||||
|
template:
|
||||||
|
src: mime.types.j2
|
||||||
|
dest: "{{ nginx_dir }}/mime.types"
|
||||||
|
mode: "0666"
|
||||||
|
force: no
|
||||||
|
remote_src: true
|
||||||
|
become: true
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Open stat port for firewalld
|
- name: Open stat port for firewalld
|
||||||
firewalld:
|
firewalld:
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
user nginx;
|
||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1021;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
}
|
|
@ -39,28 +39,6 @@
|
||||||
become: true
|
become: true
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: Copying over nginx.conf
|
|
||||||
template:
|
|
||||||
src: nginx.conf.j2
|
|
||||||
dest: "{{ nginx_dir }}/nginx.conf"
|
|
||||||
mode: "0666"
|
|
||||||
owner: "{{ansible_user}}"
|
|
||||||
group: "{{ansible_user}}"
|
|
||||||
force: no
|
|
||||||
become: true
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Copying over mime.types
|
|
||||||
template:
|
|
||||||
src: mime.types.j2
|
|
||||||
dest: "{{ nginx_dir }}/mime.types"
|
|
||||||
mode: "0666"
|
|
||||||
owner: "{{ansible_user}}"
|
|
||||||
group: "{{ansible_user}}"
|
|
||||||
force: no
|
|
||||||
become: true
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Create Nginx
|
- name: Create Nginx
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ CONT_NAME }}"
|
name: "{{ CONT_NAME }}"
|
||||||
|
|
Loading…
Reference in New Issue