diff --git a/README.md b/README.md index cc6cbd32a..a00ec283a 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ scenario](#all-in-one). | ceph | X | | | X | | | ceph rgw | | | | X | | | mongodb | | X | | | | +| watcher | | | | X | | When the Jenkins slave is created, the *run_tests.sh* script will executed. This script will execute *install_modules.sh* that prepare /etc/puppet/modules diff --git a/fixtures/scenario004.pp b/fixtures/scenario004.pp index 261434853..aa3c67de9 100644 --- a/fixtures/scenario004.pp +++ b/fixtures/scenario004.pp @@ -16,11 +16,14 @@ # Disable SSL (workaround for Xenial) if $::operatingsystem == 'Ubuntu' { - $ssl_enabled = false - $ipv6 = false + $ssl_enabled = false + $ipv6 = false + # Watcher packages are not available in Ubuntu repository. + $watcher_enabled = false } else { - $ssl_enabled = true - $ipv6 = true + $ssl_enabled = true + $ipv6 = true + $watcher_enabled = true } include ::openstack_integration @@ -48,9 +51,14 @@ class { '::openstack_integration::ceph': deploy_rgw => true, swift_dropin => true, } +if $watcher_enabled { + include ::openstack_integration::watcher +} include ::openstack_integration::provision # Don't test swift, radosgw won't pass the current tests # Glance, nova, neutron are true by default. -include ::openstack_integration::tempest +class { '::openstack_integration::tempest': + watcher => $watcher_enabled, +} diff --git a/manifests/tempest.pp b/manifests/tempest.pp index 12e1c6a1b..db405d824 100644 --- a/manifests/tempest.pp +++ b/manifests/tempest.pp @@ -72,6 +72,10 @@ # (optional) Define if Trove needs to be tested. # Default to false. # +# [*watcher*] +# (optional) Define if Watcher needs to be tested. +# Default to false. +# # [*zaqar*] # (optional) Define if Zaqar needs to be tested. # Default to false. @@ -99,6 +103,7 @@ class openstack_integration::tempest ( $sahara = false, $swift = false, $trove = false, + $watcher = false, $zaqar = false, $attach_encrypted_volume = false, ) { @@ -155,6 +160,7 @@ class openstack_integration::tempest ( mistral_available => $mistral, gnocchi_available => $gnocchi, ec2api_available => $ec2api, + watcher_available => $watcher, public_network_name => 'public', dashboard_url => $::openstack_integration::config::base_url, flavor_ref => '42', diff --git a/manifests/watcher.pp b/manifests/watcher.pp new file mode 100644 index 000000000..0a2198b51 --- /dev/null +++ b/manifests/watcher.pp @@ -0,0 +1,73 @@ +class openstack_integration::watcher { + + include ::openstack_integration::config + include ::openstack_integration::params + + rabbitmq_user { 'watcher': + admin => true, + password => 'my_secret', + provider => 'rabbitmqctl', + require => Class['rabbitmq'], + } + rabbitmq_user_permissions { 'watcher@/': + configure_permission => '.*', + write_permission => '.*', + read_permission => '.*', + provider => 'rabbitmqctl', + require => Class['rabbitmq'], + } + + if $::openstack_integration::config::ssl { + openstack_integration::ssl_key { 'watcher': + require => Package['watcher'], + } + } + class { '::watcher::db::mysql': + password => 'watcher', + } + class { '::watcher::db': + database_connection => 'mysql+pymysql://watcher:watcher@127.0.0.1/watcher?charset=utf8', + } + # TODO: Support SSL + class { '::watcher::keystone::auth': + password => 'a_big_secret', + public_url => "http://${::openstack_integration::config::ip_for_url}:9322", + admin_url => "http://${::openstack_integration::config::ip_for_url}:9322", + internal_url => "http://${::openstack_integration::config::ip_for_url}:9322", + } + class {'::watcher::keystone::authtoken': + password => 'a_big_secret', + auth_version => 'v3', + user_domain_name => 'Default', + project_domain_name => 'Default', + auth_url => "${::openstack_integration::config::keystone_admin_uri}/v3", + auth_uri => "${::openstack_integration::config::keystone_auth_uri}/v3", + memcached_servers => $::openstack_integration::config::memcached_servers, + } + class { '::watcher::logging': + debug => true, + } + class { '::watcher': + default_transport_url => os_transport_url({ + 'transport' => 'rabbit', + 'host' => $::openstack_integration::config::host, + 'port' => $::openstack_integration::config::rabbit_port, + 'username' => 'watcher', + 'password' => 'my_secret', + }), + rabbit_use_ssl => $::openstack_integration::config::ssl, + } + class { '::watcher::api': + watcher_api_bind_host => $::openstack_integration::config::host, + watcher_client_password => 'a_big_secret', + create_db_schema => true, + upgrade_db => true, + } + class { '::watcher::applier': + applier_workers => '2', + } + class { '::watcher::decision_engine': + decision_engine_workers => '2', + } + +}