Fix Hiera keys with a dot

The new Puppet version does not recognize dots in hiera key names,
so we need to replace them with underscores.

Change-Id: I6642d5963a598151dedbbbd957449bb317ceaa59

Replace deprecated 'auth_uri' with 'www_authenticate_uri'

Deprecated 'auth_uri' parameter is being removed from
puppet modules in [1].
In Swift 'auth_uri' is still not deprecated, it's being
deprecated in [2], so that can be taken care later.
For Sahara use ::sahara::keystone::authtoken class to configure
keystone parameters as the one specified in '::sahara' are deprecated
for removal.

[1] https://review.openstack.org/#/q/topic:remove-auth-uri
[2] https://review.openstack.org/#/c/621138/

Co-Authored-By: Javier Pena <jpena@redhat.com>
Change-Id: I68edd9225b44938dc6c275bf464d0e328e814848
This commit is contained in:
Javier Pena 2018-12-03 09:59:53 +01:00 committed by yatin
parent d675e77360
commit a3fe814be8
17 changed files with 62 additions and 53 deletions

View File

@ -828,12 +828,14 @@ def create_manifests(config, messages):
str.strip, str.strip,
config['CONFIG_NEUTRON_OVS_TUNNEL_SUBNETS'].split(',') config['CONFIG_NEUTRON_OVS_TUNNEL_SUBNETS'].split(',')
) )
cf_fw_nt_key = ("FIREWALL_NEUTRON_TUNNEL_RULES_%s" % host) cf_fw_nt_key = ("FIREWALL_NEUTRON_TUNNEL_RULES_%s" %
host.replace('.', '_'))
for subnet in tunnel_subnets: for subnet in tunnel_subnets:
tunnel_fw_details(config, host, subnet, fw_details) tunnel_fw_details(config, host, subnet, fw_details)
config[cf_fw_nt_key] = fw_details config[cf_fw_nt_key] = fw_details
else: else:
cf_fw_nt_key = ("FIREWALL_NEUTRON_TUNNEL_RULES_%s" % host) cf_fw_nt_key = ("FIREWALL_NEUTRON_TUNNEL_RULES_%s" %
host.replace('.', '_'))
for n_host in network_hosts | compute_hosts: for n_host in network_hosts | compute_hosts:
if config['CONFIG_NEUTRON_OVS_TUNNEL_IF']: if config['CONFIG_NEUTRON_OVS_TUNNEL_IF']:
if config['CONFIG_USE_SUBNETS'] == 'y': if config['CONFIG_USE_SUBNETS'] == 'y':

View File

@ -374,7 +374,8 @@ def create_compute_manifest(config, messages):
for host in compute_hosts: for host in compute_hosts:
fw_details = dict() fw_details = dict()
cf_fw_qemu_mig_key = "FIREWALL_NOVA_QEMU_MIG_RULES_%s" % host cf_fw_qemu_mig_key = ("FIREWALL_NOVA_QEMU_MIG_RULES_%s" %
host.replace('.', '_'))
for c_host in compute_hosts: for c_host in compute_hosts:
key = "nova_qemu_migration_%s_%s" % (host, c_host) key = "nova_qemu_migration_%s_%s" % (host, c_host)
fw_details.setdefault(key, {}) fw_details.setdefault(key, {})

View File

@ -54,8 +54,8 @@ class packstack::ceilometer ()
} }
class { '::ceilometer::keystone::authtoken': class { '::ceilometer::keystone::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
password => hiera('CONFIG_CEILOMETER_KS_PW'), password => hiera('CONFIG_CEILOMETER_KS_PW'),
} }
} }

View File

