Browse Source

Fix access to Zabbix frontend

Change-Id: I88bb645dc9a59d4ecbc3af2d2fc56b6a0d105539
Olivier Bourdon 2 years ago
parent
commit
c788a732ab

+ 15
- 0
deployment_scripts/puppet/modules/plugin_zabbix/manifests/ha/haproxy.pp View File

@@ -24,6 +24,7 @@ class plugin_zabbix::ha::haproxy {
24 24
   $public_vip = hiera('public_vip')
25 25
   $ssl = hiera('public_ssl')
26 26
   $zabbix_vip = $plugin_zabbix::params::server_ip
27
+  $mgmt_vip = $plugin_zabbix::params::mgmt_vip
27 28
   $network_metadata  = hiera_hash('network_metadata')
28 29
   $primary_controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller'])
29 30
   $controllers = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
@@ -76,6 +77,13 @@ class plugin_zabbix::ha::haproxy {
76 77
         line   => "  bind ${zabbix_vip}:443 ssl crt /var/lib/astute/haproxy/public_haproxy.pem",
77 78
         notify => Exec['haproxy-restart']
78 79
       }
80
+      ->
81
+      file_line { 'add binding to management VIP for horizon and zabbix via ssl':
82
+        path   => '/etc/haproxy/conf.d/017-horizon-ssl.cfg',
83
+        after  => 'listen horizon-ssl',
84
+        line   => "  bind ${mgmt_vip}:443 ssl crt /var/lib/astute/haproxy/public_haproxy.pem",
85
+        notify => Exec['haproxy-restart']
86
+      }
79 87
     }else{
80 88
       openstack::ha::haproxy_service { 'zabbix-ui':
81 89
         order                  => '211',
@@ -113,6 +121,13 @@ class plugin_zabbix::ha::haproxy {
113 121
         line   => "  bind ${zabbix_vip}:443 ssl crt /var/lib/astute/haproxy/public_haproxy.pem",
114 122
         notify => Exec['haproxy-restart'],
115 123
       }
124
+      ->
125
+      file_line { 'add binding to management VIP for zabbix via ssl':
126
+        path   => '/etc/haproxy/conf.d/212-zabbix-ui-ssl.cfg',
127
+        after  => 'listen zabbix-ui-ssl',
128
+        line   => "  bind ${mgmt_vip}:443 ssl crt /var/lib/astute/haproxy/public_haproxy.pem",
129
+        notify => Exec['haproxy-restart'],
130
+      }
116 131
     }
117 132
   }else{
118 133
     if $horizon_is_here {

+ 2
- 3
deployment_scripts/puppet/modules/plugin_zabbix/manifests/params.pp View File

@@ -116,7 +116,6 @@ class plugin_zabbix::params {
116 116
   #server parameters
117 117
   $vip_name                          = 'zbx_vip_mgmt'
118 118
   $server_ip                         = $network_metadata['vips'][$vip_name]['ipaddr']
119
-  $server_public_ip                  = $network_metadata['vips']['public']['ipaddr']
120 119
   $mgmt_vip                          = $network_metadata['vips']['management']['ipaddr']
121 120
   $server_config                     = "${zabbix_base_conf_dir}/zabbix_server.conf"
122 121
   $server_config_template            = 'plugin_zabbix/zabbix_server.conf.erb'
@@ -175,9 +174,9 @@ class plugin_zabbix::params {
175 174
 
176 175
   #api
177 176
   if $ssl[horizon] == true {
178
-    $api_url = "https://${server_public_ip}${frontend_base}/api_jsonrpc.php"
177
+    $api_url = "https://${mgmt_vip}${frontend_base}/api_jsonrpc.php"
179 178
   }else{
180
-    $api_url = "http://${server_public_ip}${frontend_base}/api_jsonrpc.php"
179
+    $api_url = "http://${mgmt_vip}${frontend_base}/api_jsonrpc.php"
181 180
   }
182 181
 
183 182
   $api_hash = { endpoint => $api_url,

Loading…
Cancel
Save