Browse Source

Merge "Fix access to Zabbix frontend"

Jenkins 1 year ago
parent
commit
801adbd296

+ 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

@@ -125,7 +125,6 @@ class plugin_zabbix::params {
125 125
   #server parameters
126 126
   $vip_name                          = 'zbx_vip_mgmt'
127 127
   $server_ip                         = $network_metadata['vips'][$vip_name]['ipaddr']
128
-  $server_public_ip                  = $network_metadata['vips']['public']['ipaddr']
129 128
   $mgmt_vip                          = $network_metadata['vips']['management']['ipaddr']
130 129
   $server_config                     = "${zabbix_base_conf_dir}/zabbix_server.conf"
131 130
   $server_config_template            = 'plugin_zabbix/zabbix_server.conf.erb'
@@ -184,9 +183,9 @@ class plugin_zabbix::params {
184 183
 
185 184
   #api
186 185
   if $ssl[horizon] == true {
187
-    $api_url = "https://${server_public_ip}${frontend_base}/api_jsonrpc.php"
186
+    $api_url = "https://${mgmt_vip}${frontend_base}/api_jsonrpc.php"
188 187
   }else{
189
-    $api_url = "http://${server_public_ip}${frontend_base}/api_jsonrpc.php"
188
+    $api_url = "http://${mgmt_vip}${frontend_base}/api_jsonrpc.php"
190 189
   }
191 190
 
192 191
   $api_hash = { endpoint => $api_url,

Loading…
Cancel
Save