Skip to content

Commit

Permalink
bugfix HAProxy not initialized on new installations; fixed paths for …
Browse files Browse the repository at this point in the history
…filelogs
  • Loading branch information
fititnt committed Nov 7, 2019
1 parent 1d09570 commit 32ca5cf
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
8 changes: 8 additions & 0 deletions tasks/haproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# FILE: {{ role_path }}/tasks/haproxy.yml
# LICENSE: Public Domain

# TODO: fix issue with at very first time HAProxy is not started after installation (fititnt, 2019-11-04 20:40 BRT)

# https://haproxy.debian.net/#?distribution=Ubuntu&release=bionic&version=2.0

- name: "add-apt-repository ppa:vbernat/haproxy-2.0"
Expand All @@ -14,6 +16,12 @@
name: 'haproxy=2.0.*'
state: 'present'

- name: sudo systemctl enable haproxy.service
systemd:
name: haproxy
state: started
enabled: yes

- name: /etc/haproxy/haproxy.cfg
template:
# src: "{{ role_path }}/templates/openresty/nginx/conf/nginx.conf.j2"
Expand Down
8 changes: 4 additions & 4 deletions templates/alb-strategy/files-local.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ server {
listen {{ alb_openresty_httpsport }} ssl;
server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand All @@ -27,8 +27,8 @@ server {

server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand Down
8 changes: 4 additions & 4 deletions templates/alb-strategy/hello-world.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ server {
listen {{ alb_openresty_httpsport }} ssl;
server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand All @@ -31,8 +31,8 @@ server {

server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand Down
8 changes: 4 additions & 4 deletions templates/alb-strategy/proxy.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ server {
listen {{ alb_openresty_httpsport }} ssl;
server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand Down Expand Up @@ -40,8 +40,8 @@ server {

server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand Down
8 changes: 4 additions & 4 deletions templates/alb-strategy/socket-php.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ server {
listen {{ alb_openresty_httpsport }} ssl;
server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand Down Expand Up @@ -46,8 +46,8 @@ server {

server_name {{ item.app_domain | default(alb_default_app_domain) }};

error_log /var/log/app/{{ app_uid }}/error.log;
access_log /var/log/app/{{ app_uid }}/access.log main;
error_log /var/log/app/{{ item.app_uid }}/error.log;
access_log /var/log/app/{{ item.app_uid }}/access.log main;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
Expand Down

0 comments on commit 32ca5cf

Please sign in to comment.