From 0d043d793fa9eb83e87cb008b073329bb063bfb1 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 3 Apr 2022 02:06:11 +0900 Subject: [PATCH] Support more clients configurations This change introduces support for [clients] parameters and [clients_] parameters, which determine behavior of service clients used by heat for communication with the OpenStack services. - Implementation of heat::clients:: are generally same. Only cinder, heat, keystone and nova provides additional parameters. - The existing parameters in the base heat class are deprecated in favor of the new classes. Change-Id: Icdf4f0201dd1e5f93a450473709851977ec20034 --- manifests/clients.pp | 47 ++++++++++++++++ manifests/clients/aodh.pp | 45 +++++++++++++++ manifests/clients/barbican.pp | 45 +++++++++++++++ manifests/clients/base.pp | 50 +++++++++++++++++ manifests/clients/cinder.pp | 54 ++++++++++++++++++ manifests/clients/designate.pp | 45 +++++++++++++++ manifests/clients/glance.pp | 45 +++++++++++++++ manifests/clients/heat.pp | 56 +++++++++++++++++++ manifests/clients/keystone.pp | 54 ++++++++++++++++++ manifests/clients/magnum.pp | 45 +++++++++++++++ manifests/clients/manila.pp | 45 +++++++++++++++ manifests/clients/mistral.pp | 45 +++++++++++++++ manifests/clients/neutron.pp | 45 +++++++++++++++ manifests/clients/nova.pp | 54 ++++++++++++++++++ manifests/clients/octavia.pp | 45 +++++++++++++++ manifests/clients/sahara.pp | 45 +++++++++++++++ manifests/clients/swift.pp | 45 +++++++++++++++ manifests/clients/trove.pp | 45 +++++++++++++++ manifests/clients/vitrage.pp | 45 +++++++++++++++ manifests/clients/zaqar.pp | 45 +++++++++++++++ manifests/init.pp | 33 ++++++----- .../notes/clients-opts-9cca2ca2ec1f3ff7.yaml | 20 +++++++ spec/classes/heat_clients_aodh_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_barbican_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_cinder_spec.rb | 54 ++++++++++++++++++ spec/classes/heat_clients_designate_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_glance_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_heat_spec.rb | 55 ++++++++++++++++++ spec/classes/heat_clients_keystone_spec.rb | 54 ++++++++++++++++++ spec/classes/heat_clients_magnum_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_manila_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_mistral_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_neutron_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_nova_spec.rb | 54 ++++++++++++++++++ spec/classes/heat_clients_octavia_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_sahara_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_swift_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_trove_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_vitrage_spec.rb | 51 +++++++++++++++++ spec/classes/heat_clients_zaqar_spec.rb | 51 +++++++++++++++++ spec/classes/heat_init_spec.rb | 11 ++-- spec/defines/heat_clients_base_spec.rb | 51 +++++++++++++++++ 43 files changed, 2022 insertions(+), 20 deletions(-) create mode 100644 manifests/clients.pp create mode 100644 manifests/clients/aodh.pp create mode 100644 manifests/clients/barbican.pp create mode 100644 manifests/clients/base.pp create mode 100644 manifests/clients/cinder.pp create mode 100644 manifests/clients/designate.pp create mode 100644 manifests/clients/glance.pp create mode 100644 manifests/clients/heat.pp create mode 100644 manifests/clients/keystone.pp create mode 100644 manifests/clients/magnum.pp create mode 100644 manifests/clients/manila.pp create mode 100644 manifests/clients/mistral.pp create mode 100644 manifests/clients/neutron.pp create mode 100644 manifests/clients/nova.pp create mode 100644 manifests/clients/octavia.pp create mode 100644 manifests/clients/sahara.pp create mode 100644 manifests/clients/swift.pp create mode 100644 manifests/clients/trove.pp create mode 100644 manifests/clients/vitrage.pp create mode 100644 manifests/clients/zaqar.pp create mode 100644 releasenotes/notes/clients-opts-9cca2ca2ec1f3ff7.yaml create mode 100644 spec/classes/heat_clients_aodh_spec.rb create mode 100644 spec/classes/heat_clients_barbican_spec.rb create mode 100644 spec/classes/heat_clients_cinder_spec.rb create mode 100644 spec/classes/heat_clients_designate_spec.rb create mode 100644 spec/classes/heat_clients_glance_spec.rb create mode 100644 spec/classes/heat_clients_heat_spec.rb create mode 100644 spec/classes/heat_clients_keystone_spec.rb create mode 100644 spec/classes/heat_clients_magnum_spec.rb create mode 100644 spec/classes/heat_clients_manila_spec.rb create mode 100644 spec/classes/heat_clients_mistral_spec.rb create mode 100644 spec/classes/heat_clients_neutron_spec.rb create mode 100644 spec/classes/heat_clients_nova_spec.rb create mode 100644 spec/classes/heat_clients_octavia_spec.rb create mode 100644 spec/classes/heat_clients_sahara_spec.rb create mode 100644 spec/classes/heat_clients_spec.rb create mode 100644 spec/classes/heat_clients_swift_spec.rb create mode 100644 spec/classes/heat_clients_trove_spec.rb create mode 100644 spec/classes/heat_clients_vitrage_spec.rb create mode 100644 spec/classes/heat_clients_zaqar_spec.rb create mode 100644 spec/defines/heat_clients_base_spec.rb diff --git a/manifests/clients.pp b/manifests/clients.pp new file mode 100644 index 00000000..53f7849c --- /dev/null +++ b/manifests/clients.pp @@ -0,0 +1,47 @@ +# Class heat::clients +# +# default client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + $endpoint_type_real = pick($::heat::heat_clients_endpoint_type, $endpoint_type) + + heat::clients::base { 'clients': + endpoint_type => $endpoint_type_real, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/aodh.pp b/manifests/clients/aodh.pp new file mode 100644 index 00000000..54f95ce4 --- /dev/null +++ b/manifests/clients/aodh.pp @@ -0,0 +1,45 @@ +# Class heat::clients::aodh +# +# aodh client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::aodh ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_aodh': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/barbican.pp b/manifests/clients/barbican.pp new file mode 100644 index 00000000..43bc4966 --- /dev/null +++ b/manifests/clients/barbican.pp @@ -0,0 +1,45 @@ +# Class heat::clients::barbican +# +# barbican client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::barbican ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_barbican': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/base.pp b/manifests/clients/base.pp new file mode 100644 index 00000000..c79b20e7 --- /dev/null +++ b/manifests/clients/base.pp @@ -0,0 +1,50 @@ +# Define heat::clients::base +# +# common client configuration +# +# == Parameters +# +# [*section*] +# (Optional) Section name used to configure parameters. +# Defaults to $name. +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +define heat::clients::base ( + $section = $name, + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat_config { + "${section}/endpoint_type": value => $endpoint_type; + "${section}/ca_file": value => $ca_file; + "${section}/cert_file": value => $cert_file; + "${section}/key_file": value => $key_file; + "${section}/insecure": value => $insecure; + } +} diff --git a/manifests/clients/cinder.pp b/manifests/clients/cinder.pp new file mode 100644 index 00000000..10e0a924 --- /dev/null +++ b/manifests/clients/cinder.pp @@ -0,0 +1,54 @@ +# Class heat::clients::cinder +# +# cinder client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +# [*http_log_debug*] +# (Optional) Allow client's debug log output. +# Defaults to $::os_service_default. +# +class heat::clients::cinder ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, + $http_log_debug = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_cinder': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } + + heat_config { + 'clients_cinder/http_log_debug': value => $http_log_debug; + } +} diff --git a/manifests/clients/designate.pp b/manifests/clients/designate.pp new file mode 100644 index 00000000..fe6af1d9 --- /dev/null +++ b/manifests/clients/designate.pp @@ -0,0 +1,45 @@ +# Class heat::clients::designate +# +# designate client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::designate ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_designate': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/glance.pp b/manifests/clients/glance.pp new file mode 100644 index 00000000..aab73870 --- /dev/null +++ b/manifests/clients/glance.pp @@ -0,0 +1,45 @@ +# Class heat::clients::glance +# +# glance client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::glance ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_glance': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/heat.pp b/manifests/clients/heat.pp new file mode 100644 index 00000000..7ca884a8 --- /dev/null +++ b/manifests/clients/heat.pp @@ -0,0 +1,56 @@ +# Class heat::clients::heat +# +# heat client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +# [*url*] +# (Optional) Optional heat url in format. +# Defaults to $::os_service_default. +# +class heat::clients::heat ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, + $url = $::os_service_default, +) { + + include heat::deps + + $url_real = pick($::heat::heat_clients_url, $url) + + heat::clients::base { 'clients_heat': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } + + heat_config { + 'clients_heat/url': value => $url_real; + } +} diff --git a/manifests/clients/keystone.pp b/manifests/clients/keystone.pp new file mode 100644 index 00000000..444bcad6 --- /dev/null +++ b/manifests/clients/keystone.pp @@ -0,0 +1,54 @@ +# Class heat::clients::keystone +# +# keystone client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +# [*auth_uri*] +# (Optional) Unversioned keystone url. +# Defaults to $::os_service_default. +# +class heat::clients::keystone ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, + $auth_uri = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_keystone': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } + + heat_config { + 'clients_keystone/auth_uri': value => $auth_uri; + } +} diff --git a/manifests/clients/magnum.pp b/manifests/clients/magnum.pp new file mode 100644 index 00000000..6464f30a --- /dev/null +++ b/manifests/clients/magnum.pp @@ -0,0 +1,45 @@ +# Class heat::clients::magnum +# +# magnum client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::magnum ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_magnum': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/manila.pp b/manifests/clients/manila.pp new file mode 100644 index 00000000..ba27649f --- /dev/null +++ b/manifests/clients/manila.pp @@ -0,0 +1,45 @@ +# Class heat::clients::manila +# +# manila client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::manila ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_manila': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/mistral.pp b/manifests/clients/mistral.pp new file mode 100644 index 00000000..51a65886 --- /dev/null +++ b/manifests/clients/mistral.pp @@ -0,0 +1,45 @@ +# Class heat::clients::mistral +# +# mistral client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::mistral ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_mistral': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/neutron.pp b/manifests/clients/neutron.pp new file mode 100644 index 00000000..3b35640f --- /dev/null +++ b/manifests/clients/neutron.pp @@ -0,0 +1,45 @@ +# Class heat::clients::neutron +# +# neutron client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::neutron ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_neutron': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/nova.pp b/manifests/clients/nova.pp new file mode 100644 index 00000000..c91430a0 --- /dev/null +++ b/manifests/clients/nova.pp @@ -0,0 +1,54 @@ +# Class heat::clients::nova +# +# nova client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +# [*http_log_debug*] +# (Optional) Allow client's debug log output. +# Defaults to $::os_service_default. +# +class heat::clients::nova ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, + $http_log_debug = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_nova': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } + + heat_config { + 'clients_nova/http_log_debug': value => $http_log_debug; + } +} diff --git a/manifests/clients/octavia.pp b/manifests/clients/octavia.pp new file mode 100644 index 00000000..c57d73a9 --- /dev/null +++ b/manifests/clients/octavia.pp @@ -0,0 +1,45 @@ +# Class heat::clients::octavia +# +# octavia client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::octavia ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_octavia': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/sahara.pp b/manifests/clients/sahara.pp new file mode 100644 index 00000000..79173bb1 --- /dev/null +++ b/manifests/clients/sahara.pp @@ -0,0 +1,45 @@ +# Class heat::clients::sahara +# +# sahara client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::sahara ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_sahara': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/swift.pp b/manifests/clients/swift.pp new file mode 100644 index 00000000..60c73cda --- /dev/null +++ b/manifests/clients/swift.pp @@ -0,0 +1,45 @@ +# Class heat::clients::swift +# +# swift client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::swift ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_swift': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/trove.pp b/manifests/clients/trove.pp new file mode 100644 index 00000000..30838d90 --- /dev/null +++ b/manifests/clients/trove.pp @@ -0,0 +1,45 @@ +# Class heat::clients::trove +# +# trove client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::trove ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_trove': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/vitrage.pp b/manifests/clients/vitrage.pp new file mode 100644 index 00000000..35594c30 --- /dev/null +++ b/manifests/clients/vitrage.pp @@ -0,0 +1,45 @@ +# Class heat::clients::vitrage +# +# vitrage client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::vitrage ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_vitrage': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/clients/zaqar.pp b/manifests/clients/zaqar.pp new file mode 100644 index 00000000..3ba06690 --- /dev/null +++ b/manifests/clients/zaqar.pp @@ -0,0 +1,45 @@ +# Class heat::clients::zaqar +# +# zaqar client configuration +# +# == Parameters +# +# [*endpoint_type*] +# (Optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to $::os_service_default. +# +# [*ca_file*] +# (Optional) Optional CA cert file to use in SSL communications. +# Defaults to $::os_service_default. +# +# [*cert_file*] +# (Optional) Optional PEM-formatted certificate chain file. +# Defaults to $::os_service_default. +# +# [*key_file*] +# (Optional) Optional PEM-formatted file that contains the private key. +# Defaults to $::os_service_default. +# +# [*insecure*] +# (Optional) If set, then the server's certificate will not be verified. +# Defaults to $::os_service_default. +# +class heat::clients::zaqar ( + $endpoint_type = $::os_service_default, + $ca_file = $::os_service_default, + $cert_file = $::os_service_default, + $key_file = $::os_service_default, + $insecure = $::os_service_default, +) { + + include heat::deps + + heat::clients::base { 'clients_zaqar': + endpoint_type => $endpoint_type, + ca_file => $ca_file, + cert_file => $cert_file, + key_file => $key_file, + insecure => $insecure, + } +} diff --git a/manifests/init.pp b/manifests/init.pp index b9502f44..dacc3c51 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -217,15 +217,6 @@ # (Optional) Set max request body size # Defaults to $::os_service_default. # -# [*heat_clients_url*] -# (optional) Heat url in format like http://0.0.0.0:8004/v1/%(tenant_id)s. -# Defaults to $::os_service_default. -# -# [*heat_clients_endpoint_type*] -# (optional) Type of endpoint in Identity service catalog to use for -# communication with the OpenStack service. -# Defaults to $::os_service_default. -# # [*purge_config*] # (optional) Whether to set only the specified config options # in the heat config. @@ -252,6 +243,15 @@ # time. # Defaults to undef # +# [*heat_clients_url*] +# (optional) Heat url in format like http://0.0.0.0:8004/v1/%(tenant_id)s. +# Defaults to undef +# +# [*heat_clients_endpoint_type*] +# (optional) Type of endpoint in Identity service catalog to use for +# communication with the OpenStack service. +# Defaults to undef +# class heat( $package_ensure = 'present', $keystone_ec2_uri = $::os_service_default, @@ -298,14 +298,14 @@ class heat( $notification_topics = $::os_service_default, $enable_proxy_headers_parsing = $::os_service_default, $max_request_body_size = $::os_service_default, - $heat_clients_url = $::os_service_default, - $heat_clients_endpoint_type = $::os_service_default, $purge_config = false, $auth_strategy = 'keystone', $yaql_memory_quota = $::os_service_default, $yaql_limit_iterators = $::os_service_default, # DEPRECATED PARAMETERS $max_stacks_per_tenant = undef, + $heat_clients_url = undef, + $heat_clients_endpoint_type = undef, ) { include heat::db @@ -375,10 +375,15 @@ Use heat::engine::max_stacks_per_tenant instead.') 'trustee/project_domain_name': ensure => absent; } - heat_config { - 'clients_heat/url': value => $heat_clients_url; - 'clients/endpoint_type': value => $heat_clients_endpoint_type; + if $heat_clients_url != undef { + warning('The heat_clients_url parameter is deprecated. Use the heat::clients::heat class.') } + include heat::clients::heat + + if $heat_clients_endpoint_type!= undef { + warning('The heat_clients_endpoint_type parameter is deprecated. Use the heat::clients class.') + } + include heat::clients if (!is_service_default($enable_stack_adopt)) { validate_legacy(Boolean, 'validate_bool', $enable_stack_adopt) diff --git a/releasenotes/notes/clients-opts-9cca2ca2ec1f3ff7.yaml b/releasenotes/notes/clients-opts-9cca2ca2ec1f3ff7.yaml new file mode 100644 index 00000000..492f80b7 --- /dev/null +++ b/releasenotes/notes/clients-opts-9cca2ca2ec1f3ff7.yaml @@ -0,0 +1,20 @@ +--- +features: + - | + The new ``heat::clients`` class has been added. Use this class to manage + ``[clients]`` parameters. + + - | + The new ``heat::clients::base`` defined type has been added. This defined + type provides the basic implementation to manage ``[clients_]`` + parameters. + + - | + The ``heat::clients::`` classes, to manage ``[clients_]`` + parameters, have been added. + +deprecations: + - | + The ``heat_clients_endpoint_type`` parameter and the ``heat_clients_url`` + parameter has been deprecated, in favor of the ``heat::clients`` class and + the ``heat::clients::heat`` class. diff --git a/spec/classes/heat_clients_aodh_spec.rb b/spec/classes/heat_clients_aodh_spec.rb new file mode 100644 index 00000000..b1c7d7bd --- /dev/null +++ b/spec/classes/heat_clients_aodh_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::aodh' do + shared_examples 'heat::clients::aodh' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_aodh').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_aodh').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::aodh' + end + end +end diff --git a/spec/classes/heat_clients_barbican_spec.rb b/spec/classes/heat_clients_barbican_spec.rb new file mode 100644 index 00000000..722cc9d4 --- /dev/null +++ b/spec/classes/heat_clients_barbican_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::barbican' do + shared_examples 'heat::clients::barbican' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_barbican').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_barbican').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::barbican' + end + end +end diff --git a/spec/classes/heat_clients_cinder_spec.rb b/spec/classes/heat_clients_cinder_spec.rb new file mode 100644 index 00000000..3f951f3c --- /dev/null +++ b/spec/classes/heat_clients_cinder_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +describe 'heat::clients::cinder' do + shared_examples 'heat::clients::cinder' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_cinder').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + is_expected.to contain_heat_config('clients_cinder/http_log_debug').with_value('') + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + :http_log_debug => true, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_cinder').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + is_expected.to contain_heat_config('clients_cinder/http_log_debug').with_value(true) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::cinder' + end + end +end diff --git a/spec/classes/heat_clients_designate_spec.rb b/spec/classes/heat_clients_designate_spec.rb new file mode 100644 index 00000000..e98b2e7e --- /dev/null +++ b/spec/classes/heat_clients_designate_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::designate' do + shared_examples 'heat::clients::designate' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_designate').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_designate').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::designate' + end + end +end diff --git a/spec/classes/heat_clients_glance_spec.rb b/spec/classes/heat_clients_glance_spec.rb new file mode 100644 index 00000000..c349a033 --- /dev/null +++ b/spec/classes/heat_clients_glance_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::glance' do + shared_examples 'heat::clients::glance' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_glance').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_glance').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::glance' + end + end +end diff --git a/spec/classes/heat_clients_heat_spec.rb b/spec/classes/heat_clients_heat_spec.rb new file mode 100644 index 00000000..f5837de9 --- /dev/null +++ b/spec/classes/heat_clients_heat_spec.rb @@ -0,0 +1,55 @@ +require 'spec_helper' + +describe 'heat::clients::heat' do + shared_examples 'heat::clients::heat' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_heat').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + is_expected.to contain_heat_config('clients_heat/url').with_value('') + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + :url => 'http://127.0.0.1:8004/v1/%(tenant_id)s', + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_heat').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + is_expected.to contain_heat_config('clients_heat/url')\ + .with_value('http://127.0.0.1:8004/v1/%(tenant_id)s') + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::heat' + end + end +end diff --git a/spec/classes/heat_clients_keystone_spec.rb b/spec/classes/heat_clients_keystone_spec.rb new file mode 100644 index 00000000..11b73c7d --- /dev/null +++ b/spec/classes/heat_clients_keystone_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +describe 'heat::clients::keystone' do + shared_examples 'heat::clients::keystone' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_keystone').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + is_expected.to contain_heat_config('clients_keystone/auth_uri').with_value('') + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + :auth_uri => 'http://127.0.0.1:5000', + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_keystone').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + is_expected.to contain_heat_config('clients_keystone/auth_uri').with_value('http://127.0.0.1:5000') + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::keystone' + end + end +end diff --git a/spec/classes/heat_clients_magnum_spec.rb b/spec/classes/heat_clients_magnum_spec.rb new file mode 100644 index 00000000..c26393df --- /dev/null +++ b/spec/classes/heat_clients_magnum_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::magnum' do + shared_examples 'heat::clients::magnum' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_magnum').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_magnum').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::magnum' + end + end +end diff --git a/spec/classes/heat_clients_manila_spec.rb b/spec/classes/heat_clients_manila_spec.rb new file mode 100644 index 00000000..15790ea2 --- /dev/null +++ b/spec/classes/heat_clients_manila_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::manila' do + shared_examples 'heat::clients::manila' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_manila').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_manila').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::manila' + end + end +end diff --git a/spec/classes/heat_clients_mistral_spec.rb b/spec/classes/heat_clients_mistral_spec.rb new file mode 100644 index 00000000..0e406bab --- /dev/null +++ b/spec/classes/heat_clients_mistral_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::mistral' do + shared_examples 'heat::clients::mistral' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_mistral').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_mistral').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::mistral' + end + end +end diff --git a/spec/classes/heat_clients_neutron_spec.rb b/spec/classes/heat_clients_neutron_spec.rb new file mode 100644 index 00000000..3b31e876 --- /dev/null +++ b/spec/classes/heat_clients_neutron_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::neutron' do + shared_examples 'heat::clients::neutron' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_neutron').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_neutron').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::neutron' + end + end +end diff --git a/spec/classes/heat_clients_nova_spec.rb b/spec/classes/heat_clients_nova_spec.rb new file mode 100644 index 00000000..6595b42c --- /dev/null +++ b/spec/classes/heat_clients_nova_spec.rb @@ -0,0 +1,54 @@ +require 'spec_helper' + +describe 'heat::clients::nova' do + shared_examples 'heat::clients::nova' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_nova').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + is_expected.to contain_heat_config('clients_nova/http_log_debug').with_value('') + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + :http_log_debug => true, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_nova').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + is_expected.to contain_heat_config('clients_nova/http_log_debug').with_value(true) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::nova' + end + end +end diff --git a/spec/classes/heat_clients_octavia_spec.rb b/spec/classes/heat_clients_octavia_spec.rb new file mode 100644 index 00000000..4837a947 --- /dev/null +++ b/spec/classes/heat_clients_octavia_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::octavia' do + shared_examples 'heat::clients::octavia' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_octavia').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_octavia').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::octavia' + end + end +end diff --git a/spec/classes/heat_clients_sahara_spec.rb b/spec/classes/heat_clients_sahara_spec.rb new file mode 100644 index 00000000..c4908829 --- /dev/null +++ b/spec/classes/heat_clients_sahara_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::sahara' do + shared_examples 'heat::clients::sahara' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_sahara').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_sahara').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::sahara' + end + end +end diff --git a/spec/classes/heat_clients_spec.rb b/spec/classes/heat_clients_spec.rb new file mode 100644 index 00000000..55fbc034 --- /dev/null +++ b/spec/classes/heat_clients_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients' do + shared_examples 'heat::clients' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients' + end + end +end diff --git a/spec/classes/heat_clients_swift_spec.rb b/spec/classes/heat_clients_swift_spec.rb new file mode 100644 index 00000000..d4fd255e --- /dev/null +++ b/spec/classes/heat_clients_swift_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::swift' do + shared_examples 'heat::clients::swift' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_swift').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_swift').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::swift' + end + end +end diff --git a/spec/classes/heat_clients_trove_spec.rb b/spec/classes/heat_clients_trove_spec.rb new file mode 100644 index 00000000..c732c64a --- /dev/null +++ b/spec/classes/heat_clients_trove_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::trove' do + shared_examples 'heat::clients::trove' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_trove').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_trove').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::trove' + end + end +end diff --git a/spec/classes/heat_clients_vitrage_spec.rb b/spec/classes/heat_clients_vitrage_spec.rb new file mode 100644 index 00000000..d73ab2b3 --- /dev/null +++ b/spec/classes/heat_clients_vitrage_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::vitrage' do + shared_examples 'heat::clients::vitrage' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_vitrage').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_vitrage').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::vitrage' + end + end +end diff --git a/spec/classes/heat_clients_zaqar_spec.rb b/spec/classes/heat_clients_zaqar_spec.rb new file mode 100644 index 00000000..b78e54ce --- /dev/null +++ b/spec/classes/heat_clients_zaqar_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::zaqar' do + shared_examples 'heat::clients::zaqar' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat__clients__base('clients_zaqar').with( + :endpoint_type => '', + :ca_file => '', + :cert_file => '', + :key_file => '', + :insecure => '', + ) + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures client parameters' do + is_expected.to contain_heat__clients__base('clients_zaqar').with( + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + ) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::zaqar' + end + end +end diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index a5f33e81..c8c29ec4 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -9,12 +9,11 @@ describe 'heat' do let :params do { - :package_ensure => 'present', - :flavor => 'keystone', - :heat_clients_url => '', - :purge_config => false, - :yaql_limit_iterators => 400, - :yaql_memory_quota => 20000, + :package_ensure => 'present', + :flavor => 'keystone', + :purge_config => false, + :yaql_limit_iterators => 400, + :yaql_memory_quota => 20000, } end diff --git a/spec/defines/heat_clients_base_spec.rb b/spec/defines/heat_clients_base_spec.rb new file mode 100644 index 00000000..9d7881e7 --- /dev/null +++ b/spec/defines/heat_clients_base_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +describe 'heat::clients::base' do + let (:title) do + 'clients_foo' + end + + shared_examples 'heat::clients::base' do + context 'with defaults' do + it 'configures defaults' do + is_expected.to contain_heat_config('clients_foo/endpoint_type').with_value('') + is_expected.to contain_heat_config('clients_foo/ca_file').with_value('') + is_expected.to contain_heat_config('clients_foo/cert_file').with_value('') + is_expected.to contain_heat_config('clients_foo/key_file').with_value('') + is_expected.to contain_heat_config('clients_foo/insecure').with_value('') + end + end + + context 'with parameters' do + let :params do + { + :endpoint_type => 'publicURL', + :ca_file => '/path/to/ca.cert', + :cert_file => '/path/to/certfile', + :key_file => '/path/to/key', + :insecure => false, + } + end + + it 'configures defaults' do + is_expected.to contain_heat_config('clients_foo/endpoint_type').with_value('publicURL') + is_expected.to contain_heat_config('clients_foo/ca_file').with_value('/path/to/ca.cert') + is_expected.to contain_heat_config('clients_foo/cert_file').with_value('/path/to/certfile') + is_expected.to contain_heat_config('clients_foo/key_file').with_value('/path/to/key') + is_expected.to contain_heat_config('clients_foo/insecure').with_value(false) + end + end + end + + on_supported_os({ + :supported_os => OSDefaults.get_supported_os + }).each do |os,facts| + context "on #{os}" do + let (:facts) do + facts.merge!(OSDefaults.get_facts()) + end + + it_behaves_like 'heat::clients::base' + end + end +end