diff options
34 files changed, 702 insertions, 511 deletions
diff --git a/.fixtures.yml b/.fixtures.yml deleted file mode 100644 index 9e8eb3b..0000000 --- a/.fixtures.yml +++ /dev/null @@ -1,29 +0,0 @@ -fixtures: - repositories: - 'firewall': 'git://github.com/puppetlabs/puppetlabs-firewall.git' - 'stdlib': 'git://github.com/puppetlabs/puppetlabs-stdlib.git' - 'haproxy': 'git://github.com/puppetlabs/puppetlabs-haproxy.git' - 'concat': 'git://github.com/puppetlabs/puppetlabs-concat.git' - 'midonet': - repo: 'git://github.com/midonet/puppet-midonet.git' - ref: 'v2015.06.7' - 'tomcat': - repo: 'git://github.com/puppetlabs/puppetlabs-tomcat.git' - ref: '1.3.2' - 'inifile': - repo: 'git://github.com/puppetlabs/puppetlabs-inifile.git' - ref: '1.4.2' - 'cassandra': - repo: 'git://github.com/locp/cassandra.git' - ref: '1.9.2' - 'zookeeper': - repo: 'git://github.com/deric/puppet-zookeeper.git' - ref: 'v0.3.9' - 'datacat': - repo: 'git://github.com/richardc/puppet-datacat' - ref: '0.6.2' - 'java': - repo: 'git://github.com/puppetlabs/puppetlabs-java' - ref: '1.4.2' - symlinks: - "tripleo": "#{source_dir}" @@ -8,3 +8,4 @@ coverage/ .idea/ *.swp *.iml +openstack/ @@ -1,27 +1,9 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" -group :development, :test do - gem 'puppetlabs_spec_helper', :require => 'false' - gem 'rspec-puppet', '~> 2.2.0', :require => 'false' - gem 'metadata-json-lint', :require => 'false' - gem 'puppet-lint-param-docs', :require => 'false' - gem 'puppet-lint-absolute_classname-check', :require => 'false' - gem 'puppet-lint-absolute_template_path', :require => 'false' - gem 'puppet-lint-trailing_newline-check', :require => 'false' - gem 'puppet-lint-unquoted_string-check', :require => 'false' - gem 'puppet-lint-leading_zero-check', :require => 'false' - gem 'puppet-lint-variable_contains_upcase', :require => 'false' - gem 'puppet-lint-numericvariable', :require => 'false' - gem 'json', :require => 'false' - # adding 'psych' explicitly - # https://github.com/bundler/bundler/issues/2068 - # TODO: drop it in a future release of 'bundle'. - gem 'psych', :require => 'false' -end - -group :system_tests do - gem 'beaker-rspec', :require => 'false' - gem 'beaker-puppet_install_helper', :require => 'false' +group :development, :test, :system_tests do + gem 'puppet-openstack_spec_helper', + :git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper', + :require => false end if facterversion = ENV['FACTER_GEM_VERSION'] diff --git a/Puppetfile_extras b/Puppetfile_extras new file mode 100644 index 0000000..b9f664f --- /dev/null +++ b/Puppetfile_extras @@ -0,0 +1,31 @@ + +## TripleO Puppet modules + +mod 'haproxy', + :git => 'https://github.com/puppetlabs/puppetlabs-haproxy', + :ref => 'master' + +mod 'midonet', + :git => 'https://github.com/midonet/puppet-midonet', + :ref => 'v2015.06.7' + +mod 'tomcat', + :git => 'https://github.com/puppetlabs/puppetlabs-tomcat', + :ref => '1.3.2' + +mod 'java', + :git => 'https://github.com/puppetlabs/puppetlabs-java', + :ref => '1.4.2' + +mod 'cassandra', + :git => 'https://github.com/locp/cassandra', + :ref => '1.9.2' + +mod 'zookeeper', + :git => 'https://github.com/deric/puppet-zookeeper', + :ref => 'v0.3.9' + +mod 'datacat', + :git => 'https://github.com/richardc/puppet-datacat', + :ref => '0.6.2' + @@ -1,21 +1 @@ -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' -require 'puppet-syntax/tasks/puppet-syntax' - -PuppetSyntax.exclude_paths ||= [] -PuppetSyntax.exclude_paths << "spec/fixtures/**/*" -PuppetSyntax.exclude_paths << "pkg/**/*" -PuppetSyntax.exclude_paths << "vendor/**/*" - -Rake::Task[:lint].clear -PuppetLint::RakeTask.new :lint do |config| - config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"] - config.fail_on_warnings = true - config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}' - config.disable_checks = ["80chars", "class_inherits_from_params_class", "only_variable_string"] -end - -desc "Run acceptance tests" -RSpec::Core::RakeTask.new(:acceptance) do |t| - t.pattern = 'spec/acceptance' -end +require 'puppet-openstack_spec_helper/rake_tasks' diff --git a/manifests/certmonger/ca/local.pp b/manifests/certmonger/ca/local.pp index ea08dec..b7b7328 100644 --- a/manifests/certmonger/ca/local.pp +++ b/manifests/certmonger/ca/local.pp @@ -29,9 +29,11 @@ class tripleo::certmonger::ca::local( $extract_cmd = "openssl pkcs12 -in ${ca_pkcs12} -out ${ca_pem} -nokeys -nodes -passin pass:''" $trust_ca_cmd = 'update-ca-trust extract' exec { 'extract-and-trust-ca': - command => "${extract_cmd} && ${trust_ca_cmd}", - path => '/usr/bin', - creates => $ca_pem, - require => Package['certmonger'], + command => "${extract_cmd} && ${trust_ca_cmd}", + path => '/usr/bin', + creates => $ca_pem, + tries => 5, + try_sleep => 1, + require => Service['certmonger'], } } diff --git a/manifests/network/contrail/analytics.pp b/manifests/network/contrail/analytics.pp index 57fd815..4359a43 100644 --- a/manifests/network/contrail/analytics.pp +++ b/manifests/network/contrail/analytics.pp @@ -19,129 +19,138 @@ # # == Parameters: # +# [*host_ip*] +# (required) host IP address of Analytics +# String (IPv4) value. +# # [*admin_password*] -# (required) admin password +# (optional) admin password # String value. +# Defaults to hiera('contrail::admin_password') # # [*admin_tenant_name*] -# (required) admin tenant name. +# (optional) admin tenant name. # String value. +# Defaults to hiera('contrail::admin_tenant_name') # # [*admin_token*] -# (required) admin token +# (optional) admin token # String value. +# Defaults to hiera('contrail::admin_token') # # [*admin_user*] -# (required) admin user name. +# (optional) admin user name. # String value. +# Defaults to hiera('contrail::admin_user') # # [*auth_host*] -# (required) keystone server ip address +# (optional) keystone server ip address # String (IPv4) value. -# -# [*cassandra_server_list*] -# (required) List IPs+port of Cassandra servers -# Array of strings value. -# -# [*disc_server_ip*] -# (required) IPv4 address of discovery server. -# String (IPv4) value. -# -# [*host_ip*] -# (required) host IP address of Analytics -# String (IPv4) value. -# -# [*kafka_broker_list*] -# (required) List IPs+port of kafka servers -# Array of strings value. -# -# [*zk_server_ip*] -# (required) List IPs+port of Zookeeper servers -# Array of strings value. +# Defaults to hiera('contrail::auth_host') # # [*auth_port*] -# (required) keystone port. +# (optional) keystone port. # Integer value. -# Defaults to 35357. +# Defaults to hiera('contrail::auth_port') # # [*auth_protocol*] -# (required) authentication protocol. +# (optional) authentication protocol. # String value. -# Defaults to http. +# Defaults to hiera('contrail::auth_protocol') +# +# [*cassandra_server_list*] +# (optional) List IPs+port of Cassandra servers +# Array of strings value. +# Defaults to hiera('contrail::cassandra_server_list') # # [*collector_http_server_port*] -# (required) Collector http port +# (optional) Collector http port # Integer value. # Defaults to 8089 # # [*collector_sandesh_port*] -# (required) Collector sandesh port +# (optional) Collector sandesh port # Integer value. # Defaults to 8086 # +# [*disc_server_ip*] +# (optional) IPv4 address of discovery server. +# String (IPv4) value. +# Defaults to hiera('contrail::disc_server_ip') +# # [*disc_server_port*] -# (required) port Discovery server listens on. +# (optional) port Discovery server listens on. # Integer value. -# Defaults to 5998 +# Defaults to hiera('contrail::disc_server_port') # # [*http_server_port*] -# (required) Analytics http port +# (optional) Analytics http port # Integer value. # Defaults to 8090 # # [*insecure*] -# (required) insecure mode. +# (optional) insecure mode. # Boolean value. -# Defaults to false +# Defaults to falsehiera('contrail::insecure') +# +# [*kafka_broker_list*] +# (optional) List IPs+port of kafka servers +# Array of strings value. +# Defaults to hiera('contrail::kafka_broker_list') +# +# [*memcached_servers*] +# (optional) IPv4 address of memcached servers +# String (IPv4) value + port +# Defaults to hiera('contrail::memcached_server') # # [*redis_server*] -# (required) IPv4 address of redis server. +# (optional) IPv4 address of redis server. # String (IPv4) value. # Defaults to '127.0.0.1'. # # [*redis_server_port*] -# (required) port Redis server listens on. +# (optional) port Redis server listens on. # Integer value. # Defaults to 6379 # # [*rest_api_ip*] -# (required) IP address Analytics rest interface listens on +# (optional) IP address Analytics rest interface listens on # String (IPv4) value. # Defaults to '0.0.0.0' # # [*rest_api_port*] -# (required) Analytics rest port +# (optional) Analytics rest port # Integer value. # Defaults to 8081 # -# [*memcached_servers*] -# (optional) IPv4 address of memcached servers -# String (IPv4) value + port -# Defaults to '127.0.0.1:12111' +# [*zk_server_ip*] +# (optional) List IPs+port of Zookeeper servers +# Array of strings value. +# Defaults to hiera('contrail::zk_server_ip') # class tripleo::network::contrail::analytics( + $host_ip, $admin_password = hiera('contrail::admin_password'), $admin_tenant_name = hiera('contrail::admin_tenant_name'), $admin_token = hiera('contrail::admin_token'), $admin_user = hiera('contrail::admin_user'), $auth_host = hiera('contrail::auth_host'), - $cassandra_server_list = hiera('contrail::cassandra_server_list'), - $disc_server_ip = hiera('contrail::disc_server_ip'), - $host_ip, - $kafka_broker_list = hiera('contrail::kafka_broker_list'), - $zk_server_ip = hiera('contrail::zk_server_ip'), $auth_port = hiera('contrail::auth_port'), $auth_protocol = hiera('contrail::auth_protocol'), + $cassandra_server_list = hiera('contrail::cassandra_server_list'), $collector_http_server_port = 8089, $collector_sandesh_port = 8086, + $disc_server_ip = hiera('contrail::disc_server_ip'), $disc_server_port = hiera('contrail::disc_server_port'), $http_server_port = 8090, $insecure = hiera('contrail::insecure'), + $kafka_broker_list = hiera('contrail::kafka_broker_list'), + $memcached_servers = hiera('contrail::memcached_server'), $redis_server = '127.0.0.1', $redis_server_port = 6379, $rest_api_ip = '0.0.0.0', $rest_api_port = 8081, - $memcached_servers = hiera('contrail::memcached_server'), + $zk_server_ip = hiera('contrail::zk_server_ip'), ) { class {'::contrail::keystone': diff --git a/manifests/network/contrail/config.pp b/manifests/network/contrail/config.pp index 9a9e9bd..7b9c85f 100644 --- a/manifests/network/contrail/config.pp +++ b/manifests/network/contrail/config.pp @@ -19,34 +19,6 @@ # # == Parameters: # -# [*admin_password*] -# (required) admin password -# String value. -# -# [*admin_tenant_name*] -# (required) admin tenant name. -# String value. -# -# [*admin_token*] -# (required) admin token -# String value. -# -# [*admin_user*] -# (required) admin user name. -# String value. -# -# [*auth_host*] -# (required) keystone server ip address -# String (IPv4) value. -# -# [*cassandra_server_list*] -# (required) List IPs+port of Cassandra servers -# Array of strings value. -# -# [*disc_server_ip*] -# (required) IPv4 address of discovery server. -# String (IPv4) value. -# # [*ifmap_password*] # (required) ifmap password # String value. @@ -63,71 +35,107 @@ # (required) IPv4 address of rabbit server. # String (IPv4) value. # -# [*zk_server_ip*] -# (required) List IPs+port of Zookeeper servers -# Array of strings value. +# [*admin_password*] +# (optional) admin password +# String value. +# Defaults to hiera('contrail::admin_password') +# +# [*admin_tenant_name*] +# (optional) admin tenant name. +# String value. +# Defaults to hiera('contrail::admin_tenant_name') +# +# [*admin_token*] +# (optional) admin token +# String value. +# Defaults to hiera('contrail::admin_token') +# +# [*admin_user*] +# (optional) admin user name. +# String value. +# Defaults to hiera('contrail::admin_user') # # [*auth*] -# (required) Authentication method. -# Defaults to 'keystone'. +# (optional) Authentication method. +# Defaults to hiera('contrail::auth') +# +# [*auth_host*] +# (optional) keystone server ip address +# String (IPv4) value. +# Defaults to hiera('contrail::auth_host') # # [*auth_port*] -# (required) keystone port. -# Defaults to 35357. +# (optional) keystone port. +# Defaults to hiera('contrail::auth_port') # # [*auth_protocol*] -# (required) authentication protocol. -# Defaults to http. +# (optional) authentication protocol. +# Defaults to hiera('contrail::auth_protocol') +# +# [*cassandra_server_list*] +# (optional) List IPs+port of Cassandra servers +# Array of strings value. +# Defaults to hiera('contrail::cassandra_server_list') +# +# [*disc_server_ip*] +# (optional) IPv4 address of discovery server. +# String (IPv4) value. +# Defaults to hiera('contrail::disc_server_ip') # # [*insecure*] -# (required) insecure mode. -# Defaults to false +# (optional) insecure mode. +# Defaults to hiera('contrail::insecure') # # [*listen_ip_address*] -# (required) IP address to listen on. +# (optional) IP address to listen on. # String (IPv4) value. -# Defaults to '0.0.0.0'. +# Defaults to '0.0.0.0' # # [*listen_port*] -# (required) Listen port for config-api -# Defaults to 8082. +# (optional) Listen port for config-api +# Defaults to 8082 # # [*memcached_servers*] # (optional) IPv4 address of memcached servers # String (IPv4) value + port -# Defaults to '127.0.0.1:12111' +# Defaults to hiera('contrail::memcached_server') # # [*multi_tenancy*] -# (required) Defines if mutli-tenancy is enabled. -# Defaults to 'true'. +# (optional) Defines if mutli-tenancy is enabled. +# Defaults to hiera('contrail::multi_tenancy') # # [*redis_server*] -# (required) IPv4 address of redis server. +# (optional) IPv4 address of redis server. # String (IPv4) value. -# Defaults to '127.0.0.1'. +# Defaults to '127.0.0.1' +# +# [*zk_server_ip*] +# (optional) List IPs+port of Zookeeper servers +# Array of strings value. +# Defaults to hiera('contrail::zk_server_ip') # class tripleo::network::contrail::config( - $admin_password = hiera('contrail::admin_password'), - $admin_tenant_name = hiera('contrail::admin_tenant_name'), - $admin_token = hiera('contrail::admin_token'), - $admin_user = hiera('contrail::admin_user'), - $auth_host = hiera('contrail::auth_host'), - $cassandra_server_list = hiera('contrail::cassandra_server_list'), - $disc_server_ip = hiera('contrail::disc_server_ip'), $ifmap_password, $ifmap_server_ip, $ifmap_username, $rabbit_server, - $zk_server_ip = hiera('contrail::zk_server_ip'), + $admin_password = hiera('contrail::admin_password'), + $admin_tenant_name = hiera('contrail::admin_tenant_name'), + $admin_token = hiera('contrail::admin_token'), + $admin_user = hiera('contrail::admin_user'), $auth = hiera('contrail::auth'), + $auth_host = hiera('contrail::auth_host'), $auth_port = hiera('contrail::auth_port'), $auth_protocol = hiera('contrail::auth_protocol'), + $cassandra_server_list = hiera('contrail::cassandra_server_list'), + $disc_server_ip = hiera('contrail::disc_server_ip'), $insecure = hiera('contrail::insecure'), $listen_ip_address = '0.0.0.0', $listen_port = 8082, $memcached_servers = hiera('contrail::memcached_server'), $multi_tenancy = hiera('contrail::multi_tenancy'), $redis_server = '127.0.0.1', + $zk_server_ip = hiera('contrail::zk_server_ip'), ) { validate_ip_address($listen_ip_address) diff --git a/manifests/network/contrail/control.pp b/manifests/network/contrail/control.pp index 8e1f4b8..2e50108 100644 --- a/manifests/network/contrail/control.pp +++ b/manifests/network/contrail/control.pp @@ -19,84 +19,83 @@ # # == Parameters: # +# [*host_ip*] +# (required) host IP address of Control +# String (IPv4) value. +# +# [*ifmap_password*] +# (required) ifmap password +# String value. +# +# [*ifmap_username*] +# (optional) ifmap username +# String value. +# Defaults to hiera('contrail::ifmap_username'), +# # [*admin_password*] -# (required) admin password +# (optional) admin password # String value. +# Defaults to hiera('contrail::admin_password'), # # [*admin_tenant_name*] -# (required) admin tenant name. +# (optional) admin tenant name. # String value. +# Defaults to hiera('contrail::admin_tenant_name'), # # [*admin_token*] -# (required) admin token +# (optional) admin token # String value. +# Defaults to hiera('contrail::admin_token'), # # [*admin_user*] -# (required) admin user name. +# (optional) admin user name. # String value. +# Defaults to hiera('contrail::admin_user'), # # [*auth_host*] -# (required) keystone server ip address +# (optional) keystone server ip address # String (IPv4) value. -# -# [*disc_server_ip*] -# (required) IPv4 address of discovery server. -# String (IPv4) value. -# -# [*host_ip*] -# (required) host IP address of Control -# String (IPv4) value. -# -# [*ifmap_password*] -# (required) ifmap password -# String value. -# -# [*ifmap_server_ip*] -# (required) ifmap server ip address. -# String value. -# -# [*ifmap_username*] -# (required) ifmap username -# String value. +# Defaults to hiera('contrail::auth_host'), # # [*auth_port*] -# (required) keystone port. -# Defaults to 35357. +# (optional) keystone port. +# Defaults to hiera('contrail::auth_port'), # # [*auth_protocol*] -# (required) authentication protocol. -# Defaults to http. +# (optional) authentication protocol. +# Defaults to hiera('contrail::auth_protocol'), +# +# [*disc_server_ip*] +# (optional) IPv4 address of discovery server. +# String (IPv4) value. +# Defaults to hiera('contrail::disc_server_ip'), # # [*disc_server_port*] -# (required) port Discovery server listens on. +# (optional) port Discovery server listens on. # Integer value. -# Defaults to 5998 +# Defaults to hiera('contrail::disc_server_port'), # # [*insecure*] -# (required) insecure mode. -# Defaults to false +# (optional) insecure mode. +# Defaults to hiera('contrail::insecure'), # # [*memcached_servers*] # (optional) IPv4 address of memcached servers # String (IPv4) value + port -# Defaults to '127.0.0.1:12111' -# -# [*multi_tenancy*] -# (required) Defines if mutli-tenancy is enabled. -# Defaults to 'true'. +# Defaults to hiera('contrail::memcached_servers'), # class tripleo::network::contrail::control( + $host_ip, + $ifmap_password, + $ifmap_username, + $admin_password = hiera('contrail::admin_password'), $admin_tenant_name = hiera('contrail::admin_tenant_name'), $admin_token = hiera('contrail::admin_token'), - $admin_password = hiera('contrail::admin_password'), $admin_user = hiera('contrail::admin_user'), $auth_host = hiera('contrail::auth_host'), - $disc_server_ip = hiera('contrail::disc_server_ip'), - $host_ip, - $ifmap_password, - $ifmap_username, $auth_port = hiera('contrail::auth_port'), $auth_protocol = hiera('contrail::auth_protocol'), + $disc_server_ip = hiera('contrail::disc_server_ip'), $disc_server_port = hiera('contrail::disc_server_port'), $insecure = hiera('contrail::insecure'), $memcached_servers = hiera('contrail::memcached_server'), diff --git a/manifests/network/contrail/database.pp b/manifests/network/contrail/database.pp index 5fdfb97..58f2670 100644 --- a/manifests/network/contrail/database.pp +++ b/manifests/network/contrail/database.pp @@ -19,22 +19,23 @@ # # == Parameters: # -# [*disc_server_ip*] -# (required) IPv4 address of discovery server. -# String (IPv4) value. -# # [*host_ip*] # (required) host IP address of Database node # String (IPv4) value. # +# [*disc_server_ip*] +# (optional) IPv4 address of discovery server. +# String (IPv4) value. +# Defaults to hiera('contrail::disc_server_ip') +# # [*disc_server_port*] -# (required) port Discovery server listens on. +# (optional) port Discovery server listens on. # Integer value. -# Defaults to 5998 +# Defaults to hiera('contrail::disc_server_port') # class tripleo::network::contrail::database( - $disc_server_ip = hiera('contrail::disc_server_ip'), $host_ip, + $disc_server_ip = hiera('contrail::disc_server_ip'), $disc_server_port = hiera('contrail::disc_server_port'), ) { diff --git a/manifests/network/contrail/webui.pp b/manifests/network/contrail/webui.pp index f289923..0b308a4 100644 --- a/manifests/network/contrail/webui.pp +++ b/manifests/network/contrail/webui.pp @@ -19,84 +19,90 @@ # # == Parameters: # +# [*contrail_analytics_vip*] +# (required) VIP of Contrail Analytics +# String (IPv4) value. +# +# [*contrail_config_vip*] +# (required) VIP of Contrail Config +# String (IPv4) value. +# +# [*neutron_vip*] +# (required) VIP of Neutron +# String (IPv4) value. +# # [*admin_password*] -# (required) admin password +# (optional) admin password # String value. +# Defaults to hiera('contrail::admin_password') # # [*admin_tenant_name*] -# (required) admin tenant name. +# (optional) admin tenant name. # String value. +# Defaults to hiera('contrail::admin_tenant_name') # # [*admin_token*] -# (required) admin token +# (optional) admin token # String value. +# Defaults to hiera('contrail::admin_token') # # [*admin_user*] -# (required) admin user name. +# (optional) admin user name. # String value. +# Defaults to hiera('contrail::admin_user') # # [*auth_host*] -# (required) keystone server ip address +# (optional) keystone server ip address # String (IPv4) value. +# Defaults to hiera('contrail::auth_host') # # [*cassandra_server_list*] -# (required) List IPs+port of Cassandra servers +# (optional) List IPs+port of Cassandra servers # Array of strings value. -# -# [*contrail_analytics_vip*] -# (required) VIP of Contrail Analytics -# String (IPv4) value. -# -# [*contrail_config_vip*] -# (required) VIP of Contrail Config -# String (IPv4) value. -# -# [*neutron_vip*] -# (required) VIP of Neutron -# String (IPv4) value. +# Defaults to hiera('contrail::cassandra_server_list') # # [*contrail_webui_http_port*] -# (required) Webui HTTP Port +# (optional) Webui HTTP Port # Integer value. # Defaults to 8080 # # [*contrail_webui_https_port*] -# (required) Webui HTTPS Port +# (optional) Webui HTTPS Port # Integer value. # Defaults to 8143 # # [*redis_ip*] -# (required) IP of Redis +# (optional) IP of Redis # String (IPv4) value. # Defaults to '127.0.0.1' # class tripleo::network::contrail::webui( + $contrail_analytics_vip, + $contrail_config_vip, + $neutron_vip, $admin_password = hiera('contrail::admin_password'), $admin_tenant_name = hiera('contrail::admin_tenant_name'), $admin_token = hiera('contrail::admin_token'), $admin_user = hiera('contrail::admin_user'), $auth_host = hiera('contrail::auth_host'), $cassandra_server_list = hiera('contrail::cassandra_server_list'), - $contrail_analytics_vip, - $contrail_config_vip, - $neutron_vip, $contrail_webui_http_port = 8080, $contrail_webui_https_port = 8143, $redis_ip = '127.0.0.1', ) { class {'::contrail::webui': - openstack_vip => $auth_host, - contrail_config_vip => $contrail_config_vip, - contrail_analytics_vip => $contrail_analytics_vip, - neutron_vip => $neutron_vip, - cassandra_ip => $cassandra_server_list, - redis_ip => $redis_ip, - contrail_webui_http_port => $contrail_webui_http_port, - contrail_webui_https_port => $contrail_webui_https_port, - admin_user => $admin_user, - admin_password => $admin_password, - admin_token => $admin_token, - admin_tenant_name => $admin_tenant_name, + openstack_vip => $auth_host, + contrail_config_vip => $contrail_config_vip, + contrail_analytics_vip => $contrail_analytics_vip, + neutron_vip => $neutron_vip, + cassandra_ip => $cassandra_server_list, + redis_ip => $redis_ip, + contrail_webui_http_port => $contrail_webui_http_port, + contrail_webui_https_port => $contrail_webui_https_port, + admin_user => $admin_user, + admin_password => $admin_password, + admin_token => $admin_token, + admin_tenant_name => $admin_tenant_name, } } diff --git a/manifests/profile/base/manila.pp b/manifests/profile/base/manila.pp new file mode 100644 index 0000000..5210284 --- /dev/null +++ b/manifests/profile/base/manila.pp @@ -0,0 +1,50 @@ +# Copyright 2016 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::base::manila +# +# Manila common profile for tripleo +# +# === Parameters +# +# [*bootstrap_node*] +# (Optional) The hostname of the node responsible for bootstrapping tasks +# Defaults to hiera('bootstrap_nodeid') +# +# [*step*] +# (Optional) The current step of the deployment +# Defaults to hiera('step') +# +# [*rabbit_hosts*] +# list of the rabbbit host IPs +# Defaults to hiera('rabbitmq_node_ips') + +class tripleo::profile::base::manila ( + $bootstrap_node = hiera('bootstrap_nodeid', undef), + $step = hiera('step'), + $rabbit_hosts = hiera('rabbitmq_node_ips', undef), +) { + if $::hostname == downcase($bootstrap_node) { + $sync_db = true + } else { + $sync_db = false + } + + if $step >= 4 or ($step >= 3 and $sync_db) { + class { '::manila' : + rabbit_hosts => $rabbit_hosts, + } + include ::manila::config + } +} diff --git a/manifests/profile/base/manila/api.pp b/manifests/profile/base/manila/api.pp index 89ff810..ca5455f 100644 --- a/manifests/profile/base/manila/api.pp +++ b/manifests/profile/base/manila/api.pp @@ -18,24 +18,32 @@ # # === Parameters # +# [*bootstrap_node*] +# (Optional) The hostname of the node responsible for bootstrapping tasks +# Defaults to hiera('bootstrap_nodeid') +# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') -# -# [*rabbit_hosts*] -# list of the rabbbit host IPs -# Defaults to hiera('rabbitmq_node_ips') class tripleo::profile::base::manila::api ( - $step = hiera('step'), - $rabbit_hosts = hiera('rabbitmq_node_ips', undef), + $bootstrap_node = hiera('bootstrap_nodeid', undef), + $step = hiera('step'), ) { - if $step >= 4 { - class { '::manila' : - rabbit_hosts => $rabbit_hosts, - } + if $::hostname == downcase($bootstrap_node) { + $sync_db = true + } else { + $sync_db = false + } + + include ::tripleo::profile::base::manila + + if $step >= 3 and $sync_db { + include ::manila::db::mysql + } + + if $step >= 4 or ($step >= 3 and $sync_db) { include ::manila::api } } - diff --git a/manifests/profile/base/manila/scheduler.pp b/manifests/profile/base/manila/scheduler.pp index 8581187..07ea676 100644 --- a/manifests/profile/base/manila/scheduler.pp +++ b/manifests/profile/base/manila/scheduler.pp @@ -18,34 +18,19 @@ # # === Parameters # -# [*bootstrap_node*] -# (Optional) The hostname of the node responsible for bootstrapping tasks -# Defaults to hiera('bootstrap_nodeid') -# # [*step*] # (Optional) The current step in deployment. See tripleo-heat-templates # for more details. # Defaults to hiera('step') # class tripleo::profile::base::manila::scheduler ( - $bootstrap_node = hiera('bootstrap_nodeid', undef), - $step = hiera('step'), + $step = hiera('step'), ) { - if $::hostname == downcase($bootstrap_node) { - $sync_db = true - } else { - $sync_db = false - } - - if $step >= 3 and $sync_db { - include ::manila::db::mysql - } + include ::tripleo::profile::base::manila if $step >= 4 { include ::manila::compute::nova include ::manila::network::neutron include ::manila::scheduler } - } - diff --git a/manifests/profile/base/manila/share.pp b/manifests/profile/base/manila/share.pp index ed64b29..d39c55c 100644 --- a/manifests/profile/base/manila/share.pp +++ b/manifests/profile/base/manila/share.pp @@ -26,8 +26,9 @@ class tripleo::profile::base::manila::share ( $step = hiera('step'), ) { + include ::tripleo::profile::base::manila + if $step >= 4 { include ::manila::share } } - diff --git a/manifests/profile/base/mistral.pp b/manifests/profile/base/mistral.pp index cffb03e..3ebc3d5 100644 --- a/manifests/profile/base/mistral.pp +++ b/manifests/profile/base/mistral.pp @@ -27,9 +27,14 @@ # for more details. # Defaults to hiera('step') # +# [*rabbit_hosts*] +# list of the rabbbit host IPs +# Defaults to hiera('rabbitmq_node_ips') + class tripleo::profile::base::mistral ( $bootstrap_node = hiera('bootstrap_nodeid', undef), $step = hiera('step'), + $rabbit_hosts = hiera('rabbitmq_node_ips', undef), ) { if $::hostname == downcase($bootstrap_node) { $sync_db = true @@ -42,7 +47,9 @@ class tripleo::profile::base::mistral ( } if $step >= 4 or ($step >= 3 and $sync_db) { - include ::mistral + class { '::mistral': + rabbit_hosts => $rabbit_hosts, + } include ::mistral::config include ::mistral::client include ::mistral::db::sync diff --git a/manifests/profile/base/swift/proxy.pp b/manifests/profile/base/swift/proxy.pp index a95d05f..9d50462 100644 --- a/manifests/profile/base/swift/proxy.pp +++ b/manifests/profile/base/swift/proxy.pp @@ -37,7 +37,7 @@ class tripleo::profile::base::swift::proxy ( $memcache_port = 11211, ) { if $step >= 4 { - $swift_memcache_servers = suffix($memcache_servers, ":${memcache_port}") + $swift_memcache_servers = suffix(any2array(normalize_ip_for_uri($memcache_servers)), ":${memcache_port}") include ::swift::proxy include ::swift::proxy::proxy_logging include ::swift::proxy::healthcheck diff --git a/manifests/profile/base/swift/ringbuilder.pp b/manifests/profile/base/swift/ringbuilder.pp index 98a09a0..c77d744 100644 --- a/manifests/profile/base/swift/ringbuilder.pp +++ b/manifests/profile/base/swift/ringbuilder.pp @@ -91,7 +91,7 @@ class tripleo::profile::base::swift::ringbuilder ( # rebalance swift::ringbuilder::rebalance{ ['object', 'account', 'container']: - seed => 999, + seed => '999', } Ring_object_device<| |> ~> Exec['rebalance_object'] diff --git a/manifests/profile/base/swift/storage.pp b/manifests/profile/base/swift/storage.pp index 0b09ea6..d1660de 100644 --- a/manifests/profile/base/swift/storage.pp +++ b/manifests/profile/base/swift/storage.pp @@ -41,7 +41,7 @@ class tripleo::profile::base::swift::storage ( ensure => directory, owner => 'swift', group => 'swift', - require => Package['openstack-swift'], + require => Package['swift'], } } $swift_components = ['account', 'container', 'object'] diff --git a/manifests/profile/base/ui.pp b/manifests/profile/base/ui.pp index 22371d1..681496a 100644 --- a/manifests/profile/base/ui.pp +++ b/manifests/profile/base/ui.pp @@ -20,5 +20,7 @@ class tripleo::profile::base::ui () { package {'openstack-tripleo-ui': } include ::apache + + include ::tripleo::ui } diff --git a/manifests/profile/pacemaker/manila.pp b/manifests/profile/pacemaker/manila.pp index 961278b..a1ff5ca 100644 --- a/manifests/profile/pacemaker/manila.pp +++ b/manifests/profile/pacemaker/manila.pp @@ -27,44 +27,9 @@ # for more details. # Defaults to hiera('step') # -# [*manila_cephfsnative_enable*] -# (Optional) Enable the CephFS Native backend. -# Defaults to hiera('manila_cephfsnative_enable_backend', 'false') -# -# [*cephfs_handles_share_servers*] -# (Optional) -# Defaults to hiera('manila::backend::cephfsnative::driver_handles_share_servers', false) -# -# [*cephfs_backend_name*] -# (Optional) -# Defaults to hiera('manila::backend::cephfsnative::cephfs_backend_name') -# -# [*cephfs_conf_path*] -# (Optional) -# Defaults to hiera('manila::backend::cephfsnative::cephfs_conf_path') -# -# [*cephfs_auth_id*] -# (Optional) -# Defaults to hiera('manila::backend::cephfsnative::cephfs_auth_id') -# -# [*cephfs_cluster_name*] -# (Optional) -# Defaults to hiera('manila::backend::cephfsnative::cephfs_cluster_name') -# -# [*cephfs_enable_snapshots*] -# (Optional) -# Defaults to hiera('manila::backend::cephfsnative::cephfs_enable_snapshots') -# class tripleo::profile::pacemaker::manila ( $bootstrap_node = hiera('bootstrap_nodeid'), $step = hiera('step'), - $manila_cephfsnative_enable = hiera('manila::backend::cephfsnative::enable_backend', false), - $cephfs_handles_share_servers = hiera('manila::backend::cephfsnative::driver_handles_share_servers'), - $cephfs_backend_name = hiera('manila::backend::cephfsnative::cephfs_backend_name'), - $cephfs_conf_path = hiera('manila::backend::cephfsnative::cephfs_conf_path'), - $cephfs_auth_id = hiera('manila::backend::cephfsnative::cephfs_auth_id'), - $cephfs_cluster_name = hiera('manila::backend::cephfsnative::cephfs_cluster_name'), - $cephfs_enable_snapshots = hiera('manila::backend::cephfsnative::cephfs_enable_snapshots'), ) { if $::hostname == downcase($bootstrap_node) { $pacemaker_master = true @@ -81,11 +46,11 @@ class tripleo::profile::pacemaker::manila ( stop => '/bin/true', } - if $step >= 4 { - include ::tripleo::profile::base::manila::api - include ::tripleo::profile::base::manila::scheduler - include ::tripleo::profile::base::manila::share + include ::tripleo::profile::base::manila::api + include ::tripleo::profile::base::manila::scheduler + include ::tripleo::profile::base::manila::share + if $step >= 4 { # manila generic: $manila_generic_enable = hiera('manila_generic_enable_backend', false) if $manila_generic_enable { @@ -116,15 +81,16 @@ class tripleo::profile::pacemaker::manila ( } # manila cephfsnative: + $manila_cephfsnative_enable = hiera('manila::backend::cephfsnative::enable_backend', false) if $manila_cephfsnative_enable { $manila_cephfsnative_backend = hiera('manila::backend::cephfsnative::title') manila::backend::cephfsnative { $manila_cephfsnative_backend : - driver_handles_share_servers => $cephfs_handles_share_servers, - cephfs_backend_name => $cephfs_backend_name, - cephfs_conf_path => $cephfs_conf_path, - cephfs_auth_id => $cephfs_auth_id, - cephfs_cluster_name => $cephfs_cluster_name, - cephfs_enable_snapshots => $cephfs_enable_snapshots, + driver_handles_share_servers => hiera('manila::backend::cephfsnative::driver_handles_share_servers', false), + share_backend_name => hiera('manila::backend::cephfsnative::share_backend_name'), + cephfs_conf_path => hiera('manila::backend::cephfsnative::cephfs_conf_path'), + cephfs_auth_id => hiera('manila::backend::cephfsnative::cephfs_auth_id'), + cephfs_cluster_name => hiera('manila::backend::cephfsnative::cephfs_cluster_name'), + cephfs_enable_snapshots => hiera('manila::backend::cephfsnative::cephfs_enable_snapshots'), } } diff --git a/manifests/ui.pp b/manifests/ui.pp new file mode 100644 index 0000000..0a12af0 --- /dev/null +++ b/manifests/ui.pp @@ -0,0 +1,108 @@ +# Copyright 2016 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# == Class: tripleo::ui +# +# Configure TripleO UI. +# +# === Parameters: +# +# [*servername*] +# The servername for the virtualhost. +# Optional. Defaults to $::fqdn +# +# [*bind_host*] +# The host/ip address Apache will listen on. +# Optional. Defaults to undef (listen on all ip addresses). +# +# [*ui_port*] +# The port on which the UI is listening. +# Defaults to 3000 +# +# [*keystone_url*] +# The keystone service url +# Defaults to hiera('keystone::endpoint::public_url') +# +# [*heat_url*] +# The heat service url +# Defaults to hiera('heat::keystone::auth::public_url') +# +# [*heat_url*] +# The heat service url +# Defaults to hiera('heat::keystone::auth::public_url') +# +# [*heat_url*] +# The heat service url +# Defaults to hiera('heat::keystone::auth::public_url') +# +# [*ironic_url*] +# The ironic service url +# Defaults to hiera('ironic::keystone::auth::public_url') +# +# [*mistral_url*] +# The mistral service url +# Defaults to hiera('mistral::keystone::auth::public_url') +# +# [*swift_url*] +# The swift service url +# Defaults to hiera('swift::keystone::auth::public_url') +# +# [*zaqar_websocket_url*] +# The zaqar websocket url +# Defaults to hiera('zaquar::keystone::auth_websocket::public_url') +# +# [*zaqar_default_queue*] +# The zaqar default queue +# A string. +# Defaults to 'tripleo' +# +class tripleo::ui ( + $servername = $::fqdn, + $bind_host = undef, + $ui_port = 3000, + $keystone_url = hiera('keystone::endpoint::public_url'), + $heat_url = hiera('heat::keystone::auth::public_url', undef), + $ironic_url = hiera('ironic::keystone::auth::public_url', undef), + $mistral_url = hiera('mistral::keystone::auth::public_url', undef), + $swift_url = hiera('swift::keystone::auth::public_url', undef), + $zaqar_websocket_url = hiera('zaqar::keystone::auth_websocket::public_url', undef), + $zaqar_default_queue = 'tripleo' +) { + + ::apache::vhost { 'tripleo-ui': + ensure => 'present', + servername => $servername, + ip => $bind_host, + port => $ui_port, + docroot => '/var/www/openstack-tripleo-ui/dist', + options => ['Indexes', 'FollowSymLinks'], + rewrites => [ + { + comment => 'Redirect 404 to index', + rewrite_cond => ['%{REQUEST_FILENAME} !-f', '%{REQUEST_FILENAME} !-d'], + rewrite_rule => ['(.*) index.html'], + }, + ], + } + + file { '/var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js' : + ensure => file, + content => template('tripleo/ui/tripleo_ui_config.js.erb'), + owner => 'root', + group => 'root', + mode => '0644', + } + +} diff --git a/metadata.json b/metadata.json index dfeb9b1..ffb856f 100644 --- a/metadata.json +++ b/metadata.json @@ -14,11 +14,11 @@ ], "operatingsystem_support": [ { - "operatingsystem": "Fedora", - "operatingsystemrelease": ["20"] + "operatingsystem": "RedHat", + "operatingsystemrelease": ["7"] }, { - "operatingsystem": "RedHat", + "operatingsystem": "CentOS", "operatingsystemrelease": ["7"] } ], diff --git a/spec/classes/tripleo_cluster_cassandra_spec.rb b/spec/classes/tripleo_cluster_cassandra_spec.rb index 13be98e..3f7d471 100644 --- a/spec/classes/tripleo_cluster_cassandra_spec.rb +++ b/spec/classes/tripleo_cluster_cassandra_spec.rb @@ -19,15 +19,7 @@ require 'spec_helper' describe 'tripleo::cluster::cassandra' do - shared_examples_for 'cassandra cluster service' do - - let :facts do - { - :hostname => 'host1.midonet', - :osfamily => 'RedHat', - :operatingsystemmajrelease => 7, - } - end + shared_examples_for 'tripleo::cluster::cassandra' do let :params do { @@ -49,6 +41,14 @@ describe 'tripleo::cluster::cassandra' do end end - it_configures 'cassandra cluster service' + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end + + it_behaves_like 'tripleo::cluster::cassandra' + end + end end diff --git a/spec/classes/tripleo_cluster_zookeeper_spec.rb b/spec/classes/tripleo_cluster_zookeeper_spec.rb index ed46164..fc003b6 100644 --- a/spec/classes/tripleo_cluster_zookeeper_spec.rb +++ b/spec/classes/tripleo_cluster_zookeeper_spec.rb @@ -19,97 +19,68 @@ require 'spec_helper' describe 'tripleo::cluster::zookeeper' do - let :default_params do - { - :zookeeper_server_ips => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], - :zookeeper_hostnames => ['host1.midonet', 'host2.midonet', 'host3.midonet'] - } - end - - context 'on host1' do - let :facts do - { - :hostname => 'host1.midonet', - :osfamily => 'RedHat', - :operatingsystemmajrelease => 7, - } - end - + shared_examples_for 'tripleo::cluster::zookeeper' do let :params do - { - :zookeeper_client_ip => '23.43.2.34' - } - end - - before do - params.merge!(default_params) - end - - it 'should call zookeeper using id==1' do - is_expected.to contain_class('zookeeper').with( - :servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], - :client_ip => '23.43.2.34', - :id => 1 - ) - end - - end - - context 'on host2' do - let :facts do { - :hostname => 'host2.midonet', - :osfamily => 'RedHat', - :operatingsystemmajrelease => 7, + :zookeeper_server_ips => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], + :zookeeper_hostnames => ['host1.midonet', 'host2.midonet', 'host3.midonet'] } end - let :params do - { - :zookeeper_client_ip => '23.43.2.35' - } + context 'on host1' do + before :each do + facts.merge!({ :hostname => 'host1.midonet'}) + params.merge!({ :zookeeper_client_ip => '23.43.2.34' }) + end + + it 'should call zookeeper using id==1' do + is_expected.to contain_class('zookeeper').with( + :servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], + :client_ip => '23.43.2.34', + :id => 1 + ) + end end - before do - params.merge!(default_params) + context 'on host2' do + before :each do + facts.merge!({ :hostname => 'host2.midonet'}) + params.merge!({ :zookeeper_client_ip => '23.43.2.35' }) + end + + it 'should call zookeeper using id==1' do + is_expected.to contain_class('zookeeper').with( + :servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], + :client_ip => '23.43.2.35', + :id => 2 + ) + end end - it 'should call zookeeper using id==1' do - is_expected.to contain_class('zookeeper').with( - :servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], - :client_ip => '23.43.2.35', - :id => 2 - ) - end - end + context 'on host3' do + before :each do + facts.merge!({ :hostname => 'host3.midonet'}) + params.merge!({ :zookeeper_client_ip => '23.43.2.36' }) + end - context 'on host3' do - let :facts do - { - :hostname => 'host3.midonet', - :osfamily => 'RedHat', - :operatingsystemmajrelease => 7, - } - end + it 'should call zookeeper using id==1' do + is_expected.to contain_class('zookeeper').with( + :servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], + :client_ip => '23.43.2.36', + :id => 3 + ) + end - let :params do - { - :zookeeper_client_ip => '23.43.2.36' - } end + end - before do - params.merge!(default_params) - end + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end - it 'should call zookeeper using id==1' do - is_expected.to contain_class('zookeeper').with( - :servers => ['23.43.2.34', '23.43.2.35', '24.43.2.36'], - :client_ip => '23.43.2.36', - :id => 3 - ) + it_behaves_like 'tripleo::cluster::zookeeper' end - end - end diff --git a/spec/classes/tripleo_firewall_spec.rb b/spec/classes/tripleo_firewall_spec.rb index 27ac62a..1270aa7 100644 --- a/spec/classes/tripleo_firewall_spec.rb +++ b/spec/classes/tripleo_firewall_spec.rb @@ -24,7 +24,7 @@ describe 'tripleo::firewall' do { } end - shared_examples_for 'tripleo node' do + shared_examples_for 'tripleo::firewall' do context 'with firewall enabled' do before :each do @@ -114,23 +114,13 @@ describe 'tripleo::firewall' do end - context 'on Debian platforms' do - let :facts do - { :osfamily => 'Debian' } - end - - it_configures 'tripleo node' - end + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end - context 'on RedHat platforms' do - let :facts do - { - :osfamily => 'RedHat', - :operatingsystemrelease => '7.1', - } + it_behaves_like 'tripleo::firewall' end - - it_configures 'tripleo node' end - end diff --git a/spec/classes/tripleo_host_sriov_spec.rb b/spec/classes/tripleo_host_sriov_spec.rb index 15d3813..920eb9b 100644 --- a/spec/classes/tripleo_host_sriov_spec.rb +++ b/spec/classes/tripleo_host_sriov_spec.rb @@ -2,15 +2,7 @@ require 'spec_helper' describe 'tripleo::host::sriov' do - shared_examples_for 'sriov vfs configuration for Red Hat distributions' do - - let :facts do - { - :osfamily => 'RedHat', - :operatingsystemmajrelease => 7, - } - end - + shared_examples_for 'tripleo::host::sriov' do let :params do {:number_of_vfs => []} end @@ -35,5 +27,13 @@ describe 'tripleo::host::sriov' do end end - it_configures 'sriov vfs configuration for Red Hat distributions' + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end + + it_behaves_like 'tripleo::host::sriov' + end + end end diff --git a/spec/classes/tripleo_midonet_agent_spec.rb b/spec/classes/tripleo_midonet_agent_spec.rb index eb3abfe..73d90b6 100644 --- a/spec/classes/tripleo_midonet_agent_spec.rb +++ b/spec/classes/tripleo_midonet_agent_spec.rb @@ -19,17 +19,7 @@ require 'spec_helper' describe 'tripleo::network::midonet::agent' do - let :facts do - { - :hostname => 'host2.midonet', - :osfamily => 'RedHat', - :operatingsystem => 'CentOS', - :operatingsystemrelease => '7.1', - :operatingsystemmajrelease => 7, - } - end - - shared_examples_for 'midonet agent test' do + shared_examples_for 'tripleo::network::midonet::agent' do let :params do { @@ -56,7 +46,13 @@ describe 'tripleo::network::midonet::agent' do end end - it_configures 'midonet agent test' - + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end + it_behaves_like 'tripleo::network::midonet::agent' + end + end end diff --git a/spec/classes/tripleo_midonet_api_spec.rb b/spec/classes/tripleo_midonet_api_spec.rb index 4b47294..25b375b 100644 --- a/spec/classes/tripleo_midonet_api_spec.rb +++ b/spec/classes/tripleo_midonet_api_spec.rb @@ -19,13 +19,7 @@ require 'spec_helper' describe 'tripleo::network::midonet::api' do - let :facts do - { - :augeasversion => '1.0.0' - } - end - - shared_examples_for 'midonet api test' do + shared_examples_for 'tripleo::midonet::api' do let :params do { @@ -67,6 +61,16 @@ describe 'tripleo::network::midonet::api' do end - it_configures 'midonet api test' + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({ + :augeasversion => '1.0.0' + }) + end + + it_behaves_like 'tripleo::midonet::api' + end + end end diff --git a/spec/classes/tripleo_packages_spec.rb b/spec/classes/tripleo_packages_spec.rb index 80e5d7e..076d9cd 100644 --- a/spec/classes/tripleo_packages_spec.rb +++ b/spec/classes/tripleo_packages_spec.rb @@ -17,19 +17,12 @@ require 'spec_helper' describe 'tripleo::packages' do - shared_examples_for 'Red Hat distributions' do + shared_examples_for 'tripleo::packages' do let :pre_condition do "service{'nova-compute': ensure => 'running'}" end - let :facts do - { - :osfamily => 'RedHat', - :operatingsystemmajrelease => 7, - } - end - let :params do { :enable_upgrade => true @@ -43,6 +36,15 @@ describe 'tripleo::packages' do end - it_configures 'Red Hat distributions' + + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end + + it_behaves_like 'tripleo::packages' + end + end end diff --git a/spec/classes/tripleo_profile_base_swift_proxy_spec.rb b/spec/classes/tripleo_profile_base_swift_proxy_spec.rb new file mode 100644 index 0000000..68d7dde --- /dev/null +++ b/spec/classes/tripleo_profile_base_swift_proxy_spec.rb @@ -0,0 +1,92 @@ +# +# Copyright (C) 2016 Red Hat Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +require 'spec_helper' + +describe 'tripleo::profile::base::swift::proxy' do + + let :params do + { } + end + + shared_examples_for 'tripleo::profile::base::swift::proxy' do + + let :pre_condition do + "class { '::swift': + swift_hash_path_prefix => 'foo', + } + include ::memcached + class { '::swift::proxy': + proxy_local_net_ip => '127.0.0.1', + }" + end + + context 'with ipv4 memcache servers' do + before :each do + params.merge!( + :step => 4, + :memcache_servers => ['192.168.0.1', '192.168.0.2'], + ) + end + + it 'configure swift proxy cache with ipv4 ips' do + is_expected.to contain_class('swift::proxy::cache').with({ + :memcache_servers => ['192.168.0.1:11211', '192.168.0.2:11211'] + }) + end + end + + context 'with ipv6 memcache servers' do + before :each do + params.merge!( + :step => 4, + :memcache_servers => ['::1', '::2'], + ) + end + + it 'configure swift proxy cache with ipv6 ips' do + is_expected.to contain_class('swift::proxy::cache').with({ + :memcache_servers => ['[::1]:11211', '[::2]:11211'] + }) + end + end + + context 'with ipv4, ipv6 and fqdn memcache servers' do + before :each do + params.merge!( + :step => 4, + :memcache_servers => ['192.168.0.1', '::2', 'myserver.com'], + ) + end + + it 'configure swift proxy cache with ips and fqdn' do + is_expected.to contain_class('swift::proxy::cache').with({ + :memcache_servers => ['192.168.0.1:11211', '[::2]:11211', 'myserver.com:11211'] + }) + end + end + + end + + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end + + it_behaves_like 'tripleo::profile::base::swift::proxy' + end + end +end diff --git a/spec/classes/tripleo_selinux_spec.rb b/spec/classes/tripleo_selinux_spec.rb index 301006b..f49f87b 100644 --- a/spec/classes/tripleo_selinux_spec.rb +++ b/spec/classes/tripleo_selinux_spec.rb @@ -19,11 +19,14 @@ require 'spec_helper' describe 'tripleo::selinux' do - shared_examples_for 'manage selinux' do + shared_examples_for 'tripleo::selinux' do context 'with selinux enforcing' do before :each do - facts.merge!( :selinux_current_mode => 'enforcing' ) + facts.merge!({ + :selinux => true, + :selinux_current_mode => 'enforcing' + }) end let :params do @@ -55,7 +58,7 @@ describe 'tripleo::selinux' do context 'with selinux disabled' do before :each do - facts.merge!( :selinux => 'false' ) + facts.merge!({ :selinux => 'false' }) end let :params do @@ -89,18 +92,19 @@ describe 'tripleo::selinux' do context 'on Debian platforms' do let :facts do - { :osfamily => 'Debian' } + { :osfamily => 'Debian' } end it_raises 'a Puppet::Error', /OS family unsuppored yet \(Debian\), SELinux support is only limited to RedHat family OS/ end - context 'on RedHat platforms' do - let :facts do - { :osfamily => 'RedHat' } - end + on_supported_os.each do |os, facts| + context "on #{os}" do + let(:facts) do + facts.merge({}) + end - it_configures 'manage selinux' + it_behaves_like 'tripleo::selinux' + end end - end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 251160e..b06b436 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,23 +1,24 @@ +# Load libraries from openstacklib here to simulate how they live together in a real puppet run (for provider unit tests) +$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib')) require 'puppetlabs_spec_helper/module_spec_helper' require 'shared_examples' +require 'puppet-openstack_spec_helper/defaults' +require 'rspec-puppet-facts' +include RspecPuppetFacts + fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |c| c.alias_it_should_behave_like_to :it_configures, 'configures' c.alias_it_should_behave_like_to :it_raises, 'raises' + c.hiera_config = File.join(fixture_path, 'hiera.yaml') c.module_path = File.join(fixture_path, 'modules') c.manifest_dir = File.join(fixture_path, 'manifests') - c.default_facts = { - :kernel => 'Linux', - :concat_basedir => '/var/lib/puppet/concat', - :memorysize => '1000 MB', - :processorcount => '1', - :puppetversion => '3.7.3', - :uniqueid => '123' - } + # custom global facts for all rspec tests + add_custom_fact :concat_basedir, '/var/lib/puppet/concat' end at_exit { RSpec::Puppet::Coverage.report! } diff --git a/templates/ui/tripleo_ui_config.js.erb b/templates/ui/tripleo_ui_config.js.erb new file mode 100644 index 0000000..aca21cd --- /dev/null +++ b/templates/ui/tripleo_ui_config.js.erb @@ -0,0 +1,14 @@ +window.tripleOUiConfig = { + "keystone": "<%= @keystone_url %>", + + // The UI automatically discovers below URLs by querying keystone but can be + // changed here if desired. + //"heat": "<%= @heat_url %>", + //"ironic": "<%= @ironic_url %>", + //"mistral": "<%= @mistral_url %>", + //"swift": "<%= @swift_url %>", + //"zaqar_websocket_url": "<%= @zaqar_websocket_url %>", + + // Default websocket queue name + "zaqar_default_queue": "<%= @zaqar_default_queue %>" +}; |