Skip to content

Instantly share code, notes, and snippets.

@mgagne

mgagne/compat.pp Secret

Created November 30, 2017 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgagne/7146424416eda597563c4018ce50cf97 to your computer and use it in GitHub Desktop.
Save mgagne/7146424416eda597563c4018ce50cf97 to your computer and use it in GitHub Desktop.
class openstack::nova::compat {
# NOTE(mgagne) For legacy reasons, this should always be true.
# The puppet module used to (wrongfully) set this value to true if rabbit_hosts is provided.
Nova_config <| title == 'oslo_messaging_rabbit/rabbit_ha_queues' |> { value => true }
if $::openstack::nova::nova_compute and $::openstack::nova::virt_driver == 'ironic' {
package { 'nova-compute-agile-server':
ensure => $::openstack::nova::package_ensure,
tag => ['openstack', 'nova-package'],
}
}
nova_config {
'cinder/cinder_catalog_info': ensure => absent;
'DEFAULT/amqp_durable_queues': ensure => absent;
'DEFAULT/glance_api_servers': ensure => absent;
'DEFAULT/lock_path': ensure => absent;
'DEFAULT/network_api_class': ensure => absent;
'DEFAULT/notification_driver': ensure => absent;
'DEFAULT/notification_topics': ensure => absent;
'DEFAULT/rabbit_ha_queues': ensure => absent;
'DEFAULT/rabbit_hosts': ensure => absent;
'DEFAULT/rabbit_use_ssl': ensure => absent;
'DEFAULT/security_group_api': ensure => absent;
'DEFAULT/vnc_enabled': ensure => absent;
'DEFAULT/vnc_keymap': ensure => absent;
'DEFAULT/vncserver_listen': ensure => absent;
'DEFAULT/vncserver_proxyclient_address': ensure => absent;
'DEFAULT/volume_api_class': ensure => absent;
'keystone_authtoken/auth_plugin': ensure => absent;
'neutron/admin_auth_url': ensure => absent;
'neutron/admin_password': ensure => absent;
'neutron/admin_tenant_name': ensure => absent;
'neutron/admin_username': ensure => absent;
}
case $::openstack::nova::version {
'mitaka': {
Nova_config <| title == 'wsgi/default_pool_size' |> { name => 'DEFAULT/wsgi_default_pool_size' }
Nova_config <| title == 'notifications/notification_format' |> { ensure => absent }
if $::openstack::nova::virt_driver != 'ironic' {
Nova_config <| title == 'DEFAULT/compute_manager' |> { ensure => absent }
}
# Deprecated in favor of entrypoints
if $::openstack::nova::scheduler_host_manager == 'nova.scheduler.host_manager.HostManager' {
Nova_config <| title == 'DEFAULT/scheduler_host_manager' |> { value => 'host_manager' }
} elsif $::openstack::nova::scheduler_host_manager == 'nova.scheduler.ironic_host_manager.IronicHostManager' {
Nova_config <| title == 'DEFAULT/scheduler_host_manager' |> { value => 'ironic_host_manager' }
}
Nova_config <| title == 'neutron/auth_url' |> { value => "${::openstack::nova::keystone_auth_uri}v3" }
# NOTE(mgagne) Default value is just fine.
Nova_config <| title == 'DEFAULT/scheduler_weight_classes' |> { ensure => absent }
nova_config {
'DEFAULT/vendordata_driver': value => $::openstack::nova::vendordata_driver;
'DEFAULT/scheduler_available_weights': value => join(any2array($::openstack::nova::scheduler_available_weights), ',');
'DEFAULT/scheduler_default_weights': value => join(any2array($::openstack::nova::scheduler_weight_classes_real), ',');
}
}
'newton': {
if $::openstack::nova::vendordata_driver != $facts['os_service_default'] {
warning('The vendordata_driver parameter is deprecated and will be ignored.')
}
# Deprecated in favor of entrypoints
if $::openstack::nova::scheduler_host_manager == 'nova.scheduler.host_manager.HostManager' {
Nova_config <| title == 'DEFAULT/scheduler_host_manager' |> { value => 'host_manager' }
} elsif $::openstack::nova::scheduler_host_manager == 'nova.scheduler.ironic_host_manager.IronicHostManager' {
Nova_config <| title == 'DEFAULT/scheduler_host_manager' |> { value => 'ironic_host_manager' }
}
Nova_config <| title == 'neutron/auth_url' |> { value => "${::openstack::nova::keystone_auth_uri}v3" }
nova_config {
'DEFAULT/scheduler_available_weights': ensure => absent;
'DEFAULT/scheduler_default_weights': ensure => absent;
'DEFAULT/vendordata_driver': ensure => absent;
}
}
default: {
fail("Unsupported version: ${::openstack::nova::version}")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment