diff --git a/deployment_scripts/puppet/manifests/director.pp b/deployment_scripts/puppet/manifests/director.pp index a4cdec2..1ce2981 100644 --- a/deployment_scripts/puppet/manifests/director.pp +++ b/deployment_scripts/puppet/manifests/director.pp @@ -37,6 +37,7 @@ $controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nod $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',') $mgmt_net = hiera('management_network_range') $fabric_dev = hiera('fabric_dev') +$md_ip = pick($plumgrid_hash['plumgrid_opsvm']) # Neutron settings $neutron_config = hiera_hash('quantum_settings', {}) @@ -66,6 +67,7 @@ class { 'plumgrid': mgmt_dev => 'br-mgmt', fabric_dev => $fabric_dev, lvm_keypath => "/var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub", + md_ip => $md_ip, } class { 'sal': diff --git a/deployment_scripts/puppet/manifests/edge.pp b/deployment_scripts/puppet/manifests/edge.pp index 4717d31..bf47466 100644 --- a/deployment_scripts/puppet/manifests/edge.pp +++ b/deployment_scripts/puppet/manifests/edge.pp @@ -32,12 +32,14 @@ $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($con $mgmt_net = hiera('management_network_range') $fabric_dev = hiera('fabric_dev') $plumgrid_zone = pick($plumgrid_hash['plumgrid_zone']) +$md_ip = pick($plumgrid_hash['plumgrid_opsvm']) class { 'plumgrid': plumgrid_ip => $controller_ipaddresses, - mgmt_dev => 'br-mgmt', - fabric_dev => $fabric_dev, + mgmt_dev => 'br-mgmt', + fabric_dev => $fabric_dev, lvm_keypath => "/var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub", + md_ip => $md_ip, } class { plumgrid::firewall: diff --git a/deployment_scripts/puppet/manifests/gateway.pp b/deployment_scripts/puppet/manifests/gateway.pp index 4eea773..b36788c 100644 --- a/deployment_scripts/puppet/manifests/gateway.pp +++ b/deployment_scripts/puppet/manifests/gateway.pp @@ -27,6 +27,7 @@ $controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($con $mgmt_net = hiera('management_network_range') $fabric_dev = hiera('fabric_dev') $plumgrid_zone = pick($plumgrid_hash['plumgrid_zone']) +$md_ip = pick($plumgrid_hash['plumgrid_opsvm']) class { 'plumgrid': plumgrid_ip => $controller_ipaddresses, @@ -34,6 +35,7 @@ class { 'plumgrid': fabric_dev => $fabric_dev, gateway_devs => split($plumgrid_gw_devs, ','), lvm_keypath => "/var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub", + md_ip => $md_ip, } class { plumgrid::firewall: diff --git a/deployment_scripts/puppet/modules/plumgrid/manifests/init.pp b/deployment_scripts/puppet/modules/plumgrid/manifests/init.pp index 587bc4b..6bfa377 100644 --- a/deployment_scripts/puppet/modules/plumgrid/manifests/init.pp +++ b/deployment_scripts/puppet/modules/plumgrid/manifests/init.pp @@ -27,6 +27,7 @@ class plumgrid ( $lvm_keypath = '', $mcollective = false, $manage_repo = $plumgrid::params::manage_repo, + $md_ip = '127.0.0.1', $repo_baseurl = '', $repo_component = '', $physical_location = '', @@ -57,6 +58,13 @@ class plumgrid ( before => Service['plumgrid'], } } + if $md_ip != '127.0.0.1' { + file { "${lxc_data_path}/conf/etc/00-pg.conf": + content => template('plumgrid/00-pg.conf.erb'), + require => Package[$pg_package], + notify => Service['plumgrid'], + } + } file { "${lxc_data_path}/conf/etc/hostname": content => $hostname, require => Package[$pg_package], diff --git a/deployment_scripts/puppet/modules/plumgrid/templates/00-pg.conf.erb b/deployment_scripts/puppet/modules/plumgrid/templates/00-pg.conf.erb new file mode 100644 index 0000000..116e8b4 --- /dev/null +++ b/deployment_scripts/puppet/modules/plumgrid/templates/00-pg.conf.erb @@ -0,0 +1,2 @@ +$template ls_json,"{%timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:@source_host%,%msg:::json%}" +:syslogtag,isequal,"pg:" @<%= @md_ip %>:6000;ls_json diff --git a/deployment_scripts/puppet/modules/sal/manifests/init.pp b/deployment_scripts/puppet/modules/sal/manifests/init.pp index df512e6..7e1e5fc 100644 --- a/deployment_scripts/puppet/modules/sal/manifests/init.pp +++ b/deployment_scripts/puppet/modules/sal/manifests/init.pp @@ -17,6 +17,7 @@ class sal ($plumgrid_ip = '', $virtual_ip = '', $rest_port = '9180', $mgmt_dev = '%AUTO_DEV%', + $md_ip = '127.0.0.1', ) { $lxc_root_path = '/var/lib/libvirt/filesystems/plumgrid' $lxc_data_path = '/var/lib/libvirt/filesystems/plumgrid-data' @@ -31,6 +32,7 @@ class sal ($plumgrid_ip = '', class { 'sal::nginx': plumgrid_ip => $plumgrid_ip, + md_ip => $md_ip, virtual_ip => $virtual_ip, } class { 'sal::keepalived': diff --git a/deployment_scripts/puppet/modules/sal/manifests/nginx.pp b/deployment_scripts/puppet/modules/sal/manifests/nginx.pp index e7dc3ab..45f0b39 100644 --- a/deployment_scripts/puppet/modules/sal/manifests/nginx.pp +++ b/deployment_scripts/puppet/modules/sal/manifests/nginx.pp @@ -14,6 +14,7 @@ # limitations under the License. class sal::nginx ($plumgrid_ip = '', + $md_ip = '127.0.0.1', $virtual_ip = '', $use_default_cert = true, ) { diff --git a/deployment_scripts/puppet/modules/sal/templates/default.conf.erb b/deployment_scripts/puppet/modules/sal/templates/default.conf.erb index bb3bbff..e1e6df4 100644 --- a/deployment_scripts/puppet/modules/sal/templates/default.conf.erb +++ b/deployment_scripts/puppet/modules/sal/templates/default.conf.erb @@ -13,7 +13,7 @@ upstream pgCli { } upstream pgMW { - server 127.0.0.1:4000; + server <%= @md_ip %>:4000; } map $http_upgrade $connection_upgrade { diff --git a/environment_config.yaml b/environment_config.yaml index 9de2800..a5e82f3 100644 --- a/environment_config.yaml +++ b/environment_config.yaml @@ -69,7 +69,16 @@ attributes: plumgrid_fabric_network: value: '' label: 'Enter the PLUMgrid Fabric Network' - description: 'Enter the network that will be used by PLUMgrid Fabric (no need to enter subnet)' + description: 'Enter the network that will be used by PLUMgrid Fabric (no need to enter subnet mask)' + weight: 32 + type: "text" + regex: + source: '^((?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})|(?:^)$' + error: "Invalid IP address" + plumgrid_opsvm: + value: '127.0.0.0' + label: 'Enter the OPSVM IP' + description: 'Enter the IP for the OPSVM' weight: 32 type: "text" regex: diff --git a/metadata.yaml b/metadata.yaml index 0abfce0..4c8eb28 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -3,7 +3,7 @@ name: plumgrid # Human-readable name for your plugin title: PLUMgrid plugin # Plugin version -version: '1.0.1' +version: '1.1.0' # Description description: This plugin enables the usage of PLUMgrid ONS as the network backend. # Required fuel version