diff --git a/Puppetfile b/Puppetfile index 23563f45c..8d607d8e8 100755 --- a/Puppetfile +++ b/Puppetfile @@ -124,6 +124,10 @@ mod 'nssdb', :git => 'https://github.com/rcritten/puppet-nssdb', :ref => 'master' +mod 'panko', + :git => 'https://github.com/openstack/puppet-panko', + :ref => 'master' + mod 'rabbitmq', :git => 'https://github.com/puppetlabs/puppetlabs-rabbitmq', :ref => 'master' diff --git a/README.md b/README.md index ae301a131..61ed5ec00 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,7 @@ This is the current matrix of available tests: | ceilometer | | | X | | aodh | | | X | | gnocchi | | | X | +| panko | | | X | | heat | | | X | | swift | | X | | | sahara | | X | | diff --git a/docs/packstack.rst b/docs/packstack.rst index db3c7a205..b2bda57dc 100755 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -68,6 +68,9 @@ Global Options **CONFIG_GNOCCHI_INSTALL** Specify 'y' to install OpenStack Metering as a Service (gnocchi). ['y', 'n'] +**CONFIG_PANKO_INSTALL** + Specify 'y' to install OpenStack Events Service (panko). ['y', 'n'] + **CONFIG_HEAT_INSTALL** Specify 'y' to install OpenStack Orchestration (heat). ['y', 'n'] @@ -1101,6 +1104,15 @@ Gnocchi Config parameters **CONFIG_GNOCCHI_KS_PW** Password to use for Gnocchi to authenticate with the Identity service. +Panko Config parameters +------------------------- + +**CONFIG_PANKO_DB_PW** + Password to use for Panko to access the database. + +**CONFIG_PANKO_KS_PW** + Password to use for Panko to authenticate with the Identity service. + Sahara Config parameters ------------------------ diff --git a/packstack/plugins/ceilometer_800.py b/packstack/plugins/ceilometer_800.py index b8ed3d714..ba46a5295 100644 --- a/packstack/plugins/ceilometer_800.py +++ b/packstack/plugins/ceilometer_800.py @@ -93,6 +93,17 @@ def initConfig(controller): "USE_DEFAULT": True, "NEED_CONFIRM": False, "CONDITION": False}, + + {"CONF_NAME": "CONFIG_CEILOMETER_EVENTS_BACKEND", + "CMD_OPTION": "ceilometer-events-backend", + "PROMPT": "Enter the events backend to use", + "OPTION_LIST": ['database', 'panko'], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": 'database', + "MASK_INPUT": False, + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, ], "MONGODB": [ diff --git a/packstack/plugins/panko_820.py b/packstack/plugins/panko_820.py new file mode 100644 index 000000000..c844ba0d7 --- /dev/null +++ b/packstack/plugins/panko_820.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +# 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. + +""" +Installs and configures Panko +""" + +from packstack.installer import basedefs +from packstack.installer import utils +from packstack.installer import validators +from packstack.installer import processors + +from packstack.modules.documentation import update_params_usage + +# ------------- Panko Packstack Plugin Initialization -------------- + +PLUGIN_NAME = "OS-Panko" +PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue') + + +def initConfig(controller): + panko_params = { + "PANKO": [ + {"CONF_NAME": "CONFIG_PANKO_DB_PW", + "CMD_OPTION": "panko-db-passwd", + "PROMPT": "Enter the password for Panko DB access", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "PW_PLACEHOLDER", + "PROCESSORS": [processors.process_password], + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "USE_DEFAULT": False, + "NEED_CONFIRM": True, + "CONDITION": False}, + {"CONF_NAME": "CONFIG_PANKO_KS_PW", + "CMD_OPTION": "panko-ks-passwd", + "PROMPT": "Enter the password for the Panko Keystone access", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "PW_PLACEHOLDER", + "PROCESSORS": [processors.process_password], + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "USE_DEFAULT": False, + "NEED_CONFIRM": True, + "CONDITION": False} + ] + } + + update_params_usage(basedefs.PACKSTACK_DOC, panko_params) + + def use_panko(config): + return (config['CONFIG_CEILOMETER_INSTALL'] == 'y' and + config['CONFIG_PANKO_INSTALL'] == 'y') + + panko_groups = [ + {"GROUP_NAME": "PANKO", + "DESCRIPTION": "Panko Config parameters", + "PRE_CONDITION": use_panko, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + ] + for group in panko_groups: + paramList = panko_params[group["GROUP_NAME"]] + controller.addGroup(group, paramList) + + +def initSequences(controller): + if (controller.CONF['CONFIG_PANKO_INSTALL'] != 'y' or + controller.CONF['CONFIG_CEILOMETER_INSTALL'] != 'y'): + return + + steps = [{'title': 'Preparing Panko entries', + 'functions': [create_manifest]}] + controller.addSequence("Installing OpenStack Panko", [], [], + steps) + + +# -------------------------- step functions -------------------------- + +def create_manifest(config, messages): + fw_details = dict() + key = "panko_api" + fw_details.setdefault(key, {}) + fw_details[key]['host'] = "ALL" + fw_details[key]['service_name'] = "panko-api" + fw_details[key]['chain'] = "INPUT" + fw_details[key]['ports'] = ['8779'] + fw_details[key]['proto'] = "tcp" + config['FIREWALL_PANKO_RULES'] = fw_details diff --git a/packstack/plugins/prescript_000.py b/packstack/plugins/prescript_000.py index ee77afa2b..d72773c7e 100755 --- a/packstack/plugins/prescript_000.py +++ b/packstack/plugins/prescript_000.py @@ -245,6 +245,19 @@ def initConfig(controller): "NEED_CONFIRM": False, "CONDITION": False}, + {"CMD_OPTION": "os-panko-install", + "PROMPT": ( + "Should Packstack install OpenStack Events Service (Panko)" + ), + "OPTION_LIST": ["y", "n"], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": "n", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_PANKO_INSTALL", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, {"CMD_OPTION": "os-sahara-install", "PROMPT": ( diff --git a/packstack/plugins/puppet_950.py b/packstack/plugins/puppet_950.py index 7837936e5..fa8eb8c6e 100755 --- a/packstack/plugins/puppet_950.py +++ b/packstack/plugins/puppet_950.py @@ -150,7 +150,7 @@ def copy_puppet_modules(config, messages): 'gnocchi', 'heat', 'horizon', 'inifile', 'ironic', 'keystone', 'magnum', 'manila', 'memcached', 'mongodb', 'mysql', 'neutron', 'nova', 'nssdb', 'openstack', - 'openstacklib', 'oslo', 'packstack', 'rabbitmq', + 'openstacklib', 'oslo', 'packstack', 'panko', 'rabbitmq', 'redis', 'remote', 'rsync', 'sahara', 'ssh', 'stdlib', 'swift', 'sysctl', 'tempest', 'trove', 'vcsrepo', 'vswitch', 'xinetd', )) diff --git a/packstack/puppet/modules/packstack/manifests/apache.pp b/packstack/puppet/modules/packstack/manifests/apache.pp index b6e2e8666..0df104906 100644 --- a/packstack/puppet/modules/packstack/manifests/apache.pp +++ b/packstack/puppet/modules/packstack/manifests/apache.pp @@ -31,5 +31,10 @@ class packstack::apache () # Gnocchi port apache::listen { '8041': } } + + if hiera('CONFIG_PANKO_INSTALL') == 'y' { + # Panko port + apache::listen { '8779': } + } } diff --git a/packstack/puppet/modules/packstack/manifests/ceilometer.pp b/packstack/puppet/modules/packstack/manifests/ceilometer.pp index 70e09492a..6c3b4333d 100644 --- a/packstack/puppet/modules/packstack/manifests/ceilometer.pp +++ b/packstack/puppet/modules/packstack/manifests/ceilometer.pp @@ -8,6 +8,8 @@ class packstack::ceilometer () $config_ceilometer_metering_backend = hiera('CONFIG_CEILOMETER_METERING_BACKEND') + $config_ceilometer_events_backend = hiera('CONFIG_CEILOMETER_EVENTS_BACKEND') + $config_gnocchi_host = hiera('CONFIG_KEYSTONE_HOST_URL') if $config_ceilometer_coordination_backend == 'redis' { @@ -33,6 +35,7 @@ class packstack::ceilometer () class { '::ceilometer::collector': meter_dispatcher => $config_ceilometer_metering_backend, + event_dispatcher => $config_ceilometer_events_backend, } if $config_ceilometer_metering_backend == 'gnocchi' { diff --git a/packstack/puppet/modules/packstack/manifests/keystone/panko.pp b/packstack/puppet/modules/packstack/manifests/keystone/panko.pp new file mode 100644 index 000000000..b9ff57d9c --- /dev/null +++ b/packstack/puppet/modules/packstack/manifests/keystone/panko.pp @@ -0,0 +1,12 @@ +class packstack::keystone::panko () +{ + $keystone_host_url = hiera('CONFIG_KEYSTONE_HOST_URL') + + class { '::panko::keystone::auth': + region => hiera('CONFIG_KEYSTONE_REGION'), + password => hiera('CONFIG_PANKO_KS_PW'), + public_url => "http://${keystone_host_url}:8779", + admin_url => "http://${keystone_host_url}:8779", + internal_url => "http://${keystone_host_url}:8779", + } +} diff --git a/packstack/puppet/modules/packstack/manifests/mariadb/services.pp b/packstack/puppet/modules/packstack/manifests/mariadb/services.pp index 89bec45f8..b53535500 100755 --- a/packstack/puppet/modules/packstack/manifests/mariadb/services.pp +++ b/packstack/puppet/modules/packstack/manifests/mariadb/services.pp @@ -114,6 +114,15 @@ class packstack::mariadb::services () } } + if hiera('CONFIG_PANKO_INSTALL') == 'y' and + hiera('CONFIG_CEILOMETER_INSTALL') == 'y' { + class { '::panko::db::mysql': + password => hiera('CONFIG_PANKO_DB_PW'), + host => '%', + allowed_hosts => '%', + } + } + if hiera('CONFIG_SAHARA_INSTALL') == 'y' { class { '::sahara::db::mysql': password => hiera('CONFIG_SAHARA_DB_PW'), diff --git a/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp b/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp index 5d48b14b2..7bad034de 100755 --- a/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp +++ b/packstack/puppet/modules/packstack/manifests/mariadb/services_remote.pp @@ -152,6 +152,37 @@ class packstack::mariadb::services_remote () { } } + if hiera('CONFIG_PANKO_INSTALL') == 'y' { + remote_database { 'panko': + ensure => 'present', + charset => 'utf8', + db_host => hiera('CONFIG_MARIADB_HOST'), + db_user => hiera('CONFIG_MARIADB_USER'), + db_password => hiera('CONFIG_MARIADB_PW'), + provider => 'mysql', + } + + $panko_cfg_db_pw = hiera('CONFIG_PANKO_DB_PW') + + remote_database_user { 'panko@%': + password_hash => mysql_password($panko_cfg_db_pw), + db_host => hiera('CONFIG_MARIADB_HOST'), + db_user => hiera('CONFIG_MARIADB_USER'), + db_password => hiera('CONFIG_MARIADB_PW'), + provider => 'mysql', + require => Remote_database['panko'], + } + + remote_database_grant { 'panko@%/panko': + privileges => 'all', + db_host => hiera('CONFIG_MARIADB_HOST'), + db_user => hiera('CONFIG_MARIADB_USER'), + db_password => hiera('CONFIG_MARIADB_PW'), + provider => 'mysql', + require => Remote_database_user['panko@%'], + } + } + if hiera('CONFIG_HEAT_INSTALL') == 'y' { remote_database { 'heat': ensure => 'present', diff --git a/packstack/puppet/modules/packstack/manifests/panko.pp b/packstack/puppet/modules/packstack/manifests/panko.pp new file mode 100644 index 000000000..2f1fc35fc --- /dev/null +++ b/packstack/puppet/modules/packstack/manifests/panko.pp @@ -0,0 +1,39 @@ +class packstack::panko () +{ + create_resources(packstack::firewall, hiera('FIREWALL_PANKO_RULES', {})) + + $panko_cfg_db_pw = hiera('CONFIG_PANKO_DB_PW') + $panko_cfg_mariadb_host = hiera('CONFIG_MARIADB_HOST_URL') + + class { '::panko::wsgi::apache': + workers => hiera('CONFIG_SERVICE_WORKERS'), + threads => hiera('CONFIG_SERVICE_WORKERS'), + ssl => false + } + + include ::panko + + class { '::panko::db': + database_connection => "mysql+pymysql://panko:${panko_cfg_db_pw}@${panko_cfg_mariadb_host}/panko?charset=utf8", + } + + $bind_host = hiera('CONFIG_IP_VERSION') ? { + 'ipv6' => '::0', + default => '0.0.0.0', + } + + class { '::panko::keystone::authtoken': + auth_uri => hiera('CONFIG_KEYSTONE_PUBLIC_URL'), + auth_url => hiera('CONFIG_KEYSTONE_ADMIN_URL'), + auth_version => hiera('CONFIG_KEYSTONE_API_VERSION'), + password => hiera('CONFIG_PANKO_KS_PW') + } + + class { '::panko::api': + host => $bind_host, + service_name => 'httpd' + } + + include ::panko::db::sync + +} diff --git a/packstack/puppet/templates/controller.pp b/packstack/puppet/templates/controller.pp index c2476fcda..144250470 100755 --- a/packstack/puppet/templates/controller.pp +++ b/packstack/puppet/templates/controller.pp @@ -171,6 +171,11 @@ if hiera('CONFIG_CEILOMETER_INSTALL') == 'y' and hiera('CONFIG_GNOCCHI_INSTALL') include '::packstack::gnocchi' } +if hiera('CONFIG_CEILOMETER_INSTALL') == 'y' and hiera('CONFIG_PANKO_INSTALL') == 'y' { + include '::packstack::keystone::panko' + include '::packstack::panko' +} + if hiera('CONFIG_CEILOMETER_INSTALL') == 'y' { include '::packstack::mongodb' include '::packstack::keystone::ceilometer' diff --git a/releasenotes/notes/Add-Panko-service-63a8a966013abeaa.yaml b/releasenotes/notes/Add-Panko-service-63a8a966013abeaa.yaml new file mode 100644 index 000000000..fe2fdf7a6 --- /dev/null +++ b/releasenotes/notes/Add-Panko-service-63a8a966013abeaa.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add panko service to packstack deployment. diff --git a/tests/scenario003.sh b/tests/scenario003.sh index 5cb5251b2..ca91a5d4a 100755 --- a/tests/scenario003.sh +++ b/tests/scenario003.sh @@ -11,6 +11,7 @@ echo -e "Generating packstack config for: - ceilometer - aodh - gnocchi +- panko - heat - magnum - tempest (regex: 'smoke TelemetryAlarming')" @@ -27,6 +28,8 @@ $SUDO packstack ${ADDITIONAL_ARGS} \ --glance-backend=file \ --os-heat-install=y \ --os-magnum-install=y \ + --os-panko-install=y \ + --ceilometer-events-backend=panko \ --provision-uec-kernel-url="/tmp/cirros/cirros-0.3.4-x86_64-vmlinuz" \ --provision-uec-ramdisk-url="/tmp/cirros/cirros-0.3.4-x86_64-initrd" \ --provision-uec-disk-url="/tmp/cirros/cirros-0.3.4-x86_64-disk.img" \ diff --git a/tools/copy-logs.sh b/tools/copy-logs.sh index 4e97417af..4efbe3bfb 100755 --- a/tools/copy-logs.sh +++ b/tools/copy-logs.sh @@ -91,6 +91,8 @@ function get_config_and_logs { '/var/log/ceilometer' '/etc/gnocchi' # gnocchi is nested under telemetry in governance '/var/log/gnocchi' + '/var/log/panko' + '/etc/panko' # panko is nested under telemetry in governance '/etc/rabbitmq/' '/var/log/rabbitmq' '/etc/my.cnf.d'