Replace usage hiera() to hiera_hash() for all network_scheme lookups

Lokup by hiera() makes impossible to change network_scheme from plugin tasks.

Change-Id: I9f034906bb382db13c83e5d320e33800357d72b7
Closes-bug: #1535679
This commit is contained in:
Sergey Vasilenko 2016-01-19 14:50:44 +03:00
parent 07abee63a7
commit 9d6647d561
37 changed files with 48 additions and 48 deletions

View File

@ -41,7 +41,7 @@ $ha_mode = pick($ceilometer_hash['ha_mode'], true)
$ssl_hash = hiera_hash('use_ssl', {})
$service_workers = pick($ceilometer_hash['workers'], min(max($::processorcount, 2), 16))
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$api_bind_address = get_network_role_property('ceilometer/api', 'ipaddr')
$keystone_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http')

View File

@ -13,7 +13,7 @@ $use_monit = false
$auto_assign_floating_ip = hiera('auto_assign_floating_ip', false)
$keystone_hash = hiera('keystone', {})
$access_hash = hiera('access', {})
$network_scheme = hiera_hash('network_scheme')
$network_scheme = hiera_hash('network_scheme', {})
$neutron_mellanox = hiera('neutron_mellanox', false)
$syslog_hash = hiera('syslog', {})
$use_syslog = hiera('use_syslog', true)

View File

