Skip to content

Commit b3559c8

Browse files
committed
add vars and ports for haproxy
1 parent 79fa4ab commit b3559c8

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

olam/default_vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ add_pah_ports: false
2929
use_freeipa: false
3030
use_git: false
3131
add_cluster_ports: false
32+
use_haproxy: false
33+
add_haproxy_ports: false
3234

3335
use_kvm: false
3436
create_vm: false

olam/templates/ingress_security_rules.j2

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,24 @@ instance_ingress_security_rules:
7979
destination_port_range:
8080
max: 27199
8181
min: 27199
82-
{% endif %}
82+
{% endif %}
83+
{% if add_haproxy_ports %}
84+
- source: "10.0.0.0/24"
85+
protocol: 6
86+
tcp_options:
87+
destination_port_range:
88+
max: 80
89+
min: 80
90+
- source: "10.0.0.0/24"
91+
protocol: 6
92+
tcp_options:
93+
destination_port_range:
94+
max: 443
95+
min: 443
96+
- source: "10.0.0.0/24"
97+
protocol: 6
98+
tcp_options:
99+
destination_port_range:
100+
max: 8080
101+
min: 8080
102+
{% endif %}

olam/templates/nginx.conf.j2

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,31 @@ http {
4242
# for more information.
4343
include /etc/nginx/conf.d/*.conf;
4444

45+
{% if use_haproxy %}
46+
server {
47+
listen 8080 default_server;
48+
listen [::]:8080 default_server;
49+
server_name _;
50+
root /usr/share/nginx/html;
51+
52+
# Load configuration files for the default server block.
53+
include /etc/nginx/default.d/*.conf;
54+
55+
# OCI LB health check
56+
location /nginx-health {
57+
access_log off;
58+
add_header 'Content-Type' 'text/plain';
59+
return 200 "healthy\n";
60+
}
61+
62+
location /health {
63+
access_log off;
64+
add_header 'Content-Type' 'application/json';
65+
return 200 '{"status":"UP"}';
66+
}
67+
}
68+
{% endif %}
69+
4570
# server {
4671
# listen 80 default_server;
4772
# listen [::]:80 default_server;

0 commit comments

Comments
 (0)