Fix sensu and sphinx for non-type configuration
diff --git a/haproxy/meta/sensu.yml b/haproxy/meta/sensu.yml
index 65d5ff7..a7b9a91 100644
--- a/haproxy/meta/sensu.yml
+++ b/haproxy/meta/sensu.yml
@@ -27,7 +27,7 @@
{%- else %}
{%- set address = listen.binds.0.address %}
{%- endif %}
-{%- if listen.type in ['general-service', 'openstack-service', 'http', 'contrail-api', 'admin'] %}
+{%- if listen.type|default(None) in ['general-service', 'openstack-service', 'http', 'contrail-api', 'admin'] or listen.mode|default('tcp') == 'http' %}
remote_haproxy_proxy_http_{{ listen_name }}_{{ network.fqdn }}:
command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_http -H {{ address }} -p {{ listen.binds.0.port }} -w 5 -c 10"
interval: 60
@@ -43,4 +43,4 @@
- remote-network
{%- endif %}
{%- endif %}
-{%- endfor %}
\ No newline at end of file
+{%- endfor %}
diff --git a/haproxy/meta/sphinx.yml b/haproxy/meta/sphinx.yml
index 70f2076..c4a5f9a 100644
--- a/haproxy/meta/sphinx.yml
+++ b/haproxy/meta/sphinx.yml
@@ -17,10 +17,15 @@
{%- else %}
{%- set address = listen.binds.0.address %}
{%- endif %}
- {{ listen_name }}_{{ listen.type }}:
+ {{ listen_name }}_{{ listen.type|default(listen.get('mode', 'tcp')) }}:
name: {{ listen_name }}
+ {%- if listen.type is defined %}
type: {{ listen.type }}
+ {%- else %}
+ mode: {{ listen.mode|default('tcp') }}
+ {%- endif %}
{%- if listen.type in ['general-service', 'openstack-service', 'http', 'contrail-api', 'admin'] %}
+ {%- if listen.type|default(None) in ['general-service', 'openstack-service', 'http', 'contrail-api', 'admin'] or listen.mode|default('tcp') == 'http' %}
address: "http://{{ listen.binds.0.address }}:{{ listen.binds.0.port }}/"
protocol: http
{%- else %}
@@ -28,4 +33,4 @@
protocol: tcp
{%- endif %}
{%- endif %}
- {%- endfor %}
\ No newline at end of file
+ {%- endfor %}