@ -40,7 +40,7 @@ if $use_ceph {
$primary_mons = keys($ceph_primary_monitor_node)
$primary_mon = $ceph_primary_monitor_node[$primary_mons[0]]['name']
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config(hiera_hash('network_scheme', {}))
$ceph_cluster_network = get_network_role_property('ceph/replication', 'network')
$ceph_public_network = get_network_role_property('ceph/public', 'network')

View File

@ -32,7 +32,7 @@ if $use_ceph {
$primary_mons = keys($ceph_primary_monitor_node)
$primary_mon = $ceph_primary_monitor_node[$primary_mons[0]]['name']
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config(hiera_hash('network_scheme',{}))
$ceph_cluster_network = get_network_role_property('ceph/replication', 'network')
$ceph_public_network = get_network_role_property('ceph/public', 'network')
$mon_addr = get_network_role_property('ceph/public', 'ipaddr')

View File

@ -29,7 +29,7 @@ if $use_ceph and $storage_hash['objects_ceph'] {
$primary_mons = keys($ceph_primary_monitor_node)
$primary_mon = $ceph_primary_monitor_node[$primary_mons[0]]['name']
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config(hiera_hash('network_scheme', {}))
$ceph_cluster_network = get_network_role_property('ceph/replication', 'network')
$ceph_public_network = get_network_role_property('ceph/public', 'network')
$rgw_ip_address = get_network_role_property('ceph/radosgw', 'ipaddr')

View File

@ -1,6 +1,6 @@
notice('MODULAR: cluster-haproxy.pp')
$network_scheme = hiera('network_scheme', {})
$network_scheme = hiera_hash('network_scheme', {})
$management_vip = hiera('management_vip')
$database_vip = hiera('database_vip', '')
$service_endpoint = hiera('service_endpoint', '')

View File

@ -1,6 +1,6 @@
notice('MODULAR: cluster-vrouter.pp')
$network_scheme = hiera('network_scheme', {})
$network_scheme = hiera_hash('network_scheme', {})
class { 'cluster::vrouter_ocf':
other_networks => direct_networks($network_scheme['endpoints']),

View File

@ -4,7 +4,7 @@ if ! roles_include(hiera('corosync_roles')) {
fail('The node role is not in corosync roles')
}
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config(hiera_hash('network_scheme', {}))
$corosync_nodes = corosync_nodes(
get_nodes_hash_by_roles(

View File

@ -1,13 +1,13 @@
notice('MODULAR: database.pp')
prepare_network_config(hiera('network_scheme', {}))
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$use_syslog = hiera('use_syslog', true)
$primary_controller = hiera('primary_controller')
$mysql_hash = hiera_hash('mysql', {})
$management_vip = hiera('management_vip')
$database_vip = hiera('database_vip', $management_vip)
$network_scheme = hiera('network_scheme', {})
$mgmt_iface = get_network_role_property('mgmt/database', 'interface')
$direct_networks = split(direct_networks($network_scheme['endpoints'], $mgmt_iface, 'netmask'), ' ')
$access_networks = flatten(['localhost', '127.0.0.1', '240.0.0.0/255.255.0.0', $direct_networks])

View File

@ -1,6 +1,6 @@
notice('MODULAR: firewall.pp')
$network_scheme = hiera_hash('network_scheme')
$network_scheme = hiera_hash('network_scheme', {})
$network_metadata = hiera_hash('network_metadata')
$ironic_hash = hiera_hash('ironic', {})
$roles = hiera('roles')
@ -365,7 +365,7 @@ if member($roles, 'compute') {
}
if $ironic_hash['enabled'] {
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config($network_scheme)
$baremetal_int = get_network_role_property('ironic/baremetal', 'interface')
$baremetal_vip = $network_metadata['vips']['baremetal']['ipaddr']
$baremetal_ipaddr = get_network_role_property('ironic/baremetal', 'ipaddr')

View File

@ -431,7 +431,7 @@ if hiera('memcached_addresses', false) {
# need this to successful lookup from template
$memcached_addresses = hiera('memcached_addresses')
} else {
$memcache_nodes = get_nodes_hash_by_roles(hiera_hash('network_metadata'), $memcache_roles)
$memcache_nodes = get_nodes_hash_by_roles($network_metadata, $memcache_roles)
$memcached_addresses = ipsort(values(get_node_to_ipaddr_map_by_network_role($memcache_nodes, 'mgmt/memcache')))
}

View File

@ -1,6 +1,6 @@
notice('MODULAR: heat.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$management_vip = hiera('management_vip')
$heat_hash = hiera_hash('heat', {})
$sahara_hash = hiera_hash('sahara_hash', {})

View File

@ -1,6 +1,6 @@
notice('MODULAR: horizon.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$horizon_hash = hiera_hash('horizon', {})
$service_endpoint = hiera('service_endpoint')
$memcached_server = hiera('memcached_addresses')

View File

@ -33,7 +33,7 @@ $ironic_tenant = pick($ironic_hash['tenant'],'services')
$ironic_user = pick($ironic_hash['auth_name'],'ironic')
$ironic_user_password = pick($ironic_hash['user_password'],'ironic')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$baremetal_vip = $network_metadata['vips']['baremetal']['ipaddr']

View File

@ -1,6 +1,6 @@
notice('MODULAR: memcached.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
class { 'memcached':
listen_ip => get_network_role_property('mgmt/memcache', 'ipaddr'),

View File

@ -1,6 +1,6 @@
notice('MODULAR: murano/cfapi.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$access_hash = hiera_hash('access_hash', {})
$murano_cfapi_hash = hiera_hash('murano-cfapi', {})

View File

@ -1,6 +1,6 @@
notice('MODULAR: murano.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$murano_hash = hiera_hash('murano_hash', {})
$murano_settings_hash = hiera_hash('murano_settings', {})

View File

@ -1,7 +1,7 @@
notice('MODULAR: configure_default_route.pp')
$network_scheme = hiera_hash('network_scheme')
$network_scheme = hiera_hash('network_scheme', {})
$management_vrouter_vip = hiera('management_vrouter_vip')
$management_role = 'management'
$fw_admin_role = 'fw-admin'

View File

@ -1,6 +1,6 @@
notice('MODULAR: netconfig.pp')
$network_scheme = hiera_hash('network_scheme')
$network_scheme = hiera_hash('network_scheme', {})
if ( $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' ) {
$ovs_datapath_package_name = 'kmod-openvswitch-lt'

View File

@ -1,7 +1,7 @@
notice('MODULAR: openstack-cinder.pp')
#Network stuff
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$cinder_hash = hiera_hash('cinder_hash', {})
$management_vip = hiera('management_vip')
$queue_provider = hiera('queue_provider', 'rabbitmq')

View File

@ -33,7 +33,7 @@ if ($use_swift and !$external_lb) {
$baremetal_virtual_ip = $network_metadata['vips']['baremetal']['ipaddr']
}
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config(hiera_hash('network_scheme', {}))
# Check proxy and storage daemons binds on the same ip address
$swift_api_ipaddr = get_network_role_property('swift/api', 'ipaddr')

View File

@ -13,9 +13,9 @@ if $use_neutron {
'neutron.services.metering.metering_plugin.MeteringPlugin',
]
$rabbit_hash = hiera_hash('rabbit_hash', { })
$ceilometer_hash = hiera_hash('ceilometer_hash', { })
$network_scheme = hiera_hash('network_scheme')
$rabbit_hash = hiera_hash('rabbit_hash', {})
$ceilometer_hash = hiera_hash('ceilometer', {})
$network_scheme = hiera_hash('network_scheme', {})
$verbose = pick($openstack_network_hash['verbose'], hiera('verbose', true))
$debug = pick($openstack_network_hash['debug'], hiera('debug', true))

View File

@ -30,7 +30,7 @@ if $use_neutron {
$auth_region = hiera('region', 'RegionOne')
$auth_endpoint_type = 'internalURL'
$network_scheme = hiera_hash('network_scheme')
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$neutron_advanced_config = hiera_hash('neutron_advanced_configuration', { })

View File

@ -1,7 +1,9 @@
notice('MODULAR: cinder.pp')
# Pulling hiera
prepare_network_config(hiera('network_scheme', {}))
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$cinder_hash = hiera_hash('cinder_hash', {})
$storage_address = get_network_role_property('cinder/iscsi', 'ipaddr')
$public_vip = hiera('public_vip')
@ -24,7 +26,6 @@ $glance_hash = hiera_hash('glance_hash', {})
$keystone_hash = hiera_hash('keystone_hash', {})
$ceilometer_hash = hiera_hash('ceilometer_hash',{})
$access_hash = hiera('access', {})
$network_scheme = hiera_hash('network_scheme')
$neutron_mellanox = hiera('neutron_mellanox', false)
$syslog_hash = hiera('syslog', {})
$base_syslog_hash = hiera('base_syslog', {})
@ -216,7 +217,7 @@ if ($use_ceph and !$storage_hash['volumes_lvm'] and !member($roles, 'cinder-vmwa
$primary_mon = $controllers[0]['name']
if ($use_neutron) {
prepare_network_config(hiera_hash('network_scheme'))
prepare_network_config(hiera_hash('network_scheme', {}))
$ceph_cluster_network = get_network_role_property('ceph/replication', 'network')
$ceph_public_network = get_network_role_property('ceph/public', 'network')
} else {

View File

@ -1,7 +1,8 @@
notice('MODULAR: ironic/ironic-conductor.pp')
$network_scheme = hiera('network_scheme', {})
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$baremetal_address = get_network_role_property('ironic/baremetal', 'ipaddr')
$ironic_hash = hiera_hash('ironic', {})
$management_vip = hiera('management_vip')

View File

@ -1,6 +1,6 @@
notice('MODULAR: mongo.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$mongo_hash = hiera_hash('mongo', {})
$mongo_nodes = get_nodes_hash_by_roles(hiera_hash('network_metadata'), hiera('mongo_roles'))
$mongo_address_map = get_node_to_ipaddr_map_by_network_role($mongo_nodes, 'mongo/db')

View File

@ -1,6 +1,6 @@
notice('MODULAR: sahara.pp')
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$access_admin = hiera_hash('access_hash', {})
$sahara_hash = hiera_hash('sahara_hash', {})

View File

@ -1,8 +1,6 @@
notice('MODULAR: swift/rebalance_cronjob.pp')
$network_metadata = hiera_hash('network_metadata')
# $network_scheme = hiera_hash('network_scheme')
# prepare_network_config($network_scheme)
$storage_hash = hiera('storage_hash')
$swift_master_role = hiera('swift_master_role', 'primary-controller')

View File

@ -1,7 +1,7 @@
notice('MODULAR: swift.pp')
$network_scheme = hiera_hash('network_scheme')
$network_metadata = hiera_hash('network_metadata')
$network_scheme = hiera_hash('network_scheme', {})
$network_metadata = hiera_hash('network_metadata', {})
prepare_network_config($network_scheme)
$swift_hash = hiera_hash('swift_hash')

View File

@ -1,7 +1,7 @@
notice('MODULAR: conntrackd.pp')
$network_metadata = hiera_hash('network_metadata', {})
prepare_network_config(hiera('network_scheme', {}))
prepare_network_config(hiera_hash('network_scheme', {}))
$vrouter_name = hiera('vrouter_name', 'pub')
case $operatingsystem {

View File

@ -1,8 +1,8 @@
notice('MODULAR: public_vip_ping.pp')
prepare_network_config(hiera('network_scheme', {}))
$network_scheme = hiera_hash('network_scheme',{})
prepare_network_config($network_scheme)
$run_ping_checker = hiera('run_ping_checker', true)
$network_scheme = hiera('network_scheme')
$public_iface = get_network_role_property('public/vip', 'interface')
$ping_host_list = $network_scheme['endpoints'][$public_iface]['gateway']

View File

@ -1,7 +1,7 @@
notice('MODULAR: virtual_ips.pp')
$network_metadata = hiera_hash('network_metadata')
$network_scheme = hiera_hash('network_scheme')
$network_metadata = hiera_hash('network_metadata', {})
$network_scheme = hiera_hash('network_scheme', {})
$roles = hiera('roles')
generate_vips($network_metadata, $network_scheme, $roles)

View File

@ -5,7 +5,7 @@ manifest = 'cluster-haproxy/cluster-haproxy.pp'
describe manifest do
shared_examples 'catalog' do
let(:endpoints) do
Noop.hiera('network_scheme', {}).fetch('endpoints', {})
Noop.hiera_hash('network_scheme', {}).fetch('endpoints', {})
end
unless Noop.hiera('external_lb', false)

View File

@ -6,7 +6,7 @@ describe manifest do
shared_examples 'catalog' do
let(:endpoints) do
Noop.hiera('network_scheme', {}).fetch('endpoints', {})
Noop.hiera_hash('network_scheme', {}).fetch('endpoints', {})
end
it "should delcare cluster::vrouter_ocf with correct other_networks" do

View File

@ -11,7 +11,7 @@ describe manifest do
}
let(:endpoints) do
Noop.hiera('network_scheme', {}).fetch('endpoints', {})
Noop.hiera_hash('network_scheme', {}).fetch('endpoints', {})
end
let(:other_networks) do

View File

@ -4,8 +4,8 @@ manifest = 'netconfig/netconfig.pp'
describe manifest do
shared_examples 'catalog' do
network_metadata = Noop.hiera 'network_metadata'
network_scheme = Noop.hiera 'network_scheme'
network_metadata = Noop.hiera_hash 'network_metadata'
network_scheme = Noop.hiera_hash 'network_scheme'
use_neutron = Noop.hiera 'use_neutron'
default_gateway = Noop.hiera 'default_gateway'
set_xps = Noop.hiera 'set_xps', true

View File

@ -20,7 +20,7 @@ describe manifest do
rabbit_hosts = Noop.hiera('amqp_hosts')
rabbit_user = Noop.hiera_structure('rabbit/user', 'nova')
rabbit_password = Noop.hiera_structure('rabbit/password')
network_scheme = Noop.hiera 'network_scheme'
network_scheme = Noop.hiera_hash 'network_scheme'
let (:storage_nets){
Noop.puppet_function 'get_routable_networks_for_network_role', network_scheme, 'swift/replication', ' '