Puppet4 support: use dig44 function
Replace "dig" with "dig44" because of the conflict with builtin "dig" function of Puppet4.5+ Change-Id: I9efbc956f8230f920a52944432875d4a6338f42b Related-Bug: 1586480
This commit is contained in:
parent
7353c79d87
commit
0bfc6fdcc3
|
@ -47,4 +47,4 @@ firewallchain {'nova-api-postrouting-bottom:nat:IPv4':
|
|||
ensure => present,
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,12 +36,12 @@ class openstack_tasks::horizon::horizon {
|
|||
# of the MOS package set. This should be contributed upstream and then we can
|
||||
# use this as the default.
|
||||
#if !$::os_package_type or $::os_package_type == 'debian' {
|
||||
# $cache_backend = dig($horizon_hash, ['cache_backend'], 'horizon.backends.memcached.HorizonMemcached')
|
||||
# $cache_backend = dig44($horizon_hash, ['cache_backend'], 'horizon.backends.memcached.HorizonMemcached')
|
||||
#} else {
|
||||
# $cache_backend = dig($horizon_hash, ['cache_backend'], 'django.core.cache.backends.memcached.MemcachedCache')
|
||||
# $cache_backend = dig44($horizon_hash, ['cache_backend'], 'django.core.cache.backends.memcached.MemcachedCache')
|
||||
#}
|
||||
# Don't use custom backend until its code lands to MOS 9.0.
|
||||
$cache_backend = dig($horizon_hash, ['cache_backend'], 'django.core.cache.backends.memcached.MemcachedCache')
|
||||
$cache_backend = dig44($horizon_hash, ['cache_backend'], 'django.core.cache.backends.memcached.MemcachedCache')
|
||||
|
||||
#Changing from internal addressing to public should resolve any security concerns about exposing 'internal' to public facing login.
|
||||
#However, this should eventually be removed altogether from Horizon.
|
||||
|
|
|
@ -11,10 +11,10 @@ class openstack_tasks::openstack_network::agents::dhcp {
|
|||
$debug = hiera('debug', true)
|
||||
$resync_interval = '30'
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$isolated_metadata = dig($neutron_config, ['metadata', 'isolated_metadata'], true)
|
||||
$isolated_metadata = dig44($neutron_config, ['metadata', 'isolated_metadata'], true)
|
||||
|
||||
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
|
||||
$ha_agent = dig($neutron_advanced_config, ['dhcp_agent_ha'], true)
|
||||
$ha_agent = dig44($neutron_advanced_config, ['dhcp_agent_ha'], true)
|
||||
|
||||
class { '::neutron::agents::dhcp':
|
||||
debug => $debug,
|
||||
|
|
|
@ -36,7 +36,7 @@ class openstack_tasks::openstack_network::agents::l3 {
|
|||
|
||||
prepare_network_config($network_scheme)
|
||||
|
||||
$ha_agent = dig($neutron_advanced_config, ['l3_agent_ha'], true)
|
||||
$ha_agent = dig44($neutron_advanced_config, ['l3_agent_ha'], true)
|
||||
|
||||
class { '::neutron::agents::l3':
|
||||
debug => $debug,
|
||||
|
|
|
@ -29,10 +29,10 @@ class openstack_tasks::openstack_network::agents::metadata {
|
|||
|
||||
if $controller or ($dvr and $compute) {
|
||||
$debug = hiera('debug', true)
|
||||
$ha_agent = dig($neutron_advanced_config, ['metadata_agent_ha'], true)
|
||||
$ha_agent = dig44($neutron_advanced_config, ['metadata_agent_ha'], true)
|
||||
$service_endpoint = hiera('service_endpoint')
|
||||
$management_vip = hiera('management_vip')
|
||||
$shared_secret = dig($neutron_config, ['metadata', 'metadata_proxy_shared_secret'])
|
||||
$shared_secret = dig44($neutron_config, ['metadata', 'metadata_proxy_shared_secret'])
|
||||
$nova_endpoint = hiera('nova_endpoint', $management_vip)
|
||||
$nova_metadata_protocol = hiera('nova_metadata_protocol', 'http')
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
|
|
@ -47,7 +47,7 @@ class openstack_tasks::openstack_network::common_config {
|
|||
|
||||
$kombu_compression = hiera('kombu_compression', $::os_service_default)
|
||||
|
||||
$segmentation_type = dig($neutron_config, ['L2', 'segmentation_type'])
|
||||
$segmentation_type = dig44($neutron_config, ['L2', 'segmentation_type'])
|
||||
|
||||
$nets = $neutron_config['predefined_networks']
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ class openstack_tasks::openstack_network::compute_nova {
|
|||
|
||||
$management_vip = hiera('management_vip')
|
||||
$service_endpoint = hiera('service_endpoint', $management_vip)
|
||||
$admin_password = dig($neutron_config, ['keystone', 'admin_password'])
|
||||
$admin_tenant_name = dig($neutron_config, ['keystone', 'admin_tenant'], 'services')
|
||||
$admin_username = dig($neutron_config, ['keystone', 'admin_user'], 'neutron')
|
||||
$admin_password = dig44($neutron_config, ['keystone', 'admin_password'])
|
||||
$admin_tenant_name = dig44($neutron_config, ['keystone', 'admin_tenant'], 'services')
|
||||
$admin_username = dig44($neutron_config, ['keystone', 'admin_user'], 'neutron')
|
||||
$region_name = hiera('region', 'RegionOne')
|
||||
$auth_api_version = 'v3'
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
|
|
@ -5,43 +5,43 @@ class openstack_tasks::openstack_network::networks {
|
|||
$access_hash = hiera_hash('access', {})
|
||||
$keystone_admin_tenant = $access_hash['tenant']
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$floating_net = dig($neutron_config, ['default_floating_net'], 'net04_ext')
|
||||
$private_net = dig($neutron_config, ['default_private_net'], 'net04')
|
||||
$default_router = dig($neutron_config, ['default_router'], 'router04')
|
||||
$segmentation_type = dig($neutron_config, ['L2', 'segmentation_type'])
|
||||
$floating_net = dig44($neutron_config, ['default_floating_net'], 'net04_ext')
|
||||
$private_net = dig44($neutron_config, ['default_private_net'], 'net04')
|
||||
$default_router = dig44($neutron_config, ['default_router'], 'router04')
|
||||
$segmentation_type = dig44($neutron_config, ['L2', 'segmentation_type'])
|
||||
$nets = $neutron_config['predefined_networks']
|
||||
|
||||
if $segmentation_type == 'vlan' {
|
||||
$network_type = 'vlan'
|
||||
$segmentation_id_range = split(dig($neutron_config, ['L2', 'phys_nets', 'physnet2', 'vlan_range'], ''), ':')
|
||||
$segmentation_id_range = split(dig44($neutron_config, ['L2', 'phys_nets', 'physnet2', 'vlan_range'], ''), ':')
|
||||
} elsif $segmentation_type == 'gre' {
|
||||
$network_type = 'gre'
|
||||
$segmentation_id_range = split(dig($neutron_config, ['L2', 'tunnel_id_ranges'], ''), ':')
|
||||
$segmentation_id_range = split(dig44($neutron_config, ['L2', 'tunnel_id_ranges'], ''), ':')
|
||||
} else {
|
||||
$network_type = 'vxlan'
|
||||
$segmentation_id_range = split(dig($neutron_config, ['L2', 'tunnel_id_ranges'], ''), ':')
|
||||
$segmentation_id_range = split(dig44($neutron_config, ['L2', 'tunnel_id_ranges'], ''), ':')
|
||||
}
|
||||
|
||||
$fallback_segment_id = $segmentation_id_range[0]
|
||||
$private_net_segment_id = dig($nets, [$private_net, 'L2', 'segment_id'], $fallback_segment_id)
|
||||
$private_net_physnet = dig($nets, [$private_net, 'L2', 'physnet'], false)
|
||||
$private_net_shared = dig($nets, [$private_net, 'shared'], false)
|
||||
$private_net_segment_id = dig44($nets, [$private_net, 'L2', 'segment_id'], $fallback_segment_id)
|
||||
$private_net_physnet = dig44($nets, [$private_net, 'L2', 'physnet'], false)
|
||||
$private_net_shared = dig44($nets, [$private_net, 'shared'], false)
|
||||
$private_net_router_external = false
|
||||
$floating_net_type = dig($nets, [$floating_net, 'L2', 'network_type'], 'local')
|
||||
$floating_net_type = dig44($nets, [$floating_net, 'L2', 'network_type'], 'local')
|
||||
$floating_net_physnet = $floating_net_type ? {
|
||||
'local' => false,
|
||||
default => dig($nets, [$floating_net, 'L2', 'physnet'], false),
|
||||
default => dig44($nets, [$floating_net, 'L2', 'physnet'], false),
|
||||
}
|
||||
$floating_net_router_external = dig($nets, [$floating_net, 'L2', 'router_ext'])
|
||||
$floating_net_floating_range = dig($nets, [$floating_net, 'L3', 'floating'], '')
|
||||
$floating_net_shared = dig($nets, [$floating_net, 'shared'], false)
|
||||
$floating_net_router_external = dig44($nets, [$floating_net, 'L2', 'router_ext'])
|
||||
$floating_net_floating_range = dig44($nets, [$floating_net, 'L3', 'floating'], '')
|
||||
$floating_net_shared = dig44($nets, [$floating_net, 'shared'], false)
|
||||
|
||||
if !empty($floating_net_floating_range) {
|
||||
$floating_cidr = dig($nets, [$floating_net, 'L3', 'subnet'])
|
||||
$floating_cidr = dig44($nets, [$floating_net, 'L3', 'subnet'])
|
||||
$floating_net_allocation_pool = format_allocation_pools($floating_net_floating_range, $floating_cidr)
|
||||
}
|
||||
|
||||
$tenant_name = dig($access_hash, ['tenant'], 'admin')
|
||||
$tenant_name = dig44($access_hash, ['tenant'], 'admin')
|
||||
|
||||
neutron_network { $floating_net :
|
||||
ensure => 'present',
|
||||
|
@ -54,10 +54,10 @@ class openstack_tasks::openstack_network::networks {
|
|||
|
||||
neutron_subnet { "${floating_net}__subnet" :
|
||||
ensure => 'present',
|
||||
cidr => dig($nets, [$floating_net, 'L3', 'subnet']),
|
||||
cidr => dig44($nets, [$floating_net, 'L3', 'subnet']),
|
||||
network_name => $floating_net,
|
||||
tenant_name => $tenant_name,
|
||||
gateway_ip => dig($nets, [$floating_net, 'L3', 'gateway']),
|
||||
gateway_ip => dig44($nets, [$floating_net, 'L3', 'gateway']),
|
||||
enable_dhcp => false,
|
||||
allocation_pools => $floating_net_allocation_pool,
|
||||
}
|
||||
|
@ -74,19 +74,19 @@ class openstack_tasks::openstack_network::networks {
|
|||
|
||||
neutron_subnet { "${private_net}__subnet" :
|
||||
ensure => 'present',
|
||||
cidr => dig($nets, [$private_net, 'L3', 'subnet']),
|
||||
cidr => dig44($nets, [$private_net, 'L3', 'subnet']),
|
||||
network_name => $private_net,
|
||||
tenant_name => $tenant_name,
|
||||
gateway_ip => dig($nets, [$private_net, 'L3', 'gateway']),
|
||||
gateway_ip => dig44($nets, [$private_net, 'L3', 'gateway']),
|
||||
enable_dhcp => true,
|
||||
dns_nameservers => dig($nets, [$private_net, 'L3', 'nameservers']),
|
||||
dns_nameservers => dig44($nets, [$private_net, 'L3', 'nameservers']),
|
||||
}
|
||||
|
||||
if has_key($nets, 'baremetal') {
|
||||
$baremetal_physnet = dig($nets, ['baremetal', 'L2', 'physnet'], false)
|
||||
$baremetal_segment_id = dig($nets, ['baremetal', 'L2', 'segment_id'])
|
||||
$baremetal_router_external = dig($nets, ['baremetal', 'L2', 'router_ext'])
|
||||
$baremetal_shared = dig($nets, ['baremetal', 'shared'], false)
|
||||
$baremetal_physnet = dig44($nets, ['baremetal', 'L2', 'physnet'], false)
|
||||
$baremetal_segment_id = dig44($nets, ['baremetal', 'L2', 'segment_id'])
|
||||
$baremetal_router_external = dig44($nets, ['baremetal', 'L2', 'router_ext'])
|
||||
$baremetal_shared = dig44($nets, ['baremetal', 'shared'], false)
|
||||
|
||||
neutron_network { 'baremetal' :
|
||||
ensure => 'present',
|
||||
|
@ -100,13 +100,13 @@ class openstack_tasks::openstack_network::networks {
|
|||
|
||||
neutron_subnet { 'baremetal__subnet' :
|
||||
ensure => 'present',
|
||||
cidr => dig($nets, ['baremetal', 'L3', 'subnet']),
|
||||
cidr => dig44($nets, ['baremetal', 'L3', 'subnet']),
|
||||
network_name => 'baremetal',
|
||||
tenant_name => $tenant_name,
|
||||
gateway_ip => dig($nets, ['baremetal', 'L3', 'gateway']),
|
||||
gateway_ip => dig44($nets, ['baremetal', 'L3', 'gateway']),
|
||||
enable_dhcp => true,
|
||||
dns_nameservers => dig($nets, ['baremetal', 'L3', 'nameservers']),
|
||||
allocation_pools => format_allocation_pools(dig($nets, ['baremetal', 'L3', 'floating'])),
|
||||
dns_nameservers => dig44($nets, ['baremetal', 'L3', 'nameservers']),
|
||||
allocation_pools => format_allocation_pools(dig44($nets, ['baremetal', 'L3', 'floating'])),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,10 +42,10 @@ class openstack_tasks::openstack_network::plugins::ml2 {
|
|||
prepare_network_config($network_scheme)
|
||||
|
||||
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
|
||||
$l2_population = dig($neutron_advanced_config, ['neutron_l2_pop'], false)
|
||||
$dvr = dig($neutron_advanced_config, ['neutron_dvr'], false)
|
||||
$l2_population = dig44($neutron_advanced_config, ['neutron_l2_pop'], false)
|
||||
$dvr = dig44($neutron_advanced_config, ['neutron_dvr'], false)
|
||||
$enable_qos = pick($neutron_advanced_config['neutron_qos'], false)
|
||||
$segmentation_type = dig($neutron_config, ['L2', 'segmentation_type'])
|
||||
$segmentation_type = dig44($neutron_config, ['L2', 'segmentation_type'])
|
||||
|
||||
if $compute and ! $dvr {
|
||||
$do_floating = false
|
||||
|
@ -160,7 +160,7 @@ class openstack_tasks::openstack_network::plugins::ml2 {
|
|||
refreshonly => true,
|
||||
}
|
||||
|
||||
$ha_agent = dig($neutron_advanced_config, ['l2_agent_ha'], true)
|
||||
$ha_agent = dig44($neutron_advanced_config, ['l2_agent_ha'], true)
|
||||
if $ha_agent {
|
||||
#Exec<| title == 'waiting-for-neutron-api' |> ->
|
||||
class { '::cluster::neutron::ovs' :
|
||||
|
|
|
@ -13,10 +13,10 @@ class openstack_tasks::openstack_network::routers {
|
|||
$access_hash = hiera_hash('access', {})
|
||||
$keystone_admin_tenant = pick($access_hash['tenant'], 'admin')
|
||||
$neutron_config = hiera_hash('neutron_config')
|
||||
$floating_net = dig($neutron_config, ['default_floating_net'], 'net04_ext')
|
||||
$private_net = dig($neutron_config, ['default_private_net'], 'net04')
|
||||
$default_router = dig($neutron_config, ['default_router'], 'router04')
|
||||
$baremetal_router = dig($neutron_config, ['baremetal_router'], 'baremetal')
|
||||
$floating_net = dig44($neutron_config, ['default_floating_net'], 'net04_ext')
|
||||
$private_net = dig44($neutron_config, ['default_private_net'], 'net04')
|
||||
$default_router = dig44($neutron_config, ['default_router'], 'router04')
|
||||
$baremetal_router = dig44($neutron_config, ['baremetal_router'], 'baremetal')
|
||||
$nets = $neutron_config['predefined_networks']
|
||||
|
||||
if ($l3_ha) and ($controllers_num < 2) {
|
||||
|
|
|
@ -30,9 +30,9 @@ class openstack_tasks::openstack_network::server_config {
|
|||
|
||||
$db_type = 'mysql'
|
||||
$db_password = $neutron_config['database']['passwd']
|
||||
$db_user = dig($neutron_config, ['database', 'user'], 'neutron')
|
||||
$db_name = dig($neutron_config, ['database', 'name'], 'neutron')
|
||||
$db_host = dig($neutron_config, ['database', 'host'], $database_vip)
|
||||
$db_user = dig44($neutron_config, ['database', 'user'], 'neutron')
|
||||
$db_name = dig44($neutron_config, ['database', 'name'], 'neutron')
|
||||
$db_host = dig44($neutron_config, ['database', 'host'], $database_vip)
|
||||
# LP#1526938 - python-mysqldb supports this, python-pymysql does not
|
||||
if $::os_package_type == 'debian' {
|
||||
$extra_params = { 'charset' => 'utf8', 'read_timeout' => 60 }
|
||||
|
@ -81,7 +81,7 @@ class openstack_tasks::openstack_network::server_config {
|
|||
$service_workers = pick($neutron_config['workers'], min(max($::processorcount, 1), $workers_max))
|
||||
|
||||
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })
|
||||
$l2_population = dig($neutron_advanced_config, ['neutron_l2_pop'], false)
|
||||
$l2_population = dig44($neutron_advanced_config, ['neutron_l2_pop'], false)
|
||||
$dvr = pick($neutron_advanced_config['neutron_dvr'], false)
|
||||
$l3_ha = pick($neutron_advanced_config['neutron_l3_ha'], false)
|
||||
$l3agent_failover = $l3_ha ? { true => false, default => true}
|
||||
|
@ -103,9 +103,9 @@ class openstack_tasks::openstack_network::server_config {
|
|||
$default_mechanism_drivers = ['openvswitch']
|
||||
$l2_population_mech_driver = $l2_population ? { true => ['l2population'], default => []}
|
||||
$sriov_mech_driver = $use_sriov ? { true => ['sriovnicswitch'], default => []}
|
||||
$mechanism_drivers = delete(dig($neutron_config, ['L2', 'mechanism_drivers'], concat($default_mechanism_drivers,$l2_population_mech_driver,$sriov_mech_driver)), '')
|
||||
$mechanism_drivers = delete(dig44($neutron_config, ['L2', 'mechanism_drivers'], concat($default_mechanism_drivers,$l2_population_mech_driver,$sriov_mech_driver)), '')
|
||||
$flat_networks = ['*']
|
||||
$segmentation_type = dig($neutron_config, ['L2', 'segmentation_type'])
|
||||
$segmentation_type = dig44($neutron_config, ['L2', 'segmentation_type'])
|
||||
|
||||
$network_scheme = hiera_hash('network_scheme', {})
|
||||
prepare_network_config($network_scheme)
|
||||
|
@ -119,7 +119,7 @@ class openstack_tasks::openstack_network::server_config {
|
|||
Class['::neutron::plugins::ml2'] -> Augeas['/etc/default/neutron-server:ml2_sriov_config']
|
||||
}
|
||||
|
||||
$_path_mtu = dig($neutron_config, ['L2', 'path_mtu'], undef)
|
||||
$_path_mtu = dig44($neutron_config, ['L2', 'path_mtu'], undef)
|
||||
|
||||
if $segmentation_type == 'vlan' {
|
||||
$net_role_property = 'neutron/private'
|
||||
|
@ -146,7 +146,7 @@ class openstack_tasks::openstack_network::server_config {
|
|||
$net_role_property = 'neutron/mesh'
|
||||
$tunneling_ip = get_network_role_property($net_role_property, 'ipaddr')
|
||||
$iface = get_network_role_property($net_role_property, 'phys_dev')
|
||||
$tunnel_id_ranges = [dig($neutron_config, ['L2', 'tunnel_id_ranges'])]
|
||||
$tunnel_id_ranges = [dig44($neutron_config, ['L2', 'tunnel_id_ranges'])]
|
||||
$physical_network_mtus = generate_physnet_mtus($neutron_config, $network_scheme, {
|
||||
'do_floating' => $do_floating,
|
||||
'do_tenant' => false,
|
||||
|
|
|
@ -6,9 +6,9 @@ class openstack_tasks::openstack_network::server_nova {
|
|||
$management_vip = hiera('management_vip')
|
||||
$service_endpoint = hiera('service_endpoint', $management_vip)
|
||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||
$admin_password = dig($neutron_config, ['keystone', 'admin_password'])
|
||||
$admin_tenant_name = dig($neutron_config, ['keystone', 'admin_tenant'], 'services')
|
||||
$admin_username = dig($neutron_config, ['keystone', 'admin_user'], 'neutron')
|
||||
$admin_password = dig44($neutron_config, ['keystone', 'admin_password'])
|
||||
$admin_tenant_name = dig44($neutron_config, ['keystone', 'admin_tenant'], 'services')
|
||||
$admin_username = dig44($neutron_config, ['keystone', 'admin_user'], 'neutron')
|
||||
$region_name = hiera('region', 'RegionOne')
|
||||
$auth_api_version = 'v3'
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
|
|
@ -9,4 +9,4 @@ define openstack_tasks::swift::parts::device_directory($devices) {
|
|||
recurselimit => 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,4 +53,4 @@ class openstack_tasks::swift::parts::rebalance_cronjob(
|
|||
minute => '25',
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Puppet::Parser::Functions
|
||||
newfunction(
|
||||
:fetch_value,
|
||||
:dig44,
|
||||
:type => :rvalue,
|
||||
:arity => -2,
|
||||
:doc => <<-eos
|
||||
|
@ -36,18 +36,18 @@ missing. And the fourth argument can set a variable path separator.
|
|||
eos
|
||||
) do |arguments|
|
||||
# Two arguments are required
|
||||
raise(Puppet::ParseError, "fetch_value(): Wrong number of arguments " +
|
||||
raise(Puppet::ParseError, "dig44(): Wrong number of arguments " +
|
||||
"given (#{arguments.size} for at least 2)") if arguments.size < 2
|
||||
|
||||
data, path, default = *arguments
|
||||
|
||||
unless data.is_a?(Hash) or data.is_a?(Array)
|
||||
raise(Puppet::ParseError, "fetch_value(): first argument must be a hash or an array, " <<
|
||||
raise(Puppet::ParseError, "dig44(): first argument must be a hash or an array, " <<
|
||||
"given #{data.class.name}")
|
||||
end
|
||||
|
||||
unless path.is_a? Array
|
||||
raise(Puppet::ParseError, "fetch_value(): second argument must be an array, " <<
|
||||
raise(Puppet::ParseError, "dig44(): second argument must be an array, " <<
|
||||
"given #{path.class.name}")
|
||||
end
|
||||
|
|
@ -255,16 +255,16 @@ class osnailyfacter::globals::globals {
|
|||
|
||||
$vips = $network_metadata['vips']
|
||||
|
||||
$public_vip = dig($vips, ['public', 'ipaddr'],
|
||||
$public_vip = dig44($vips, ['public', 'ipaddr'],
|
||||
get_network_role_property('public/vip', 'ipaddr')
|
||||
)
|
||||
$management_vip = dig($vips, ['management', 'ipaddr'],
|
||||
$management_vip = dig44($vips, ['management', 'ipaddr'],
|
||||
get_network_role_property('mgmt/vip', 'ipaddr')
|
||||
)
|
||||
$public_vrouter_vip = dig($vips, ['vrouter_pub', 'ipaddr'], undef)
|
||||
$management_vrouter_vip = dig($vips, ['vrouter', 'ipaddr'], undef)
|
||||
$database_vip = dig($vips, ['database', 'ipaddr'], $management_vip)
|
||||
$service_endpoint = dig($vips, ['service_endpoint', 'ipaddr'], $management_vip)
|
||||
$public_vrouter_vip = dig44($vips, ['vrouter_pub', 'ipaddr'], undef)
|
||||
$management_vrouter_vip = dig44($vips, ['vrouter', 'ipaddr'], undef)
|
||||
$database_vip = dig44($vips, ['database', 'ipaddr'], $management_vip)
|
||||
$service_endpoint = dig44($vips, ['service_endpoint', 'ipaddr'], $management_vip)
|
||||
|
||||
$neutron_config = hiera_hash('quantum_settings')
|
||||
$network_provider = 'neutron'
|
||||
|
|
|
@ -19,25 +19,25 @@ class osnailyfacter::ssl::ssl_dns_setup {
|
|||
$public_vip = hiera('public_vip')
|
||||
$management_vip = hiera('management_vip')
|
||||
|
||||
$public_hostname = dig($ssl_hash, ["${service}_public_hostname"], '')
|
||||
$internal_hostname = dig($ssl_hash, ["${service}_internal_hostname"], '')
|
||||
$admin_hostname = dig($ssl_hash, ["${service}_admin_hostname"], $internal_hostname)
|
||||
$public_hostname = dig44($ssl_hash, ["${service}_public_hostname"], '')
|
||||
$internal_hostname = dig44($ssl_hash, ["${service}_internal_hostname"], '')
|
||||
$admin_hostname = dig44($ssl_hash, ["${service}_admin_hostname"], $internal_hostname)
|
||||
|
||||
$service_public_ip = dig($ssl_hash, ["${service}_public_ip"], '')
|
||||
$service_public_ip = dig44($ssl_hash, ["${service}_public_ip"], '')
|
||||
if !empty($service_public_ip) {
|
||||
$public_ip = $service_public_ip
|
||||
} else {
|
||||
$public_ip = $public_vip
|
||||
}
|
||||
|
||||
$service_internal_ip = dig($ssl_hash, ["${service}_internal_ip"], '')
|
||||
$service_internal_ip = dig44($ssl_hash, ["${service}_internal_ip"], '')
|
||||
if !empty($service_internal_ip) {
|
||||
$internal_ip = $service_internal_ip
|
||||
} else {
|
||||
$internal_ip = $management_vip
|
||||
}
|
||||
|
||||
$service_admin_ip = dig($ssl_hash, ["${service}_admin_ip"], '')
|
||||
$service_admin_ip = dig44($ssl_hash, ["${service}_admin_ip"], '')
|
||||
if !empty($service_admin_ip) {
|
||||
$admin_ip = $service_admin_ip
|
||||
} else {
|
||||
|
|
|
@ -4,7 +4,7 @@ class osnailyfacter::ssl::ssl_keys_saving {
|
|||
|
||||
$public_ssl_hash = hiera_hash('public_ssl')
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
$pub_certificate_content = dig($public_ssl_hash, ['cert_data', 'content'], '')
|
||||
$pub_certificate_content = dig44($public_ssl_hash, ['cert_data', 'content'], '')
|
||||
$base_path = '/etc/pki/tls/certs'
|
||||
$pki_path = [ '/etc/pki', '/etc/pki/tls' ]
|
||||
$astute_base_path = '/var/lib/astute/haproxy'
|
||||
|
@ -28,15 +28,15 @@ class osnailyfacter::ssl::ssl_keys_saving {
|
|||
){
|
||||
$service = $name
|
||||
|
||||
$public_service = dig($ssl_hash, ["${service}_public"], false)
|
||||
$public_usercert = dig($ssl_hash, ["${service}_public_usercert"], false)
|
||||
$public_certdata = dig($ssl_hash, ["${service}_public_certdata", 'content'], '')
|
||||
$internal_service = dig($ssl_hash, ["${service}_internal"], false)
|
||||
$internal_usercert = dig($ssl_hash, ["${service}_internal_usercert"], false)
|
||||
$internal_certdata = dig($ssl_hash, ["${service}_internal_certdata", 'content'], '')
|
||||
$admin_service = dig($ssl_hash, ["${service}_admin"], false)
|
||||
$admin_usercert = dig($ssl_hash, ["${service}_admin_usercert"], false)
|
||||
$admin_certdata = dig($ssl_hash, ["${service}_admin_certdata", 'content'], '')
|
||||
$public_service = dig44($ssl_hash, ["${service}_public"], false)
|
||||
$public_usercert = dig44($ssl_hash, ["${service}_public_usercert"], false)
|
||||
$public_certdata = dig44($ssl_hash, ["${service}_public_certdata", 'content'], '')
|
||||
$internal_service = dig44($ssl_hash, ["${service}_internal"], false)
|
||||
$internal_usercert = dig44($ssl_hash, ["${service}_internal_usercert"], false)
|
||||
$internal_certdata = dig44($ssl_hash, ["${service}_internal_certdata", 'content'], '')
|
||||
$admin_service = dig44($ssl_hash, ["${service}_admin"], false)
|
||||
$admin_usercert = dig44($ssl_hash, ["${service}_admin_usercert"], false)
|
||||
$admin_certdata = dig44($ssl_hash, ["${service}_admin_certdata", 'content'], '')
|
||||
|
||||
if $ssl_hash["${service}"] {
|
||||
if $public_service and $public_usercert and !empty($public_certdata) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'fetch_value' do
|
||||
describe 'dig44' do
|
||||
|
||||
let(:data) do
|
||||
{
|
Loading…
Reference in New Issue