@ -26,9 +26,9 @@ class packstack::cinder ()
} }
class { '::cinder::keystone::authtoken': class { '::cinder::keystone::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
password => hiera('CONFIG_CINDER_KS_PW'), password => hiera('CONFIG_CINDER_KS_PW'),
} }
class { '::cinder::api': class { '::cinder::api':

View File

@ -24,9 +24,9 @@ class packstack::glance ()
} }
class { '::glance::api::authtoken': class { '::glance::api::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
password => hiera('CONFIG_GLANCE_KS_PW'), password => hiera('CONFIG_GLANCE_KS_PW'),
} }
class { '::glance::api::logging': class { '::glance::api::logging':
@ -45,9 +45,9 @@ class packstack::glance ()
} }
class { '::glance::registry::authtoken': class { '::glance::registry::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
password => hiera('CONFIG_GLANCE_KS_PW'), password => hiera('CONFIG_GLANCE_KS_PW'),
} }
class { '::glance::registry': class { '::glance::registry':

View File

@ -15,10 +15,10 @@ class packstack::gnocchi ()
} }
class { '::gnocchi::keystone::authtoken': class { '::gnocchi::keystone::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
auth_version => hiera('CONFIG_KEYSTONE_API_VERSION'), auth_version => hiera('CONFIG_KEYSTONE_API_VERSION'),
password => hiera('CONFIG_GNOCCHI_KS_PW') password => hiera('CONFIG_GNOCCHI_KS_PW')
} }
class { '::gnocchi::api': class { '::gnocchi::api':

View File

@ -29,9 +29,9 @@ class packstack::heat::rabbitmq ()
} }
class { '::heat::keystone::authtoken': class { '::heat::keystone::authtoken':
password => hiera('CONFIG_HEAT_KS_PW'), password => hiera('CONFIG_HEAT_KS_PW'),
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
} }
class { '::heat::logging': class { '::heat::logging':

View File

@ -7,8 +7,8 @@ class packstack::ironic ()
} }
class { '::ironic::api::authtoken': class { '::ironic::api::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
password => hiera('CONFIG_IRONIC_KS_PW'), password => hiera('CONFIG_IRONIC_KS_PW'),
} }
class { '::ironic::api': } class { '::ironic::api': }

View File

@ -13,8 +13,8 @@ class packstack::manila ()
} }
class { '::manila::keystone::authtoken': class { '::manila::keystone::authtoken':
password => hiera('CONFIG_MANILA_KS_PW'), password => hiera('CONFIG_MANILA_KS_PW'),
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
} }
class { '::manila::api': class { '::manila::api':

View File

@ -13,11 +13,11 @@ class packstack::neutron::api ()
$neutron_lbaas_enabled = str2bool(hiera('CONFIG_LBAAS_INSTALL')) $neutron_lbaas_enabled = str2bool(hiera('CONFIG_LBAAS_INSTALL'))
class { '::neutron::keystone::authtoken': class { '::neutron::keystone::authtoken':
username => 'neutron', username => 'neutron',
password => $neutron_user_password, password => $neutron_user_password,
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
project_name => 'services', project_name => 'services',
} }
class { '::neutron::server': class { '::neutron::server':

View File

@ -1,7 +1,8 @@
class packstack::neutron::ovn_agent () class packstack::neutron::ovn_agent ()
{ {
$my_ip = choose_my_ip(hiera('HOST_LIST')) $my_ip = choose_my_ip(hiera('HOST_LIST'))
$neutron_tunnel_rule_name = "FIREWALL_NEUTRON_TUNNEL_RULES_${my_ip}" $my_ip_without_dot = regsubst($my_ip, '\.', '_', 'G')
$neutron_tunnel_rule_name = "FIREWALL_NEUTRON_TUNNEL_RULES_${my_ip_without_dot}"
create_resources(packstack::firewall, hiera($neutron_tunnel_rule_name, {})) create_resources(packstack::firewall, hiera($neutron_tunnel_rule_name, {}))
$neutron_ovn_tunnel_if = hiera('CONFIG_NEUTRON_OVN_TUNNEL_IF', undef) $neutron_ovn_tunnel_if = hiera('CONFIG_NEUTRON_OVN_TUNNEL_IF', undef)

View File

@ -1,7 +1,8 @@
class packstack::neutron::ovs_agent () class packstack::neutron::ovs_agent ()
{ {
$my_ip = choose_my_ip(hiera('HOST_LIST')) $my_ip = choose_my_ip(hiera('HOST_LIST'))
$neutron_tunnel_rule_name = "FIREWALL_NEUTRON_TUNNEL_RULES_${my_ip}" $my_ip_without_dot = regsubst($my_ip, '\.', '_', 'G')
$neutron_tunnel_rule_name = "FIREWALL_NEUTRON_TUNNEL_RULES_${my_ip_without_dot}"
create_resources(packstack::firewall, hiera($neutron_tunnel_rule_name, {})) create_resources(packstack::firewall, hiera($neutron_tunnel_rule_name, {}))
$neutron_ovs_tunnel_if = hiera('CONFIG_NEUTRON_OVS_TUNNEL_IF', undef) $neutron_ovs_tunnel_if = hiera('CONFIG_NEUTRON_OVS_TUNNEL_IF', undef)

View File

@ -8,13 +8,13 @@ class packstack::nova::api ()
# TO-DO(mmagr): Add IPv6 support when hostnames are used # TO-DO(mmagr): Add IPv6 support when hostnames are used
} }
$auth_uri = hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS') $www_authenticate_uri = hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS')
$admin_password = hiera('CONFIG_NOVA_KS_PW') $admin_password = hiera('CONFIG_NOVA_KS_PW')
class {'::nova::keystone::authtoken': class {'::nova::keystone::authtoken':
password => $admin_password, password => $admin_password,
auth_uri => $auth_uri, www_authenticate_uri => $www_authenticate_uri,
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
} }
if hiera('CONFIG_NOVA_PCI_ALIAS') == '' { if hiera('CONFIG_NOVA_PCI_ALIAS') == '' {
@ -55,7 +55,7 @@ class packstack::nova::api ()
} }
class { '::nova::placement': class { '::nova::placement':
auth_url => $auth_uri, auth_url => $www_authenticate_uri,
password => $admin_password, password => $admin_password,
region_name => hiera('CONFIG_KEYSTONE_REGION'), region_name => hiera('CONFIG_KEYSTONE_REGION'),
} }

View File

@ -1,7 +1,8 @@
class packstack::nova::compute () class packstack::nova::compute ()
{ {
$my_ip = choose_my_ip(hiera('HOST_LIST')) $my_ip = choose_my_ip(hiera('HOST_LIST'))
$qemu_rule_name = "FIREWALL_NOVA_QEMU_MIG_RULES_${my_ip}" $my_ip_without_dot = regsubst($my_ip, '\.', '_', 'G')
$qemu_rule_name = "FIREWALL_NOVA_QEMU_MIG_RULES_${my_ip_without_dot}"
create_resources(packstack::firewall, hiera($qemu_rule_name, {})) create_resources(packstack::firewall, hiera($qemu_rule_name, {}))
create_resources(packstack::firewall, hiera('FIREWALL_NOVA_COMPUTE_RULES', {})) create_resources(packstack::firewall, hiera('FIREWALL_NOVA_COMPUTE_RULES', {}))

View File

@ -23,10 +23,10 @@ class packstack::panko ()
} }
class { '::panko::keystone::authtoken': class { '::panko::keystone::authtoken':
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
auth_version => hiera('CONFIG_KEYSTONE_API_VERSION'), auth_version => hiera('CONFIG_KEYSTONE_API_VERSION'),
password => hiera('CONFIG_PANKO_KS_PW') password => hiera('CONFIG_PANKO_KS_PW')
} }
class { '::panko::api': class { '::panko::api':

View File

@ -15,11 +15,11 @@ class packstack::provision::bridge ()
} }
class { '::neutron::keystone::authtoken': class { '::neutron::keystone::authtoken':
username => 'neutron', username => 'neutron',
password => $neutron_user_password, password => $neutron_user_password,
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS'), www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL_VERSIONLESS'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
project_name => 'services', project_name => 'services',
} }
if $provision_neutron_br and $setup_ovs_bridge { if $provision_neutron_br and $setup_ovs_bridge {

View File

@ -23,6 +23,14 @@ class packstack::sahara::rabbitmq ()
File[$files_to_set_owner] ~> Service<| tag == 'sahara-service' |> File[$files_to_set_owner] ~> Service<| tag == 'sahara-service' |>
} }
class { '::sahara::keystone::authtoken':
username => 'sahara',
password => hiera('CONFIG_SAHARA_KS_PW'),
project_name => 'services',
www_authenticate_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
}
class { '::sahara::logging': class { '::sahara::logging':
debug => hiera('CONFIG_DEBUG_MODE'), debug => hiera('CONFIG_DEBUG_MODE'),
} }
@ -30,11 +38,6 @@ class packstack::sahara::rabbitmq ()
class { '::sahara': class { '::sahara':
database_connection => database_connection =>
"mysql+pymysql://sahara:${sahara_cfg_sahara_db_pw}@${sahara_cfg_sahara_mariadb_host}/sahara", "mysql+pymysql://sahara:${sahara_cfg_sahara_db_pw}@${sahara_cfg_sahara_mariadb_host}/sahara",
admin_user => 'sahara',
admin_password => hiera('CONFIG_SAHARA_KS_PW'),
admin_tenant_name => 'services',
auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'),
identity_uri => hiera('CONFIG_KEYSTONE_ADMIN_URL'),
use_neutron => ($sahara_cfg_config_neutron_install == 'y'), use_neutron => ($sahara_cfg_config_neutron_install == 'y'),
host => hiera('CONFIG_SAHARA_HOST'), host => hiera('CONFIG_SAHARA_HOST'),
rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'), rabbit_use_ssl => hiera('CONFIG_AMQP_SSL_ENABLED'),