├── .gitignore ├── .gitreview ├── .pdkignore ├── .zuul.yaml ├── CHANGELOG.md ├── CONTRIBUTING.rst ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── bindep.txt ├── doc └── requirements.txt ├── examples ├── init.pp └── workflow.pp ├── lib └── puppet │ ├── provider │ ├── mistral.rb │ ├── mistral_config │ │ └── openstackconfig.rb │ ├── mistral_workflow │ │ └── openstack.rb │ └── mistral_workflow_requester.rb │ └── type │ ├── mistral_config.rb │ └── mistral_workflow.rb ├── manifests ├── action_providers.pp ├── api.pp ├── client.pp ├── config.pp ├── coordination.pp ├── cors.pp ├── cron_trigger.pp ├── db.pp ├── db │ ├── mysql.pp │ ├── postgresql.pp │ └── sync.pp ├── deps.pp ├── engine.pp ├── event_engine.pp ├── execution_expiration_policy.pp ├── executor.pp ├── healthcheck.pp ├── init.pp ├── keystone │ ├── auth.pp │ └── authtoken.pp ├── legacy_action_providers.pp ├── logging.pp ├── notifier.pp ├── params.pp ├── policy.pp └── wsgi │ └── apache.pp ├── metadata.json ├── releasenotes ├── notes │ ├── action-providers-cfg-group-a0da23b665358ebd.yaml │ ├── add-cron-trigger-67fb843e4950eb16.yaml │ ├── add-cron-trigger-interval-94df2eb3506cb7cb.yaml │ ├── add-log_file-for-logging-9aa0a919d7d36bc2.yaml │ ├── add-notfier-support-1e0645068547f64f.yaml │ ├── add-notification-transport-url-5a3e7f6d1630d14b.yaml │ ├── add-openstackclient-client-af0f5c3f707e1f49.yaml │ ├── add-pool_timeout-option-for-db-ad535206b8ecf55d.yaml │ ├── add-service_token_roles-option-8e3895d3bf4b6100.yaml │ ├── add-use_journal-option-for-logging-ba712fd13d62d609.yaml │ ├── add_db_sync_timeout-956bcd2a88592600.yaml │ ├── add_enable_proxy_header_parsing-8613ae19724ef119.yaml │ ├── add_event_engine-4294e0fe85331fc6.yaml │ ├── add_messaging_notification_parameters-a569813623df3529.yaml │ ├── add_mysql_enable_ndb-option-9a9788aa8e48c2bb.yaml │ ├── add_rabbit_kombu_options-8185738b6f0d8522.yaml │ ├── add_watch_log_file-option-8659aea1935f31dd.yaml │ ├── amqp_auto_delete-8552b7085fdbb335.yaml │ ├── apache-headers-4a1675bcdb266037.yaml │ ├── api-keystone-authtoken-5563be4c165b35fc.yaml │ ├── bug-1961601-1df5a15bead1daf3.yaml │ ├── centos-9-support-740222508780fcfa.yaml │ ├── cleanup-coordination-590887c92de88031.yaml │ ├── coordination-6da1ae2202029007.yaml │ ├── db_sync_class_default-40f42cf762187f17.yaml │ ├── deprecate-coordination-aa2bbdc971b9a850.yaml │ ├── deprecate-coordination-heartbeat_interval-37a35124e18bd918.yaml │ ├── deprecate-rabbit_heartbeat_in_pthread-644ca905479767d6.yaml │ ├── deprecate-watch_log_file-57d04617cbac6847.yaml │ ├── deprecate_auth_uri_parameter-8df63f76c70b0cba.yaml │ ├── deprecate_database_min_pool_size-option-848a4c6b7de5dea7.yaml │ ├── deprecate_database_options-141a6d8da8eb891b.yaml │ ├── deprecate_idle_timeout_parameter-b1568af63281c7ae.yaml │ ├── deprecate_pki_related_parameters-8b82bde77dc30fcd.yaml │ ├── deprecate_revocation_cache_time_parameter-3e3ec8dd06f29c08.yaml │ ├── deprecate_rpc_backend_parameter-5f612bed0889238b.yaml │ ├── deprecate_verbose_parameter-ad43da49125142de.yaml │ ├── disable-apache-ssl-dc981c60fe16d6d7.yaml │ ├── drop-fedora-02fd4ff7da62a9bc.yaml │ ├── drop_qpid-9384d349ee594f57.yaml │ ├── enable_cancel_on_failover-9917be4e60bc9d78.yaml │ ├── engine-opts-fef47b623ca867c1.yaml │ ├── execution_expiration_policy-cleanup-dc52ae9a060f8d87.yaml │ ├── execution_expiration_policy-d0e9ebbd2e3b8c76.yaml │ ├── external_dependency_management-8d3dea7e8ac36c51.yaml │ ├── first_release-d4c9a7d326ead137.yaml │ ├── fix_debian_common_package_name-3268b0e603bd292f.yaml │ ├── hc-enable_by_file_paths-be1bd2c96e55168f.yaml │ ├── healthcheck-7b8fc85f5e53b674.yaml │ ├── healthcheck-allowed_source_ranges-5fa7ca65f936a8ef.yaml │ ├── healthcheck-ignore_proxied_requests-a52d17b5c7ca1818.yaml │ ├── heartbeats-98aed300614308da.yaml │ ├── httpd-logs-piped-syslog-2b591ac833260287.yaml │ ├── include_db_sync-c5e9c2c5cef49eb1.yaml │ ├── keystone-auth-name-6717f5018361ef99.yaml │ ├── keystone-authtoken-interface-9d2b4a88e71c2807.yaml │ ├── keystone-authtoken-service_type-e5f633ea1fdc30d5.yaml │ ├── keystone_authtoken-4eefe6058143c876.yaml │ ├── log-json-50d88f4669a867be.yaml │ ├── max_request_body_size-86d0d951e94d181e.yaml │ ├── migrate-policy-format-from-json-to-yaml-8a43ac1cf4d5ea54.yaml │ ├── mistral_cors-744479c133f69360.yaml │ ├── openstack_db_tag-a79c0b390eeba4bb.yaml │ ├── os_workers_for_worker_count-6deab8168bc940c2.yaml │ ├── oslo_policy-enforce_scope-6b163a9f10f23d18.yaml │ ├── policy-dirs-2ed6895c4391e395.yaml │ ├── policy-enforce_new_defaults-2a64c8ab57788bdc.yaml │ ├── policy_default_rule-4d536844113b9239.yaml │ ├── policy_purge_config-8ba7d9eea990947d.yaml │ ├── prepare-to-change-apache-ssl-e83f6f9a4dcf6f8b.yaml │ ├── provider-deprecate-at-params-484966d315226d95.yaml │ ├── puppet-8-819db188ea16cbf3.yaml │ ├── puppet4-mysql-func-9b2078d1c2e1d0db.yaml │ ├── rabbit-connection-params-deprecation-8f2abf8d3cb0594d.yaml │ ├── rabbit_qos_prefetch_count-c8a97c06fc25d7e4.yaml │ ├── rabbit_transient_queues_ttl-c4243834920ec44d.yaml │ ├── rabbit_transient_quorum_queue-a460a413e55f9484.yaml │ ├── rabbitmq-heartbeat-over-pthread-802f3f789d9d99f4.yaml │ ├── release-note-ubuntu-py3-4545fea5c4a994d6.yaml │ ├── remove-auth-uri-d82acb9eefbbab2f.yaml │ ├── remove-centos-8-df961bc77456455e.yaml │ ├── remove-coordination-heartbeat_interval-719d61392b7e7db7.yaml │ ├── remove-database-params-8bf2195a6f15a3f5.yaml │ ├── remove-deprecated-9b4d20fce995e540.yaml │ ├── remove-deprecated-logging-1a61a633edfff7b0.yaml │ ├── remove-deprecated-rabbit-params-987b59530e476762.yaml │ ├── remove-puppet-6-b28be43d146e429c.yaml │ ├── remove-watch_log_file-1fb36de4dd0e2c32.yaml │ ├── remove_deprecated_keystone_revocation_cache_time_option-86c386c2484fd9d8.yaml │ ├── remove_deprecated_pki_related_options-bba5dfd118aae1ed.yaml │ ├── remove_idle_timeout_option-a6024ea16d4e01d2.yaml │ ├── remove_verbose-b6ae287286f00640.yaml │ ├── service_token_roles_required-84c00ff15c72c2e5.yaml │ ├── switch_to_oslo_messaging-70e92a6709162b1e.yaml │ ├── system_scope-keystone-9a41ff0d799142db.yaml │ ├── ubuntu-jammy-32947dc87597ce5e.yaml │ ├── ubuntu-noble-8754d488ab4b6acc.yaml │ ├── use-reno-1caaec4ba5aa4285.yaml │ └── wsgi_process_options-945733f0b0d9f355.yaml └── source │ ├── 2023.1.rst │ ├── 2023.2.rst │ ├── 2024.1.rst │ ├── 2024.2.rst │ ├── 2025.1.rst │ ├── _static │ └── .placeholder │ ├── conf.py │ ├── index.rst │ ├── mitaka.rst │ ├── newton.rst │ ├── ocata.rst │ ├── pike.rst │ ├── queens.rst │ ├── rocky.rst │ ├── stein.rst │ ├── train.rst │ ├── unreleased.rst │ ├── ussuri.rst │ ├── victoria.rst │ ├── wallaby.rst │ ├── xena.rst │ ├── yoga.rst │ └── zed.rst ├── setup.cfg ├── setup.py ├── spec ├── acceptance │ ├── 10_basic_mistral_spec.rb │ └── 99_mistral_config_spec.rb ├── classes │ ├── mistral_action_providers_spec.rb │ ├── mistral_api_spec.rb │ ├── mistral_client_spec.rb │ ├── mistral_config_spec.rb │ ├── mistral_coordination_spec.rb │ ├── mistral_cors_spec.rb │ ├── mistral_cron_trigger_spec.rb │ ├── mistral_db_mysql_spec.rb │ ├── mistral_db_postgresql_spec.rb │ ├── mistral_db_spec.rb │ ├── mistral_db_sync_spec.rb │ ├── mistral_deps_spec.rb │ ├── mistral_engine_spec.rb │ ├── mistral_event_engine_spec.rb │ ├── mistral_execution_expiration_policy_spec.rb │ ├── mistral_executor_spec.rb │ ├── mistral_healthcheck_spec.rb │ ├── mistral_init_spec.rb │ ├── mistral_keystone_auth_spec.rb │ ├── mistral_keystone_authtoken_spec.rb │ ├── mistral_legacy_action_providers_spec.rb │ ├── mistral_logging_spec.rb │ ├── mistral_notifier_spec.rb │ ├── mistral_policy_spec.rb │ └── mistral_wsgi_apache_spec.rb ├── shared_examples.rb ├── spec_helper.rb ├── spec_helper_acceptance.rb └── unit │ ├── provider │ └── mistral_config │ │ └── openstackconfig_spec.rb │ └── type │ └── mistral_config_spec.rb └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | # Add patterns in here to exclude files created by tools integrated with this 2 | # repository, such as test frameworks from the project's recommended workflow, 3 | # rendered documentation and package builds. 4 | # 5 | # Don't add patterns to exclude files created by preferred personal tools 6 | # (editors, IDEs, your operating system itself even). These should instead be 7 | # maintained outside the repository, for example in a ~/.gitignore file added 8 | # with: 9 | # 10 | # git config --global core.excludesfile '~/.gitignore' 11 | 12 | pkg/ 13 | Gemfile.lock 14 | vendor/ 15 | spec/fixtures/ 16 | .vagrant/ 17 | .bundle/ 18 | coverage/ 19 | .idea/ 20 | *.iml 21 | /openstack 22 | /log 23 | 24 | # Files created by releasenotes build 25 | releasenotes/build 26 | .tox 27 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=review.opendev.org 3 | port=29418 4 | project=openstack/puppet-mistral.git 5 | -------------------------------------------------------------------------------- /.pdkignore: -------------------------------------------------------------------------------- 1 | # common list used in puppetlabs repos 2 | .git/ 3 | .*.sw[op] 4 | .metadata 5 | .yardoc 6 | .yardwarns 7 | *.iml 8 | /.bundle/ 9 | /.idea/ 10 | /.vagrant/ 11 | /coverage/ 12 | /bin/ 13 | /doc/ 14 | /Gemfile.local 15 | /Gemfile.lock 16 | /junit/ 17 | /log/ 18 | /pkg/ 19 | /spec/fixtures/manifests/ 20 | /spec/fixtures/modules/* 21 | /tmp/ 22 | /vendor/ 23 | /convert_report.txt 24 | /update_report.txt 25 | .DS_Store 26 | .project 27 | .envrc 28 | /inventory.yaml 29 | /spec/fixtures/litmus_inventory.yaml 30 | /.fixtures.yml 31 | /Gemfile 32 | /.gitattributes 33 | /.gitignore 34 | /.pdkignore 35 | /.puppet-lint.rc 36 | /Rakefile 37 | /rakelib/ 38 | /.rspec 39 | /..yml 40 | /.yardopts 41 | /spec/ 42 | /.vscode/ 43 | /.sync.yml 44 | /.devcontainer/ 45 | # OpenStack-specific files 46 | /bindep.txt 47 | /.gitreview 48 | /releasenotes/ 49 | /setup.cfg 50 | /setup.py 51 | /tox.ini 52 | /.zuul.yaml 53 | -------------------------------------------------------------------------------- /.zuul.yaml: -------------------------------------------------------------------------------- 1 | - project: 2 | templates: 3 | - puppet-openstack-check-jobs 4 | - puppet-openstack-module-unit-jobs 5 | - puppet-openstack-integration-jobs-scenario003 6 | - puppet-openstack-litmus-jobs 7 | - release-notes-jobs-python3 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 8.0.0 and beyond 2 | 3 | From 8.0.0 release and beyond, release notes are published on 4 | [docs.openstack.org](http://docs.openstack.org/releasenotes/puppet-mistral/). 5 | 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | The source repository for this project can be found at: 2 | 3 | https://opendev.org/openstack/puppet-mistral 4 | 5 | Pull requests submitted through GitHub are not monitored. 6 | 7 | To start contributing to OpenStack, follow the steps in the contribution guide 8 | to set up and use Gerrit: 9 | 10 | https://docs.openstack.org/contributors/code-and-documentation/quick-start.html 11 | 12 | Bugs should be filed on Launchpad: 13 | 14 | https://bugs.launchpad.net/puppet-mistral 15 | 16 | For more specific information about contributing to this repository, see the 17 | Puppet OpenStack contributor guide: 18 | 19 | https://docs.openstack.org/puppet-openstack-guide/latest/contributor/contributing.html 20 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source ENV['GEM_SOURCE'] || "https://rubygems.org" 2 | 3 | group :development, :test, :system_tests do 4 | spec_helper_dir = '/home/zuul/src/opendev.org/openstack/puppet-openstack_spec_helper' 5 | if File.directory?(spec_helper_dir) 6 | if ENV['ZUUL_PROJECT'] == 'openstack/puppet-openstack_spec_helper' 7 | gem 'puppet-openstack_spec_helper', 8 | :path => '../..', 9 | :require => 'false' 10 | else 11 | gem 'puppet-openstack_spec_helper', 12 | :path => spec_helper_dir, 13 | :require => 'false' 14 | end 15 | else 16 | spec_helper_version = ENV['ZUUL_BRANCH'] || "master" 17 | gem 'puppet-openstack_spec_helper', 18 | :git => 'https://opendev.org/openstack/puppet-openstack_spec_helper', 19 | :ref => spec_helper_version, 20 | :require => 'false' 21 | end 22 | end 23 | 24 | if facterversion = ENV['FACTER_GEM_VERSION'] 25 | gem 'facter', facterversion, :require => false 26 | else 27 | gem 'facter', :require => false 28 | end 29 | 30 | if puppetversion = ENV['PUPPET_GEM_VERSION'] 31 | gem 'puppet', puppetversion, :require => false 32 | else 33 | gem 'puppet', :require => false 34 | end 35 | 36 | # vim:ft=ruby 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Team and repository tags 2 | ======================== 3 | 4 | [![Team and repository tags](https://governance.openstack.org/tc/badges/puppet-mistral.svg)](https://governance.openstack.org/tc/reference/tags/index.html) 5 | 6 | 7 | 8 | mistral 9 | ====== 10 | 11 | #### Table of Contents 12 | 13 | 1. [Overview - What is the mistral module?](#overview) 14 | 2. [Module Description - What does the module do?](#module-description) 15 | 3. [Setup - The basics of getting started with mistral](#setup) 16 | 4. [Implementation - An under-the-hood peek at what the module is doing](#implementation) 17 | 5. [Limitations - OS compatibility, etc.](#limitations) 18 | 6. [Development - Guide for contributing to the module](#development) 19 | 7. [Contributors - Those with commits](#contributors) 20 | 8. [Release Notes - Release notes for the project](#release-notes) 21 | 9. [Repository - The project source code repository](#repository) 22 | 23 | Overview 24 | -------- 25 | 26 | The Mistral module itself is a workflow service for OpenStack cloud. 27 | 28 | Module Description 29 | ------------------ 30 | 31 | The mistral module is an attempt to make Puppet capable of managing the 32 | entirety of mistral. 33 | 34 | Setup 35 | ----- 36 | 37 | **What the mistral module affects** 38 | 39 | * [Mistral](https://docs.openstack.org/mistral/latest/), the workflow service for OpenStack. 40 | 41 | ### Beginning with mistral 42 | 43 | To use the mistral module's functionality you will need to declare multiple 44 | resources. This is not an exhaustive list of all the components needed; we 45 | recommend you consult and understand the 46 | [core openstack](https://docs.openstack.org) documentation. 47 | 48 | 49 | Implementation 50 | -------------- 51 | 52 | ### Mistral 53 | 54 | puppet-mistral is a combination of Puppet manifests and ruby code to deliver 55 | configuration and extra functionality through types and providers. 56 | 57 | ### Types 58 | 59 | #### mistral_config 60 | 61 | The `mistral_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/mistral/mistral.conf` file. 62 | 63 | ```puppet 64 | mistral_config { 'DEFAULT/use_syslog' : 65 | value => false, 66 | } 67 | ``` 68 | 69 | This will write `use_syslog=false` in the `[DEFAULT]` section. 70 | 71 | ##### name 72 | 73 | Section/setting name to manage from `mistral.conf` 74 | 75 | ##### value 76 | 77 | The value of the setting to be defined. 78 | 79 | ##### secret 80 | 81 | Whether to hide the value from Puppet logs. Defaults to `false`. 82 | 83 | ##### ensure_absent_val 84 | 85 | If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `` 86 | 87 | ### mistral_workflow 88 | 89 | The `mistral_workflow` provider allows the creation/update/deletion of workflow definitions using a source file (in YAML). 90 | 91 | ```puppet 92 | mistral_workflow { 'my_workflow': 93 | ensure => present, 94 | definition_file => '/home/user/my_workflow.yaml', 95 | is_public => true, 96 | } 97 | ``` 98 | 99 | Or: 100 | 101 | ```puppet 102 | mistral_workflow { 'my_workflow': 103 | ensure => absent, 104 | } 105 | ``` 106 | 107 | If you need to force the update of the workflow or change it's public attribute, use `latest`: 108 | ```puppet 109 | mistral_workflow { 'my_workflow': 110 | ensure => latest, 111 | definition_file => '/home/user/my_workflow.yaml', 112 | is_public => false, 113 | } 114 | ``` 115 | 116 | Although the mistral client allows multiple workflow definitions per source file, it not recommended to do so with this provider as the `mistral_workflow` is supposed to represent a single workflow. 117 | 118 | #### name 119 | 120 | The name of the workflow; this is only used when deleting the workflow since the definition file specifies the name of the workflow to create/update. 121 | 122 | #### definition_file 123 | 124 | The path to the file containing the definition of the workflow. This parameter is not mandatory but the creation or update will fail if it is not supplied. 125 | 126 | #### is_public 127 | 128 | Specifies whether the workflow must be public or not. Defaults to `true`. 129 | 130 | Limitations 131 | ------------ 132 | 133 | * All the mistral types use the CLI tools and so need to be ran on the mistral node. 134 | 135 | Development 136 | ----------- 137 | 138 | Developer documentation for the entire puppet-openstack project. 139 | 140 | * https://docs.openstack.org/puppet-openstack-guide/latest/ 141 | 142 | Contributors 143 | ------------ 144 | 145 | * https://github.com/openstack/puppet-mistral/graphs/contributors 146 | 147 | Release Notes 148 | ------------- 149 | 150 | * https://docs.openstack.org/releasenotes/puppet-mistral 151 | 152 | Repository 153 | ---------- 154 | 155 | * https://opendev.org/openstack/puppet-mistral 156 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'puppet-openstack_spec_helper/rake_tasks' 2 | -------------------------------------------------------------------------------- /bindep.txt: -------------------------------------------------------------------------------- 1 | # This is a cross-platform list tracking distribution packages needed by tests; 2 | # see https://docs.openstack.org/infra/bindep/ for additional information. 3 | 4 | libxml2-devel [test platform:rpm] 5 | libxml2-dev [test platform:dpkg] 6 | libxslt-devel [test platform:rpm] 7 | libxslt1-dev [test platform:dpkg] 8 | ruby-devel [test platform:rpm] 9 | ruby-dev [test platform:dpkg] 10 | zlib1g-dev [test platform:dpkg] 11 | zlib-devel [test platform:rpm] 12 | puppet [build] 13 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | # This is required for the docs build jobs 2 | sphinx>=3.5.1 # BSD 3 | openstackdocstheme>=2.2.7 # Apache-2.0 4 | 5 | # This is required for the releasenotes build jobs 6 | reno>=3.2.0 # Apache-2.0 7 | -------------------------------------------------------------------------------- /examples/init.pp: -------------------------------------------------------------------------------- 1 | # The baseline for module testing used by Puppet Inc. is that each manifest 2 | # should have a corresponding test manifest that declares that class or defined 3 | # type. 4 | # 5 | # Tests are then run by using puppet apply --noop (to check for compilation 6 | # errors and view a log of events) or by fully applying the test in a virtual 7 | # environment (to compare the resulting system state to the desired state). 8 | # 9 | # Learn more about module testing here: 10 | # https://puppet.com/docs/puppet/latest/bgtm.html#testing-your-module 11 | # 12 | include mistral 13 | -------------------------------------------------------------------------------- /examples/workflow.pp: -------------------------------------------------------------------------------- 1 | class { 'mistral:workflow': } 2 | -------------------------------------------------------------------------------- /lib/puppet/provider/mistral.rb: -------------------------------------------------------------------------------- 1 | require 'puppet/provider/openstack/auth' 2 | require 'puppet/provider/openstack/credentials' 3 | require File.join(File.dirname(__FILE__), '..','..', 'puppet/provider/mistral_workflow_requester') 4 | 5 | class Puppet::Provider::Mistral < Puppet::Provider::MistralWorkflowRequester 6 | 7 | extend Puppet::Provider::Openstack::Auth 8 | 9 | end 10 | -------------------------------------------------------------------------------- /lib/puppet/provider/mistral_config/openstackconfig.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.type(:mistral_config).provide( 2 | :openstackconfig, 3 | :parent => Puppet::Type.type(:openstack_config).provider(:ruby) 4 | ) do 5 | 6 | def self.file_path 7 | '/etc/mistral/mistral.conf' 8 | end 9 | 10 | end 11 | -------------------------------------------------------------------------------- /lib/puppet/provider/mistral_workflow/openstack.rb: -------------------------------------------------------------------------------- 1 | require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/mistral') 2 | 3 | Puppet::Type.type(:mistral_workflow).provide( 4 | :openstack, 5 | :parent => Puppet::Provider::Mistral 6 | ) do 7 | desc <<-EOT 8 | Mistral provider to manage workflow type 9 | EOT 10 | 11 | @credentials = Puppet::Provider::Openstack::CredentialsV3.new 12 | 13 | mk_resource_methods 14 | 15 | def create 16 | properties = [] 17 | properties << (@resource[:is_public] == :true ? '--public' : '--private') 18 | properties << @resource[:definition_file] 19 | 20 | self.class.request('workflow', 'create', properties) 21 | @property_hash[:ensure] = :present 22 | @property_hash[:definition_file] = resource[:definition_file] 23 | @property_hash[:is_public] = resource[:is_public] 24 | @property_hash[:name] = name 25 | end 26 | 27 | def exists? 28 | @property_hash[:ensure] == :present 29 | end 30 | 31 | def destroy 32 | self.class.request('workflow', 'delete', @resource[:name]) 33 | @property_hash.clear 34 | end 35 | 36 | def update 37 | # Update the workflow if it exists, otherwise create it 38 | if exists? 39 | properties = [] 40 | if @resource[:is_public] == :true 41 | properties << '--public' 42 | end 43 | properties << @resource[:definition_file] 44 | 45 | self.class.request('workflow', 'update', properties) 46 | @property_hash[:ensure] = :present 47 | @property_hash[:definition_file] = resource[:definition_file] 48 | @property_hash[:is_public] = resource[:is_public] 49 | @property_hash[:name] = name 50 | else 51 | create 52 | end 53 | end 54 | 55 | def self.instances 56 | list = request('workflow', 'list') 57 | list.collect do |wf| 58 | attrs = request('workflow', 'show', wf[:id]) 59 | new({ 60 | :ensure => :present, 61 | :id => wf[:id], 62 | :name => wf[:name], 63 | :is_public => (attrs[:scope] == "public") 64 | }) 65 | end 66 | end 67 | 68 | def self.prefetch(resources) 69 | workflows = instances 70 | resources.keys.each do |name| 71 | if provider = workflows.find{ |wf| wf.name == name } 72 | resources[name].provider = provider 73 | end 74 | end 75 | end 76 | 77 | def flush 78 | if @property_flush 79 | opts = [@resource[:name]] 80 | 81 | (opts << '--public') if @property_flush[:is_public] == :true 82 | (opts << '--private') if @property_flush[:is_public] == :false 83 | opts << @property_flush[:definition_file] 84 | 85 | self.class.request('workflow', 'update', opts) 86 | @property_flush.clear 87 | end 88 | end 89 | 90 | end 91 | -------------------------------------------------------------------------------- /lib/puppet/provider/mistral_workflow_requester.rb: -------------------------------------------------------------------------------- 1 | require 'csv' 2 | require 'puppet' 3 | require 'timeout' 4 | 5 | class Puppet::Provider::MistralWorkflowRequester < Puppet::Provider::Openstack 6 | # This class only overrides the request method of the Openstack provider 7 | # because Mistral behaves differently when creating workflows. 8 | # The mistral client allows the creation of multiple workflows with a single 9 | # definition file so the creation call returns a list of workflows instead of 10 | # a single value. 11 | # Consequently the shell output format is not available and the csv formatter 12 | # must be used instead. 13 | 14 | # Returns an array of hashes, where the keys are the downcased CSV headers 15 | # with underscores instead of spaces 16 | # 17 | # @param options [Hash] Other options 18 | # @options :no_retry_exception_msgs [Array,Regexp] exception without retries 19 | def self.request(service, action, properties, credentials=nil, options={}) 20 | env = credentials ? credentials.to_env : {} 21 | 22 | # We only need to override the create action 23 | if action != 'create' 24 | return super 25 | end 26 | 27 | Puppet::Util.withenv(env) do 28 | rv = nil 29 | begin 30 | # shell output is: 31 | # ID,Name,Description,Enabled 32 | response = openstack(service, action, '--quiet', '--format', 'csv', properties) 33 | response = parse_csv(response) 34 | keys = response.delete_at(0) 35 | 36 | if response.collect.length > 1 37 | definition_file = properties[-1] 38 | Puppet.warning("#{definition_file} creates more than one workflow, only the first one will be returned after the request.") 39 | end 40 | rv = response.collect do |line| 41 | hash = {} 42 | keys.each_index do |index| 43 | key = keys[index].downcase.gsub(/ /, '_').to_sym 44 | hash[key] = line[index] 45 | end 46 | hash 47 | end 48 | rescue Puppet::ExecutionFailure => exception 49 | raise Puppet::Error::OpenstackUnauthorizedError, 'Could not authenticate' if exception.message =~ /HTTP 40[13]/ 50 | raise 51 | end 52 | end 53 | return rv 54 | end 55 | 56 | private 57 | 58 | def self.parse_csv(text) 59 | # Ignore warnings - assume legitimate output starts with a double quoted 60 | # string. Errors will be caught and raised prior to this 61 | text = text.split("\n").drop_while { |line| line !~ /^\".*\"/ }.join("\n") 62 | return CSV.parse(text + "\n") 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /lib/puppet/type/mistral_config.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.newtype(:mistral_config) do 2 | 3 | ensurable 4 | 5 | newparam(:name, :namevar => true) do 6 | desc 'Section/setting name to manage from /etc/mistral/mistral.conf' 7 | newvalues(/\S+\/\S+/) 8 | end 9 | 10 | newproperty(:value, :array_matching => :all) do 11 | desc 'The value of the setting to be defined.' 12 | def insync?(is) 13 | return true if @should.empty? 14 | return false unless is.is_a? Array 15 | return false unless is.length == @should.length 16 | return ( 17 | is & @should == is or 18 | is & @should.map(&:to_s) == is 19 | ) 20 | end 21 | munge do |value| 22 | value = value.to_s.strip 23 | value.capitalize! if value =~ /^(true|false)$/i 24 | value 25 | end 26 | 27 | def is_to_s( currentvalue ) 28 | if resource.secret? 29 | return '[old secret redacted]' 30 | else 31 | return currentvalue 32 | end 33 | end 34 | 35 | def should_to_s( newvalue ) 36 | if resource.secret? 37 | return '[new secret redacted]' 38 | else 39 | return newvalue 40 | end 41 | end 42 | end 43 | 44 | newparam(:secret, :boolean => true) do 45 | desc 'Whether to hide the value from Puppet logs. Defaults to `false`.' 46 | 47 | newvalues(:true, :false) 48 | 49 | defaultto false 50 | end 51 | 52 | newparam(:ensure_absent_val) do 53 | desc 'A value that is specified as the value property will behave as if ensure => absent was specified' 54 | defaultto('') 55 | end 56 | 57 | autorequire(:anchor) do 58 | ['mistral::install::end'] 59 | end 60 | 61 | end 62 | -------------------------------------------------------------------------------- /lib/puppet/type/mistral_workflow.rb: -------------------------------------------------------------------------------- 1 | Puppet::Type.newtype(:mistral_workflow) do 2 | desc <<-EOT 3 | This allows manifests to declare a workflow to be created or removed 4 | in Mistral. 5 | 6 | mistral_workflow { "my_workflow": 7 | ensure => present, 8 | definition_file => "/home/workflows/my_workflow.yaml", 9 | is_public => yes, 10 | } 11 | 12 | Known problems / limitations: 13 | * When creating a worflow, the name supplied is not used because mistral 14 | will name the workflow according to its definition. 15 | * You MUST provide the definition_file if you want to change any property 16 | because that will cause the provider to run the 'workflow update' 17 | command. 18 | * DO NOT put multiple workflows in the definition_file. Although the 19 | mistral client allows it, the provider does not support it. 20 | * Ensure this is run on the same server as the mistral-api service. 21 | 22 | EOT 23 | 24 | ensurable do 25 | newvalue(:present) do 26 | provider.create 27 | end 28 | 29 | newvalue(:absent) do 30 | provider.destroy 31 | end 32 | 33 | newvalue(:latest) do 34 | provider.update 35 | end 36 | end 37 | 38 | newparam(:name, :namevar => true) do 39 | desc 'The name of the workflow' 40 | newvalues(/.*/) 41 | end 42 | 43 | newproperty(:id) do 44 | desc 'The unique id of the workflow' 45 | newvalues(/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/) 46 | end 47 | 48 | newparam(:definition_file) do 49 | desc "The location of the file defining the workflow" 50 | newvalues(/.*/) 51 | end 52 | 53 | newparam(:is_public, :boolean => true) do 54 | desc 'Whether the workflow is public or not. Default to `true`' 55 | newvalues(:true, :false) 56 | defaultto true 57 | end 58 | 59 | # Require the Mistral API service to be running 60 | autorequire(:anchor) do 61 | ['mistral::service::end'] 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /manifests/action_providers.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::action_providers 2 | # 3 | # Configure the action_providers config section. 4 | # 5 | # === Parameters 6 | # 7 | # [*allowlist*] 8 | # (Optional) Allowlist with actions that is allowed to be 9 | # loaded, if empty all actions will be allowed. 10 | # Defaults to $facts['os_service_default'] 11 | 12 | # [*denylist*] 13 | # (Optional) Denylist with actions that is not allowed to 14 | # be loaded, allowlist takes precedence, if empty all actions 15 | # will be allowed. 16 | # Defaults to $facts['os_service_default'] 17 | # 18 | class mistral::action_providers ( 19 | $allowlist = $facts['os_service_default'], 20 | $denylist = $facts['os_service_default'], 21 | ) { 22 | 23 | mistral_config { 24 | 'action_providers/allowlist': value => join(any2array($allowlist), ','); 25 | 'action_providers/denylist': value => join(any2array($denylist), ','); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /manifests/api.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::api 2 | # 3 | # Installs & configure the Mistral API service 4 | # 5 | # === Parameters 6 | # 7 | # [*allow_action_execution_deletion*] 8 | # (Optional) Enables the ability to delete action_execution 9 | # which has no relationship with workflows. (boolean value). 10 | # Defaults to $facts['os_service_default']. 11 | # 12 | # [*api_workers*] 13 | # (Optional) Number of workers for Mistral API service 14 | # default is equal to the number of CPUs available if that can 15 | # be determined, else a default worker count of 1 is returned. 16 | # Defaults to $facts['os_workers'] 17 | # 18 | # [*bind_host*] 19 | # (Optional) Address to bind the server. Useful when 20 | # selecting a particular network interface. 21 | # Defaults to $facts['os_service_default']. 22 | # 23 | # [*bind_port*] 24 | # (Optional) The port on which the server will listen. 25 | # Defaults to $facts['os_service_default']. 26 | # 27 | # [*enabled*] 28 | # (optional) Should the service be enabled. 29 | # Defaults to 'true'. 30 | # 31 | # [*manage_service*] 32 | # (optional) Whether the service should be managed by Puppet. 33 | # Defaults to 'true'. 34 | # 35 | # [*package_ensure*] 36 | # (Optional) Ensure state for package. 37 | # Defaults to present 38 | # 39 | # [*service_name*] 40 | # (optional) Name of the service that will be providing the 41 | # server functionality of mistral-api. 42 | # If the value is 'httpd', this means mistral-api will be a web 43 | # service, and you must use another class to configure that 44 | # web service. For example, use class { 'mistral::wsgi::apache'...} 45 | # to make mistral-api be a web app using apache mod_wsgi. 46 | # Defaults to '$::mistral::params::api_service_name' 47 | # 48 | # [*enable_proxy_headers_parsing*] 49 | # (Optional) Enable paste middleware to handle SSL requests through 50 | # HTTPProxyToWSGI middleware. 51 | # Defaults to $facts['os_service_default']. 52 | # 53 | # [*max_request_body_size*] 54 | # (Optional) Set max request body size 55 | # Defaults to $facts['os_service_default']. 56 | # 57 | # [*auth_strategy*] 58 | # (optional) Type of authentication to be used. 59 | # Defaults to 'keystone' 60 | # 61 | class mistral::api ( 62 | $allow_action_execution_deletion = $facts['os_service_default'], 63 | $api_workers = $facts['os_workers'], 64 | $bind_host = $facts['os_service_default'], 65 | $bind_port = $facts['os_service_default'], 66 | Boolean $enabled = true, 67 | Boolean $manage_service = true, 68 | $package_ensure = present, 69 | $service_name = $::mistral::params::api_service_name, 70 | $enable_proxy_headers_parsing = $facts['os_service_default'], 71 | $max_request_body_size = $facts['os_service_default'], 72 | $auth_strategy = 'keystone', 73 | ) inherits mistral::params { 74 | 75 | include mistral::deps 76 | include mistral::params 77 | include mistral::policy 78 | 79 | if $auth_strategy == 'keystone' { 80 | include mistral::keystone::authtoken 81 | } 82 | 83 | package { 'mistral-api': 84 | ensure => $package_ensure, 85 | name => $::mistral::params::api_package_name, 86 | tag => ['openstack', 'mistral-package'], 87 | } 88 | 89 | if $manage_service { 90 | if $enabled { 91 | $service_ensure = 'running' 92 | } else { 93 | $service_ensure = 'stopped' 94 | } 95 | 96 | if $service_name == $::mistral::params::api_service_name { 97 | service { 'mistral-api': 98 | ensure => $service_ensure, 99 | name => $::mistral::params::api_service_name, 100 | enable => $enabled, 101 | hasstatus => true, 102 | hasrestart => true, 103 | tag => 'mistral-service', 104 | } 105 | } elsif $service_name == 'httpd' { 106 | service { 'mistral-api': 107 | ensure => 'stopped', 108 | name => $::mistral::params::api_service_name, 109 | enable => false, 110 | tag => 'mistral-service', 111 | } 112 | Service <| title == 'httpd' |> { tag +> 'mistral-service' } 113 | 114 | # we need to make sure mistral-api s stopped before trying to start apache 115 | Service['mistral-api'] -> Service[$service_name] 116 | } else { 117 | fail("Invalid service_name. Either mistral/openstack-mistral-api for running \ 118 | as a standalone service, or httpd for being run by a httpd server") 119 | } 120 | } 121 | 122 | mistral_config { 123 | 'api/api_workers' : value => $api_workers; 124 | 'api/host' : value => $bind_host; 125 | 'api/port' : value => $bind_port; 126 | 'api/allow_action_execution_deletion' : value => $allow_action_execution_deletion; 127 | } 128 | 129 | oslo::middleware { 'mistral_config': 130 | enable_proxy_headers_parsing => $enable_proxy_headers_parsing, 131 | max_request_body_size => $max_request_body_size, 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /manifests/client.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::client 2 | # 3 | # Installs mistral python client. 4 | # 5 | # === Parameters 6 | # 7 | # [*package_ensure*] 8 | # Ensure state for package. Defaults to 'present'. 9 | # 10 | class mistral::client( 11 | $package_ensure = 'present' 12 | ) { 13 | 14 | include mistral::deps 15 | include mistral::params 16 | 17 | package { 'python-mistralclient': 18 | ensure => $package_ensure, 19 | name => $::mistral::params::client_package, 20 | tag => ['openstack', 'openstackclient'], 21 | } 22 | 23 | include openstacklib::openstackclient 24 | } 25 | -------------------------------------------------------------------------------- /manifests/config.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::config 2 | # 3 | # This class is used to manage arbitrary mistral configurations. 4 | # 5 | # === Parameters 6 | # 7 | # [*mistral_config*] 8 | # (optional) Allow configuration of arbitrary mistral configurations. 9 | # The value is an hash of mistral_config resources. Example: 10 | # { 'DEFAULT/foo' => { value => 'fooValue'}, 11 | # 'DEFAULT/bar' => { value => 'barValue'} 12 | # } 13 | # In yaml format, Example: 14 | # mistral_config: 15 | # DEFAULT/foo: 16 | # value: fooValue 17 | # DEFAULT/bar: 18 | # value: barValue 19 | # 20 | # NOTE: The configuration MUST NOT be already handled by this module 21 | # or Puppet catalog compilation will fail with duplicate resources. 22 | # 23 | class mistral::config ( 24 | Hash $mistral_config = {}, 25 | ) { 26 | 27 | include mistral::deps 28 | 29 | create_resources('mistral_config', $mistral_config) 30 | } 31 | -------------------------------------------------------------------------------- /manifests/coordination.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::coordination 2 | # DEPRECATED !! 3 | # Setup and configure Mistral coordination settings. 4 | # 5 | # === Parameters 6 | # 7 | # [*backend_url*] 8 | # (Optional) Coordination backend URL. 9 | # Defaults to $facts['os_service_default'] 10 | # 11 | class mistral::coordination ( 12 | $backend_url = $facts['os_service_default'], 13 | ) { 14 | 15 | include mistral::deps 16 | 17 | warning('Support for coordination has been deprecated.') 18 | 19 | oslo::coordination{ 'mistral_config': 20 | backend_url => $backend_url 21 | } 22 | 23 | # all coordination settings should be applied and all packages should be 24 | # installed before service startup 25 | Oslo::Coordination['mistral_config'] -> Anchor['mistral::service::begin'] 26 | } 27 | -------------------------------------------------------------------------------- /manifests/cors.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::cors 2 | # 3 | # Configure the mistral cors 4 | # 5 | # === Parameters 6 | # 7 | # [*allowed_origin*] 8 | # (Optional) Indicate whether this resource may be shared with the domain 9 | # received in the requests "origin" header. 10 | # (string value) 11 | # Defaults to $facts['os_service_default']. 12 | # 13 | # [*allow_credentials*] 14 | # (Optional) Indicate that the actual request can include user credentials. 15 | # (boolean value) 16 | # Defaults to $facts['os_service_default']. 17 | # 18 | # [*expose_headers*] 19 | # (Optional) Indicate which headers are safe to expose to the API. 20 | # (list value) 21 | # Defaults to $facts['os_service_default']. 22 | # 23 | # [*max_age*] 24 | # (Optional) Maximum cache age of CORS preflight requests. 25 | # (integer value) 26 | # Defaults to $facts['os_service_default']. 27 | # 28 | # [*allow_methods*] 29 | # (Optional) Indicate which methods can be used during the actual request. 30 | # (list value) 31 | # Defaults to $facts['os_service_default']. 32 | # 33 | # [*allow_headers*] 34 | # (Optional) Indicate which header field names may be used during the actual 35 | # request. 36 | # (list value) 37 | # Defaults to $facts['os_service_default']. 38 | # 39 | class mistral::cors ( 40 | $allowed_origin = $facts['os_service_default'], 41 | $allow_credentials = $facts['os_service_default'], 42 | $expose_headers = $facts['os_service_default'], 43 | $max_age = $facts['os_service_default'], 44 | $allow_methods = $facts['os_service_default'], 45 | $allow_headers = $facts['os_service_default'], 46 | ) { 47 | 48 | include mistral::deps 49 | 50 | oslo::cors { 'mistral_config': 51 | allowed_origin => $allowed_origin, 52 | allow_credentials => $allow_credentials, 53 | expose_headers => $expose_headers, 54 | max_age => $max_age, 55 | allow_methods => $allow_methods, 56 | allow_headers => $allow_headers, 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /manifests/cron_trigger.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::cron_trigger 2 | # 3 | # Configure the mistral cron_trigger 4 | # 5 | # === Parameters 6 | # 7 | # [*enabled*] 8 | # (Optional) If this value is set to False then the subsystem of 9 | # cron triggers is disabled. 10 | # Disabling cron triggers increases system performance. 11 | # (boolean value) 12 | # Defaults to $facts['os_service_default']. 13 | # 14 | # [*execution_interval*] 15 | # (Optional) This setting defines how frequently Mistral checks for cron 16 | # triggers that need execution. By default this is every second 17 | # which can lead to high system load. Increasing the number will 18 | # reduce the load but also limit the minimum frequency. For 19 | # example, a cron trigger can be configured to run every second 20 | # but if the execution_interval is set to 60, it will only run 21 | # once per minute. 22 | # (integer value) 23 | # Defaults to $facts['os_service_default']. 24 | # 25 | # 26 | class mistral::cron_trigger ( 27 | $enabled = $facts['os_service_default'], 28 | $execution_interval = $facts['os_service_default'], 29 | ) { 30 | 31 | include mistral::deps 32 | include mistral::params 33 | 34 | mistral_config { 35 | 'cron_trigger/enabled': value => $enabled; 36 | 'cron_trigger/execution_interval': value => $execution_interval; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /manifests/db.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::db 2 | # 3 | # Configure the Mistral database 4 | # 5 | # === Parameters 6 | # 7 | # [*database_connection*] 8 | # Url used to connect to database. 9 | # (Optional) Defaults to 'sqlite:////var/lib/mistral/mistral.sqlite' 10 | # 11 | # [*database_connection_recycle_time*] 12 | # Timeout when db connections should be reaped. 13 | # (Optional) Defaults to $facts['os_service_default'] 14 | # 15 | # [*database_max_pool_size*] 16 | # Maximum number of SQL connections to keep open in a pool. 17 | # (Optional) Defaults to $facts['os_service_default'] 18 | # 19 | # [*database_max_retries*] 20 | # Maximum db connection retries during startup. 21 | # Setting -1 implies an infinite retry count. 22 | # (Optional) Defaults to $facts['os_service_default'] 23 | # 24 | # [*database_retry_interval*] 25 | # Interval between retries of opening a sql connection. 26 | # (Optional) Defaults to $facts['os_service_default'] 27 | # 28 | # [*database_max_overflow*] 29 | # If set, use this value for max_overflow with sqlalchemy. 30 | # (Optional) Defaults to $facts['os_service_default'] 31 | # 32 | # [*database_pool_timeout*] 33 | # (Optional) If set, use this value for pool_timeout with SQLAlchemy. 34 | # Defaults to $facts['os_service_default'] 35 | # 36 | # [*mysql_enable_ndb*] 37 | # (Optional) If True, transparently enables support for handling MySQL 38 | # Cluster (NDB). 39 | # Defaults to $facts['os_service_default'] 40 | # 41 | # [*database_db_max_retries*] 42 | # (Optional) Maximum retries in case of connection error or deadlock error 43 | # before error is raised. Set to -1 to specify an infinite retry count. 44 | # Defaults to $facts['os_service_default'] 45 | # 46 | class mistral::db ( 47 | $database_connection = 'sqlite:////var/lib/mistral/mistral.sqlite', 48 | $database_connection_recycle_time = $facts['os_service_default'], 49 | $database_max_pool_size = $facts['os_service_default'], 50 | $database_max_retries = $facts['os_service_default'], 51 | $database_retry_interval = $facts['os_service_default'], 52 | $database_max_overflow = $facts['os_service_default'], 53 | $database_pool_timeout = $facts['os_service_default'], 54 | $mysql_enable_ndb = $facts['os_service_default'], 55 | $database_db_max_retries = $facts['os_service_default'], 56 | ) { 57 | 58 | include mistral::deps 59 | 60 | oslo::db { 'mistral_config': 61 | connection => $database_connection, 62 | connection_recycle_time => $database_connection_recycle_time, 63 | max_pool_size => $database_max_pool_size, 64 | max_retries => $database_max_retries, 65 | retry_interval => $database_retry_interval, 66 | max_overflow => $database_max_overflow, 67 | pool_timeout => $database_pool_timeout, 68 | mysql_enable_ndb => $mysql_enable_ndb, 69 | db_max_retries => $database_db_max_retries, 70 | } 71 | 72 | # all db settings should be applied and all packages should be installed 73 | # before dbsync starts 74 | Oslo::Db['mistral_config'] -> Anchor['mistral::dbsync::begin'] 75 | } 76 | -------------------------------------------------------------------------------- /manifests/db/mysql.pp: -------------------------------------------------------------------------------- 1 | # The mistral::db::mysql class implements mysql backend for mistral 2 | # 3 | # This class can be used to create tables, users and grant 4 | # privilege for a mysql mistral database. 5 | # 6 | # == Parameters 7 | # 8 | # [*password*] 9 | # (Required) Password to connect to the database. 10 | # 11 | # [*dbname*] 12 | # (Optional) Name of the database. 13 | # Defaults to 'mistral'. 14 | # 15 | # [*user*] 16 | # (Optional) User to connect to the database. 17 | # Defaults to 'mistral'. 18 | # 19 | # [*host*] 20 | # (Optional) The default source host user is allowed to connect from. 21 | # Defaults to '127.0.0.1' 22 | # 23 | # [*allowed_hosts*] 24 | # (Optional) Other hosts the user is allowed to connect from. 25 | # Defaults to 'undef'. 26 | # 27 | # [*charset*] 28 | # (Optional) The database charset. 29 | # Defaults to 'utf8' 30 | # 31 | # [*collate*] 32 | # (Optional) The database collate. 33 | # Only used with mysql modules >= 2.2. 34 | # Defaults to 'utf8_general_ci' 35 | # 36 | class mistral::db::mysql( 37 | String[1] $password, 38 | $dbname = 'mistral', 39 | $user = 'mistral', 40 | $host = '127.0.0.1', 41 | $charset = 'utf8', 42 | $collate = 'utf8_general_ci', 43 | $allowed_hosts = undef 44 | ) { 45 | 46 | include mistral::deps 47 | 48 | openstacklib::db::mysql { 'mistral': 49 | user => $user, 50 | password => $password, 51 | dbname => $dbname, 52 | host => $host, 53 | charset => $charset, 54 | collate => $collate, 55 | allowed_hosts => $allowed_hosts, 56 | } 57 | 58 | Anchor['mistral::db::begin'] 59 | ~> Class['mistral::db::mysql'] 60 | ~> Anchor['mistral::db::end'] 61 | } 62 | -------------------------------------------------------------------------------- /manifests/db/postgresql.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::db::postgresql 2 | # 3 | # Class that configures postgresql for mistral 4 | # Requires the Puppetlabs postgresql module. 5 | # 6 | # === Parameters 7 | # 8 | # [*password*] 9 | # (Required) Password to connect to the database. 10 | # 11 | # [*dbname*] 12 | # (Optional) Name of the database. 13 | # Defaults to 'mistral'. 14 | # 15 | # [*user*] 16 | # (Optional) User to connect to the database. 17 | # Defaults to 'mistral'. 18 | # 19 | # [*encoding*] 20 | # (Optional) The charset to use for the database. 21 | # Default to undef. 22 | # 23 | # [*privileges*] 24 | # (Optional) Privileges given to the database user. 25 | # Default to 'ALL' 26 | # 27 | class mistral::db::postgresql( 28 | $password, 29 | $dbname = 'mistral', 30 | $user = 'mistral', 31 | $encoding = undef, 32 | $privileges = 'ALL', 33 | ) { 34 | 35 | include mistral::deps 36 | 37 | openstacklib::db::postgresql { 'mistral': 38 | password => $password, 39 | dbname => $dbname, 40 | user => $user, 41 | encoding => $encoding, 42 | privileges => $privileges, 43 | } 44 | 45 | Anchor['mistral::db::begin'] 46 | ~> Class['mistral::db::postgresql'] 47 | ~> Anchor['mistral::db::end'] 48 | } 49 | -------------------------------------------------------------------------------- /manifests/db/sync.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Class to execute "mistral-db-manage 'upgrade head' and 'populate'" 3 | # 4 | # ==Parameters 5 | # 6 | # [*db_sync_timeout*] 7 | # (Optional) Timeout for the execution of the db_sync 8 | # Defaults to 300 9 | # 10 | class mistral::db::sync( 11 | $db_sync_timeout = 300, 12 | ) { 13 | 14 | include mistral::deps 15 | include mistral::params 16 | 17 | exec { 'mistral-db-sync': 18 | command => $::mistral::params::db_sync_command, 19 | path => '/usr/bin', 20 | user => $::mistral::params::user, 21 | logoutput => on_failure, 22 | refreshonly => true, 23 | try_sleep => 5, 24 | tries => 10, 25 | timeout => $db_sync_timeout, 26 | subscribe => [ 27 | Anchor['mistral::install::end'], 28 | Anchor['mistral::config::end'], 29 | Anchor['mistral::dbsync::begin'] 30 | ], 31 | notify => Anchor['mistral::dbsync::end'], 32 | tag => 'openstack-db', 33 | } 34 | 35 | exec { 'mistral-db-populate': 36 | require => Exec['mistral-db-sync'], 37 | command => $::mistral::params::db_populate_command, 38 | path => '/usr/bin', 39 | user => $::mistral::params::user, 40 | timeout => $db_sync_timeout, 41 | logoutput => on_failure, 42 | refreshonly => true, 43 | subscribe => [ 44 | Anchor['mistral::install::end'], 45 | Anchor['mistral::config::end'], 46 | Anchor['mistral::dbsync::begin'] 47 | ], 48 | notify => Anchor['mistral::dbsync::end'], 49 | tag => 'openstack-db', 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /manifests/deps.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::deps 2 | # 3 | # mistral anchors and dependency management 4 | # 5 | class mistral::deps { 6 | # Setup anchors for install, config and service phases of the module. These 7 | # anchors allow external modules to hook the begin and end of any of these 8 | # phases. Package or service management can also be replaced by ensuring the 9 | # package is absent or turning off service management and having the 10 | # replacement depend on the appropriate anchors. When applicable, end tags 11 | # should be notified so that subscribers can determine if installation, 12 | # config or service state changed and act on that if needed. 13 | anchor { 'mistral::install::begin': } 14 | -> Package<| tag == 'mistral-package'|> 15 | ~> anchor { 'mistral::install::end': } 16 | -> anchor { 'mistral::config::begin': } 17 | -> Mistral_config<||> 18 | ~> anchor { 'mistral::config::end': } 19 | -> anchor { 'mistral::db::begin': } 20 | -> anchor { 'mistral::db::end': } 21 | ~> anchor { 'mistral::dbsync::begin': } 22 | -> anchor { 'mistral::dbsync::end': } 23 | ~> anchor { 'mistral::service::begin': } 24 | ~> Service<| tag == 'mistral-service' |> 25 | ~> anchor { 'mistral::service::end': } 26 | 27 | # We need openstackclient before marking service end so that mistral 28 | # will have clients available to create resources. This tag handles the 29 | # openstackclient but indirectly since the client is not available in 30 | # all catalogs that don't need the client class (like many spec tests) 31 | Package<| tag == 'openstackclient'|> 32 | -> Anchor['mistral::service::end'] 33 | 34 | # Installation or config changes will always restart services. 35 | Anchor['mistral::install::end'] ~> Anchor['mistral::service::begin'] 36 | Anchor['mistral::config::end'] ~> Anchor['mistral::service::begin'] 37 | } 38 | -------------------------------------------------------------------------------- /manifests/engine.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::engine 2 | # 3 | # Installs & configure the Mistral Engine service 4 | # 5 | # === Parameters 6 | # [*package_ensure*] 7 | # (Optional) Ensure state for package. 8 | # Defaults to present 9 | # 10 | # [*enabled*] 11 | # (optional) Should the service be enabled. 12 | # Defaults to 'true'. 13 | # 14 | # [*manage_service*] 15 | # (optional) Whether the service should be managed by Puppet. 16 | # Defaults to 'true'. 17 | # 18 | # [*host*] 19 | # (Optional) Name of the engine node. This can be an opaque identifier. 20 | # It is not necessarily a hostname, FQDN, or IP address. (string value) 21 | # Defaults to $facts['os_service_default']. 22 | # 23 | # [*topic*] 24 | # (Optional) The message topic that the engine listens on. 25 | # Defaults to $facts['os_service_default']. 26 | # 27 | # [*version*] 28 | # (Optional) The version of the engine. (string value) 29 | # Defaults to $facts['os_service_default']. 30 | # 31 | # [*execution_field_size_limit_kb*] 32 | # (Optional) The default maximum size in KB of large text fields 33 | # of runtime execution objects. Use -1 for no limit. 34 | # Defaults to $facts['os_service_default']. 35 | # 36 | # [*execution_integrity_check_delay*] 37 | # (Optional) A number of seconds since the last update of a task execution 38 | # in RUNNING state after which Mistral will start checking its integrity. 39 | # Defaults to $facts['os_service_default']. 40 | # 41 | # [*execution_integrity_check_batch_size*] 42 | # (Optional) A number of task executions in RUNNING state that the execution 43 | # integrity checker can process in a single iteration. 44 | # Defaults to $facts['os_service_default']. 45 | # 46 | # [*action_definition_cache_time*] 47 | # (Optional) A number of seconds that indicates how long action definitions 48 | # should be stored in the local cache. 49 | # Defaults to $facts['os_service_default']. 50 | # 51 | # [*start_subworkflows_via_rpc*] 52 | # (Optional) Enables starting subworkflows via RPC. 53 | # Defaults to $facts['os_service_default']. 54 | # 55 | class mistral::engine ( 56 | $package_ensure = present, 57 | Boolean $manage_service = true, 58 | Boolean $enabled = true, 59 | $host = $facts['os_service_default'], 60 | $topic = $facts['os_service_default'], 61 | $version = $facts['os_service_default'], 62 | $execution_field_size_limit_kb = $facts['os_service_default'], 63 | $execution_integrity_check_delay = $facts['os_service_default'], 64 | $execution_integrity_check_batch_size = $facts['os_service_default'], 65 | $action_definition_cache_time = $facts['os_service_default'], 66 | $start_subworkflows_via_rpc = $facts['os_service_default'], 67 | ) { 68 | 69 | include mistral::deps 70 | include mistral::params 71 | 72 | package { 'mistral-engine': 73 | ensure => $package_ensure, 74 | name => $::mistral::params::engine_package_name, 75 | tag => ['openstack', 'mistral-package'], 76 | } 77 | 78 | if $manage_service { 79 | if $enabled { 80 | $service_ensure = 'running' 81 | } else { 82 | $service_ensure = 'stopped' 83 | } 84 | 85 | service { 'mistral-engine': 86 | ensure => $service_ensure, 87 | name => $::mistral::params::engine_service_name, 88 | enable => $enabled, 89 | hasstatus => true, 90 | hasrestart => true, 91 | tag => 'mistral-service', 92 | } 93 | } 94 | 95 | mistral_config { 96 | 'engine/host': value => $host; 97 | 'engine/topic': value => $topic; 98 | 'engine/version': value => $version; 99 | 'engine/execution_field_size_limit_kb': value => $execution_field_size_limit_kb; 100 | 'engine/execution_integrity_check_delay': value => $execution_integrity_check_delay; 101 | 'engine/execution_integrity_check_batch_size': value => $execution_integrity_check_batch_size; 102 | 'engine/action_definition_cache_time': value => $action_definition_cache_time; 103 | 'engine/start_subworkflows_via_rpc': value => $start_subworkflows_via_rpc; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /manifests/event_engine.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::engine 2 | # 3 | # Installs & configure the Mistral Engine service 4 | # 5 | # === Parameters 6 | # [*package_ensure*] 7 | # (Optional) Ensure state for package. 8 | # Defaults to present 9 | # 10 | # [*enabled*] 11 | # (optional) Should the service be enabled. 12 | # Defaults to 'true'. 13 | # 14 | # [*manage_service*] 15 | # (optional) Whether the service should be managed by Puppet. 16 | # Defaults to 'true'. 17 | # 18 | # [*host*] 19 | # (Optional) Name of the engine node. This can be an opaque identifier. 20 | # It is not necessarily a hostname, FQDN, or IP address. (string value) 21 | # Defaults to $facts['os_service_default']. 22 | # 23 | # [*topic*] 24 | # (Optional) The message topic that the engine listens on. 25 | # Defaults to $facts['os_service_default']. 26 | # 27 | # [*event_definitions_cfg_file*] 28 | # (Optional) The path to the event_definitions config file. 29 | # Defaults to $facts['os_service_default']. 30 | # 31 | class mistral::event_engine ( 32 | $package_ensure = present, 33 | Boolean $manage_service = true, 34 | Boolean $enabled = true, 35 | $host = $facts['os_service_default'], 36 | $topic = $facts['os_service_default'], 37 | $event_definitions_cfg_file = $facts['os_service_default'], 38 | ) { 39 | 40 | include mistral::deps 41 | include mistral::params 42 | 43 | package { 'mistral-event-engine': 44 | ensure => $package_ensure, 45 | name => $::mistral::params::event_engine_package_name, 46 | tag => ['openstack', 'mistral-package'], 47 | } 48 | 49 | if $manage_service { 50 | if $enabled { 51 | $service_ensure = 'running' 52 | } else { 53 | $service_ensure = 'stopped' 54 | } 55 | 56 | service { 'mistral-event-engine': 57 | ensure => $service_ensure, 58 | name => $::mistral::params::event_engine_service_name, 59 | enable => $enabled, 60 | hasstatus => true, 61 | hasrestart => true, 62 | tag => 'mistral-service', 63 | } 64 | } 65 | 66 | mistral_config { 67 | 'event_engine/host': value => $host; 68 | 'event_engine/topic': value => $topic; 69 | 'event_engine/event_definitions_cfg_file': value => $event_definitions_cfg_file; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /manifests/execution_expiration_policy.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::execution_expiration_policy 2 | # 3 | # Configure the mistral execution_expiration_policy 4 | # 5 | # === Parameters 6 | # 7 | # [*evaluation_interval*] 8 | # (Optional) How often will the executions be evaluated (in minutes). 9 | # Defaults to $facts['os_service_default']. 10 | # 11 | # [*older_than*] 12 | # (Optional) Evaluate from which time remove executions in minutes. 13 | # Note that only final state execution will remove (SUCCESS/ERROR). 14 | # Defaults to $facts['os_service_default']. 15 | # 16 | # [*max_finished_executions*] 17 | # (Optional) The maximum number of finished workflow executions to be stored. 18 | # Defaults to $facts['os_service_default']. 19 | # 20 | # [*batch_size*] 21 | # (Optional) Size of batch of expired executions to be deleted. 22 | # Defaults to $facts['os_service_default']. 23 | # 24 | # [*ignored_states*] 25 | # (Optional) The states that the expiration policy will filter out and will 26 | # not delete. 27 | # Defaults to $facts['os_service_default']. 28 | # 29 | class mistral::execution_expiration_policy ( 30 | $evaluation_interval = $facts['os_service_default'], 31 | $older_than = $facts['os_service_default'], 32 | $max_finished_executions = $facts['os_service_default'], 33 | $batch_size = $facts['os_service_default'], 34 | $ignored_states = $facts['os_service_default'], 35 | ) { 36 | 37 | include mistral::deps 38 | include mistral::params 39 | 40 | mistral_config { 41 | 'execution_expiration_policy/evaluation_interval': value => $evaluation_interval; 42 | 'execution_expiration_policy/older_than': value => $older_than; 43 | 'execution_expiration_policy/max_finished_executions': value => $max_finished_executions; 44 | 'execution_expiration_policy/batch_size': value => $batch_size; 45 | 'execution_expiration_policy/ignored_states': value => join(any2array($ignored_states), ','); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /manifests/executor.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::executor 2 | # 3 | # Installs & configure the Mistral Engine service 4 | # 5 | # === Parameters 6 | # [*package_ensure*] 7 | # (Optional) Ensure state for package. 8 | # Defaults to present 9 | # 10 | # [*enabled*] 11 | # (optional) Should the service be enabled. 12 | # Defaults to 'true'. 13 | # 14 | # [*manage_service*] 15 | # (optional) Whether the service should be managed by Puppet. 16 | # Defaults to 'true'. 17 | # 18 | # [*host*] 19 | # (Optional) Name of the executor node. This can be an opaque identifier. 20 | # It is not necessarily a hostname, FQDN, or IP address. (string value) 21 | # Defaults to $facts['os_service_default']. 22 | # 23 | # [*topic*] 24 | # (Optional) The message topic that the executor listens on. (string value) 25 | # Defaults to $facts['os_service_default']. 26 | # 27 | # [*version*] 28 | # (Optional) The version of the executor. (string value) 29 | # Defaults to $facts['os_service_default']. 30 | # 31 | class mistral::executor ( 32 | $package_ensure = present, 33 | Boolean $manage_service = true, 34 | Boolean $enabled = true, 35 | $host = $facts['os_service_default'], 36 | $topic = $facts['os_service_default'], 37 | $version = $facts['os_service_default'], 38 | ) { 39 | 40 | include mistral::deps 41 | include mistral::params 42 | 43 | package { 'mistral-executor': 44 | ensure => $package_ensure, 45 | name => $::mistral::params::executor_package_name, 46 | tag => ['openstack', 'mistral-package'], 47 | } 48 | 49 | if $manage_service { 50 | if $enabled { 51 | $service_ensure = 'running' 52 | } else { 53 | $service_ensure = 'stopped' 54 | } 55 | 56 | service { 'mistral-executor': 57 | ensure => $service_ensure, 58 | name => $::mistral::params::executor_service_name, 59 | enable => $enabled, 60 | hasstatus => true, 61 | hasrestart => true, 62 | tag => 'mistral-service', 63 | } 64 | } 65 | 66 | mistral_config { 67 | 'executor/host': value => $host; 68 | 'executor/topic': value => $topic; 69 | 'executor/version': value => $version; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /manifests/healthcheck.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::healthcheck 2 | # 3 | # Configure oslo_middleware options in healthcheck section 4 | # 5 | # == Params 6 | # 7 | # [*enabled*] 8 | # (Optional) Enable the healthcheck endpoint at /healthcheck. 9 | # Defaults to $facts['os_service_default'] 10 | # 11 | # [*detailed*] 12 | # (Optional) Show more detailed information as part of the response. 13 | # Defaults to $facts['os_service_default'] 14 | # 15 | # [*backends*] 16 | # (Optional) Additional backends that can perform health checks and report 17 | # that information back as part of a request. 18 | # Defaults to $facts['os_service_default'] 19 | # 20 | # [*allowed_source_ranges*] 21 | # (Optional) A list of network addresses to limit source ip allowed to access 22 | # healthcheck information. 23 | # Defaults to $facts['os_service_default'] 24 | # 25 | # [*ignore_proxied_requests*] 26 | # (Optional) Ignore requests with proxy headers 27 | # Defaults to $facts['os_service_default'] 28 | # 29 | # [*disable_by_file_path*] 30 | # (Optional) Check the presense of a file to determine if an application 31 | # is running on a port. 32 | # Defaults to $facts['os_service_default'] 33 | # 34 | # [*disable_by_file_paths*] 35 | # (Optional) Check the presense of a file to determine if an application 36 | # is running on a port. Expects a "port:path" list of strings. 37 | # Defaults to $facts['os_service_default'] 38 | # 39 | # [*enable_by_file_paths*] 40 | # (Optional) Check the presence of files. Used by EnableByFilesHealthcheck 41 | # plugin. 42 | # Defaults to $facts['os_service_default'] 43 | # 44 | class mistral::healthcheck ( 45 | $enabled = $facts['os_service_default'], 46 | $detailed = $facts['os_service_default'], 47 | $backends = $facts['os_service_default'], 48 | $allowed_source_ranges = $facts['os_service_default'], 49 | $ignore_proxied_requests = $facts['os_service_default'], 50 | $disable_by_file_path = $facts['os_service_default'], 51 | $disable_by_file_paths = $facts['os_service_default'], 52 | $enable_by_file_paths = $facts['os_service_default'], 53 | ) { 54 | 55 | include mistral::deps 56 | 57 | mistral_config { 58 | 'healthcheck/enabled': value => $enabled, 59 | } 60 | 61 | oslo::healthcheck { 'mistral_config': 62 | detailed => $detailed, 63 | backends => $backends, 64 | allowed_source_ranges => $allowed_source_ranges, 65 | ignore_proxied_requests => $ignore_proxied_requests, 66 | disable_by_file_path => $disable_by_file_path, 67 | disable_by_file_paths => $disable_by_file_paths, 68 | enable_by_file_paths => $enable_by_file_paths, 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /manifests/keystone/auth.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::keystone::auth 2 | # 3 | # Configures mistral user, service and endpoint in Keystone. 4 | # 5 | # === Parameters 6 | # 7 | # [*password*] 8 | # (Required) Password for mistral user. 9 | # 10 | # [*auth_name*] 11 | # (Optional) Username for mistral service. 12 | # Defaults to 'mistral'. 13 | # 14 | # [*email*] 15 | # (Optional) Email for mistral user. 16 | # Defaults to 'mistral@localhost'. 17 | # 18 | # [*tenant*] 19 | # (Optional) Tenant for mistral user. 20 | # Defaults to 'services'. 21 | # 22 | # [*roles*] 23 | # (Optional) List of roles assigned to neutron user. 24 | # Defaults to ['admin'] 25 | # 26 | # [*system_scope*] 27 | # (Optional) Scope for system operations. 28 | # Defaults to 'all' 29 | # 30 | # [*system_roles*] 31 | # (Optional) List of system roles assigned to neutron user. 32 | # Defaults to [] 33 | # 34 | # [*configure_endpoint*] 35 | # (Optional) Should mistral endpoint be configured? 36 | # Defaults to true. 37 | # 38 | # [*configure_user*] 39 | # (Optional) Should the service user be configured? 40 | # Defaults to true. 41 | # 42 | # [*configure_user_role*] 43 | # (Optional) Whether to configure the admin role for the service user. 44 | # Defaults to true 45 | # 46 | # [*configure_service*] 47 | # (Optional) Should mistral service be configured? 48 | # Defaults to true. 49 | # 50 | # [*service_type*] 51 | # (Optional) Type of service. 52 | # Defaults to 'workflowv2'. 53 | # 54 | # [*public_url*] 55 | # (Optional) The endpoint's public url. 56 | # Defaults to 'http://127.0.0.1:8989:/v2' 57 | # 58 | # [*internal_url*] 59 | # (Optional) The endpoint's internal url. 60 | # Defaults to 'http://127.0.0.1:8989/v2' 61 | # 62 | # [*admin_url*] 63 | # (Optional) The endpoint's admin url. 64 | # Defaults to 'http://127.0.0.1:8989/v2' 65 | # 66 | # [*region*] 67 | # (Optional) Region for endpoint. 68 | # Defaults to 'RegionOne'. 69 | # 70 | # [*service_name*] 71 | # (Optional) Name of the service. 72 | # Defaults to 'mistral'. 73 | # 74 | # [*service_description*] 75 | # (Optional) Description for keystone service. 76 | # Defaults to 'Openstack workflow Service'. 77 | 78 | class mistral::keystone::auth( 79 | String[1] $password, 80 | String[1] $email = 'mistral@localhost', 81 | String[1] $auth_name = 'mistral', 82 | String[1] $service_name = 'mistral', 83 | String[1] $service_type = 'workflowv2', 84 | Keystone::PublicEndpointUrl $public_url = 'http://127.0.0.1:8989/v2', 85 | Keystone::EndpointUrl $admin_url = 'http://127.0.0.1:8989/v2', 86 | Keystone::EndpointUrl $internal_url = 'http://127.0.0.1:8989/v2', 87 | String[1] $region = 'RegionOne', 88 | String[1] $tenant = 'services', 89 | Array[String[1]] $roles = ['admin'], 90 | String[1] $system_scope = 'all', 91 | Array[String[1]] $system_roles = [], 92 | Boolean $configure_endpoint = true, 93 | Boolean $configure_user = true, 94 | Boolean $configure_user_role = true, 95 | Boolean $configure_service = true, 96 | String[1] $service_description = 'OpenStack Workflow Service', 97 | ) { 98 | 99 | include mistral::deps 100 | 101 | Keystone::Resource::Service_identity['mistral'] -> Anchor['mistral::service::end'] 102 | 103 | keystone::resource::service_identity { 'mistral': 104 | configure_user => $configure_user, 105 | configure_user_role => $configure_user_role, 106 | configure_endpoint => $configure_endpoint, 107 | configure_service => $configure_service, 108 | service_type => $service_type, 109 | service_description => $service_description, 110 | service_name => $service_name, 111 | region => $region, 112 | auth_name => $auth_name, 113 | password => $password, 114 | email => $email, 115 | tenant => $tenant, 116 | roles => $roles, 117 | system_scope => $system_scope, 118 | system_roles => $system_roles, 119 | public_url => $public_url, 120 | admin_url => $admin_url, 121 | internal_url => $internal_url, 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /manifests/legacy_action_providers.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::legacy_action_providers 2 | # 3 | # Configure the legacy_action_providers config section. 4 | # 5 | # === Parameters 6 | # 7 | # [*load_action_plugins*] 8 | # (Optional) Enables loading actions configured in the 9 | # entry point "mistral.actions". 10 | # Defaults to $facts['os_service_default'] 11 | # 12 | # [*load_action_generators*] 13 | # (Optional) Enables loading actions from action generators 14 | # configured in the entry point "mistral.generators". 15 | # Defaults to $facts['os_service_default'] 16 | # 17 | # [*only_builtin_actions*] 18 | # (Optional) If True, then the legacy action provider loads 19 | # only the actions delivered by the Mistral project out of 20 | # the box plugged in with the entry point "mistral.actions". 21 | # This property is needed mostly for testing.' 22 | # Defaults to $facts['os_service_default'] 23 | # 24 | # [*allowlist*] 25 | # (Optional) Allowlist with actions that is allowed to be 26 | # loaded, if empty all actions will be allowed. 27 | # Defaults to $facts['os_service_default'] 28 | 29 | # [*denylist*] 30 | # (Optional) Denylist with actions that is not allowed to 31 | # be loaded, allowlist takes precedence, if empty all actions 32 | # will be allowed. 33 | # Defaults to $facts['os_service_default'] 34 | # 35 | class mistral::legacy_action_providers ( 36 | $load_action_plugins = $facts['os_service_default'], 37 | $load_action_generators = $facts['os_service_default'], 38 | $only_builtin_actions = $facts['os_service_default'], 39 | $allowlist = $facts['os_service_default'], 40 | $denylist = $facts['os_service_default'], 41 | ) { 42 | 43 | mistral_config { 44 | 'legacy_action_providers/load_action_plugins': value => $load_action_plugins; 45 | 'legacy_action_providers/load_action_generators': value => $load_action_generators; 46 | 'legacy_action_providers/only_builtin_actions': value => $only_builtin_actions; 47 | 'legacy_action_providers/allowlist': value => join(any2array($allowlist), ','); 48 | 'legacy_action_providers/denylist': value => join(any2array($denylist), ','); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /manifests/logging.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::logging 2 | # 3 | # Mistral logging configuration 4 | # 5 | # === Parameters 6 | # 7 | # [*debug*] 8 | # (Optional) Should the daemons log debug messages 9 | # Defaults to $facts['os_service_default'] 10 | # 11 | # [*use_syslog*] 12 | # (Optional) Use syslog for logging. 13 | # Defaults to $facts['os_service_default'] 14 | # 15 | # [*use_json*] 16 | # (Optional) Use json for logging. 17 | # Defaults to $facts['os_service_default'] 18 | # 19 | # [*use_journal*] 20 | # (Optional) Use journal for logging. 21 | # Defaults to $facts['os_service_default'] 22 | # 23 | # [*use_stderr*] 24 | # (Optional) Use stderr for logging 25 | # Defaults to $facts['os_service_default'] 26 | # 27 | # [*log_facility*] 28 | # (Optional) Syslog facility to receive log lines. 29 | # Defaults to $facts['os_service_default'] 30 | # 31 | # [*log_dir*] 32 | # (Optional) Directory where logs should be stored. 33 | # If set to boolean false or $facts['os_service_default'], it will not log to any 34 | # directory. 35 | # Defaults to '/var/log/mistral' 36 | # 37 | # [*log_file*] 38 | # (Optional) File where logs should be stored. 39 | # Defaults to $facts['os_service_default'] 40 | # 41 | # [*logging_context_format_string*] 42 | # (Optional) Format string to use for log messages with context. 43 | # Defaults to $facts['os_service_default'] 44 | # Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\ 45 | # [%(request_id)s %(user_identity)s] %(instance)s%(message)s' 46 | # 47 | # [*logging_default_format_string*] 48 | # (Optional) Format string to use for log messages without context. 49 | # Defaults to $facts['os_service_default'] 50 | # Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\ 51 | # [-] %(instance)s%(message)s' 52 | # 53 | # [*logging_debug_format_suffix*] 54 | # (Optional) Formatted data to append to log format when level is DEBUG. 55 | # Defaults to $facts['os_service_default'] 56 | # Example: '%(funcName)s %(pathname)s:%(lineno)d' 57 | # 58 | # [*logging_exception_prefix*] 59 | # (Optional) Prefix each line of exception output with this format. 60 | # Defaults to $facts['os_service_default'] 61 | # Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s' 62 | # 63 | # [*log_config_append*] 64 | # (Optional) The name of an additional logging configuration file. 65 | # Defaults to $facts['os_service_default'] 66 | # See https://docs.python.org/2/howto/logging.html 67 | # 68 | # [*default_log_levels*] 69 | # (Optional) Hash of logger (keys) and level (values) pairs. 70 | # Defaults to $facts['os_service_default']. 71 | # Example: 72 | # { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN', 73 | # 'sqlalchemy' => 'WARN', 'suds' => 'INFO', 'iso8601' => 'WARN', 74 | # 'requests.packages.urllib3.connectionpool' => 'WARN' } 75 | # 76 | # [*publish_errors*] 77 | # (Optional) Publish error events (boolean value). 78 | # Defaults to $facts['os_service_default'] 79 | # 80 | # [*fatal_deprecations*] 81 | # (Optional) Make deprecations fatal (boolean value) 82 | # Defaults to $facts['os_service_default'] 83 | # 84 | # [*instance_format*] 85 | # (Optional) If an instance is passed with the log message, format it 86 | # like this (string value). 87 | # Defaults to $facts['os_service_default'] 88 | # Example: '[instance: %(uuid)s] ' 89 | # 90 | # [*instance_uuid_format*] 91 | # (Optional) If an instance UUID is passed with the log message, format 92 | # it like this (string value). 93 | # Defaults to $facts['os_service_default'] 94 | # Example: instance_uuid_format='[instance: %(uuid)s] ' 95 | # 96 | # [*log_date_format*] 97 | # (Optional) Format string for %%(asctime)s in log records. 98 | # Defaults to $facts['os_service_default'] 99 | # Example: 'Y-%m-%d %H:%M:%S' 100 | # 101 | class mistral::logging( 102 | $use_syslog = $facts['os_service_default'], 103 | $use_json = $facts['os_service_default'], 104 | $use_journal = $facts['os_service_default'], 105 | $use_stderr = $facts['os_service_default'], 106 | $log_facility = $facts['os_service_default'], 107 | $log_dir = '/var/log/mistral', 108 | $log_file = $facts['os_service_default'], 109 | $debug = $facts['os_service_default'], 110 | $logging_context_format_string = $facts['os_service_default'], 111 | $logging_default_format_string = $facts['os_service_default'], 112 | $logging_debug_format_suffix = $facts['os_service_default'], 113 | $logging_exception_prefix = $facts['os_service_default'], 114 | $log_config_append = $facts['os_service_default'], 115 | $default_log_levels = $facts['os_service_default'], 116 | $publish_errors = $facts['os_service_default'], 117 | $fatal_deprecations = $facts['os_service_default'], 118 | $instance_format = $facts['os_service_default'], 119 | $instance_uuid_format = $facts['os_service_default'], 120 | $log_date_format = $facts['os_service_default'], 121 | ) { 122 | 123 | include mistral::deps 124 | 125 | oslo::log { 'mistral_config': 126 | use_syslog => $use_syslog, 127 | use_json => $use_json, 128 | use_journal => $use_journal, 129 | use_stderr => $use_stderr, 130 | syslog_log_facility => $log_facility, 131 | log_dir => $log_dir, 132 | log_file => $log_file, 133 | debug => $debug, 134 | default_log_levels => $default_log_levels, 135 | logging_context_format_string => $logging_context_format_string, 136 | logging_default_format_string => $logging_default_format_string, 137 | logging_debug_format_suffix => $logging_debug_format_suffix, 138 | logging_exception_prefix => $logging_exception_prefix, 139 | log_config_append => $log_config_append, 140 | publish_errors => $publish_errors, 141 | fatal_deprecations => $fatal_deprecations, 142 | instance_format => $instance_format, 143 | instance_uuid_format => $instance_uuid_format, 144 | log_date_format => $log_date_format, 145 | } 146 | 147 | } 148 | -------------------------------------------------------------------------------- /manifests/notifier.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::notifier 2 | # 3 | # Configure the mistral notifier 4 | # 5 | # === Parameters 6 | # 7 | # [*type*] 8 | # (Optional) Type of notifier. Use local to run the notifier within 9 | # the engine server. Use remote if the notifier is launched as a separate 10 | # server to process events. 11 | # (string value) 12 | # Defaults to $facts['os_service_default']. 13 | # 14 | # [*host*] 15 | # (Optional) Name of the notifier node. This can be an opaque identifier. 16 | # It is not necessarily a hostname, FQDN, or IP address. 17 | # (string value) 18 | # Defaults to $facts['os_service_default']. 19 | # 20 | # [*topic*] 21 | # (Optional) The message topic that the notifier server listens on. 22 | # (string value) 23 | # Defaults to $facts['os_service_default']. 24 | # 25 | # [*notify_publishers*] 26 | # (Optional) List of publishers to publish notification. 27 | # Note: This maps to the mistral config option `notify` but this is reserved 28 | # in Puppet. 29 | # (list of dicts) 30 | # Defaults to $facts['os_service_default']. 31 | # 32 | class mistral::notifier( 33 | $type = $facts['os_service_default'], 34 | $host = $facts['os_service_default'], 35 | $topic = $facts['os_service_default'], 36 | $notify_publishers = $facts['os_service_default'], 37 | ) { 38 | 39 | include mistral::deps 40 | include mistral::params 41 | 42 | mistral_config { 43 | 'notifier/type': value => $type; 44 | 'notifier/host': value => $host; 45 | 'notifier/topic': value => $topic; 46 | 'notifier/notify': value => $notify_publishers; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /manifests/params.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::params 2 | # 3 | # Parameters for puppet-mistral 4 | # 5 | class mistral::params { 6 | include openstacklib::defaults 7 | 8 | $client_package = 'python3-mistralclient' 9 | $db_sync_command = 'mistral-db-manage upgrade head' 10 | $db_populate_command = 'mistral-db-manage populate' 11 | $user = 'mistral' 12 | $group = 'mistral' 13 | 14 | case $facts['os']['family'] { 15 | 'RedHat': { 16 | $common_package_name = 'openstack-mistral-common' 17 | $api_package_name = 'openstack-mistral-api' 18 | $api_service_name = 'openstack-mistral-api' 19 | $engine_package_name = 'openstack-mistral-engine' 20 | $engine_service_name = 'openstack-mistral-engine' 21 | $executor_package_name = 'openstack-mistral-executor' 22 | $executor_service_name = 'openstack-mistral-executor' 23 | $event_engine_package_name = 'openstack-mistral-event-engine' 24 | $event_engine_service_name = 'openstack-mistral-event-engine' 25 | $mistral_wsgi_script_path = '/var/www/cgi-bin/mistral' 26 | $mistral_wsgi_script_source = '/usr/bin/mistral-wsgi-api' 27 | } 28 | 'Debian': { 29 | $common_package_name = 'mistral-common' 30 | $api_package_name = 'mistral-api' 31 | $api_service_name = 'mistral-api' 32 | $engine_package_name = 'mistral-engine' 33 | $engine_service_name = 'mistral-engine' 34 | $executor_package_name = 'mistral-executor' 35 | $executor_service_name = 'mistral-executor' 36 | $event_engine_package_name = 'mistral-event-engine' 37 | $event_engine_service_name = 'mistral-event-engine' 38 | $mistral_wsgi_script_path = '/usr/lib/cgi-bin/mistral' 39 | $mistral_wsgi_script_source = '/usr/bin/mistral-wsgi-api' 40 | } 41 | default: { 42 | fail("Unsupported osfamily: ${facts['os']['family']}") 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /manifests/policy.pp: -------------------------------------------------------------------------------- 1 | # == Class: mistral::policy 2 | # 3 | # Configure the mistral policies 4 | # 5 | # === Parameters 6 | # 7 | # [*enforce_scope*] 8 | # (Optional) Whether or not to enforce scope when evaluating policies. 9 | # Defaults to $facts['os_service_default']. 10 | # 11 | # [*enforce_new_defaults*] 12 | # (Optional) Whether or not to use old deprecated defaults when evaluating 13 | # policies. 14 | # Defaults to $facts['os_service_default']. 15 | # 16 | # [*policies*] 17 | # (Optional) Set of policies to configure for mistral 18 | # Example : 19 | # { 20 | # 'mistral-context_is_admin' => { 21 | # 'key' => 'context_is_admin', 22 | # 'value' => 'true' 23 | # }, 24 | # 'mistral-default' => { 25 | # 'key' => 'default', 26 | # 'value' => 'rule:admin_or_owner' 27 | # } 28 | # } 29 | # Defaults to empty hash. 30 | # 31 | # [*policy_path*] 32 | # (Optional) Path to the mistral policy.yaml file 33 | # Defaults to /etc/mistral/policy.yaml 34 | # 35 | # [*policy_default_rule*] 36 | # (Optional) Default rule. Enforced when a requested rule is not found. 37 | # Defaults to $facts['os_service_default']. 38 | # 39 | # [*policy_dirs*] 40 | # (Optional) Path to the mistral policy folder 41 | # Defaults to $facts['os_service_default'] 42 | # 43 | # [*purge_config*] 44 | # (optional) Whether to set only the specified policy rules in the policy 45 | # file. 46 | # Defaults to false. 47 | # 48 | class mistral::policy ( 49 | $enforce_scope = $facts['os_service_default'], 50 | $enforce_new_defaults = $facts['os_service_default'], 51 | Hash $policies = {}, 52 | $policy_path = '/etc/mistral/policy.yaml', 53 | $policy_default_rule = $facts['os_service_default'], 54 | $policy_dirs = $facts['os_service_default'], 55 | Boolean $purge_config = false, 56 | ) { 57 | 58 | include mistral::deps 59 | include mistral::params 60 | 61 | $policy_parameters = { 62 | policies => $policies, 63 | policy_path => $policy_path, 64 | file_user => 'root', 65 | file_group => $::mistral::params::group, 66 | file_format => 'yaml', 67 | purge_config => $purge_config, 68 | tag => 'mistral', 69 | } 70 | 71 | create_resources('openstacklib::policy', { $policy_path => $policy_parameters }) 72 | 73 | # policy config should occur in the config block 74 | Anchor['mistral::config::begin'] 75 | -> Openstacklib::Policy[$policy_path] 76 | -> Anchor['mistral::config::end'] 77 | 78 | oslo::policy { 'mistral_config': 79 | enforce_scope => $enforce_scope, 80 | enforce_new_defaults => $enforce_new_defaults, 81 | policy_file => $policy_path, 82 | policy_default_rule => $policy_default_rule, 83 | policy_dirs => $policy_dirs, 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /manifests/wsgi/apache.pp: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 eNovance SAS 3 | # 4 | # Author: Emilien Macchi 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | # not use this file except in compliance with the License. You may obtain 8 | # a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | # License for the specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | # Class to serve mistral API with apache mod_wsgi in place of mistral-api service. 19 | # 20 | # Serving mistral API from apache is the recommended way to go for production 21 | # because of limited performance for concurrent accesses when running eventlet. 22 | # 23 | # When using this class you should disable your mistral-api service. 24 | # 25 | # == Parameters 26 | # 27 | # [*servername*] 28 | # (Optional) The servername for the virtualhost. 29 | # Defaults to $facts['networking']['fqdn'] 30 | # 31 | # [*port*] 32 | # (Optional) The port. 33 | # Defaults to 8989 34 | # 35 | # [*bind_host*] 36 | # (Optional) The host/ip address Apache will listen on. 37 | # Defaults to undef (listen on all ip addresses). 38 | # 39 | # [*path*] 40 | # (Optional) The prefix for the endpoint. 41 | # Defaults to '/' 42 | # 43 | # [*ssl*] 44 | # (Optional) Use ssl ? (boolean) 45 | # Defaults to false 46 | # 47 | # [*workers*] 48 | # (Optional) Number of WSGI workers to spawn. 49 | # Defaults to $facts['os_workers'] 50 | # 51 | # [*priority*] 52 | # (Optional) The priority for the vhost. 53 | # Defaults to 10 54 | # 55 | # [*threads*] 56 | # (Optional) The number of threads for the vhost. 57 | # Defaults to 1 58 | # 59 | # [*wsgi_process_display_name*] 60 | # (Optional) Name of the WSGI process display-name. 61 | # Defaults to undef 62 | # 63 | # [*ssl_cert*] 64 | # [*ssl_key*] 65 | # [*ssl_chain*] 66 | # [*ssl_ca*] 67 | # [*ssl_crl_path*] 68 | # [*ssl_crl*] 69 | # [*ssl_certs_dir*] 70 | # (Optional) apache::vhost ssl parameters. 71 | # Default to apache::vhost 'ssl_*' defaults. 72 | # 73 | # [*access_log_file*] 74 | # (Optional) The log file name for the virtualhost. 75 | # Defaults to undef. 76 | # 77 | # [*access_log_pipe*] 78 | # (Optional) Specifies a pipe where Apache sends access logs for 79 | # the virtualhost. 80 | # Defaults to undef. 81 | # 82 | # [*access_log_syslog*] 83 | # (Optional) Sends the virtualhost access log messages to syslog. 84 | # Defaults to undef. 85 | # 86 | # [*access_log_format*] 87 | # (Optional) The log format for the virtualhost. 88 | # Defaults to undef. 89 | # 90 | # [*error_log_file*] 91 | # (Optional) The error log file name for the virtualhost. 92 | # Defaults to undef. 93 | # 94 | # [*error_log_pipe*] 95 | # (Optional) Specifies a pipe where Apache sends error logs for 96 | # the virtualhost. 97 | # Defaults to undef. 98 | # 99 | # [*error_log_syslog*] 100 | # (Optional) Sends the virtualhost error log messages to syslog. 101 | # Defaults to undef. 102 | # 103 | # [*custom_wsgi_process_options*] 104 | # (Optional) gives you the opportunity to add custom process options or to 105 | # overwrite the default options for the WSGI main process. 106 | # eg. to use a virtual python environment for the WSGI process 107 | # you could set it to: 108 | # { python-path => '/my/python/virtualenv' } 109 | # Defaults to {} 110 | # 111 | # [*headers*] 112 | # (Optional) Headers for the vhost. 113 | # Defaults to undef 114 | # 115 | # [*request_headers*] 116 | # (Optional) Modifies collected request headers in various ways. 117 | # Defaults to undef 118 | # 119 | # [*vhost_custom_fragment*] 120 | # (Optional) Passes a string of custom configuration 121 | # directives to be placed at the end of the vhost configuration. 122 | # Defaults to undef. 123 | # 124 | # == Dependencies 125 | # 126 | # requires Class['apache'] & Class['mistral'] 127 | # 128 | # == Examples 129 | # 130 | # include apache 131 | # 132 | # class { 'mistral::wsgi::apache': } 133 | # 134 | class mistral::wsgi::apache ( 135 | $servername = $facts['networking']['fqdn'], 136 | $port = 8989, 137 | $bind_host = undef, 138 | $path = '/', 139 | $ssl = false, 140 | $workers = $facts['os_workers'], 141 | $ssl_cert = undef, 142 | $ssl_key = undef, 143 | $ssl_chain = undef, 144 | $ssl_ca = undef, 145 | $ssl_crl_path = undef, 146 | $ssl_crl = undef, 147 | $ssl_certs_dir = undef, 148 | $wsgi_process_display_name = undef, 149 | $threads = 1, 150 | $priority = 10, 151 | $access_log_file = undef, 152 | $access_log_pipe = undef, 153 | $access_log_syslog = undef, 154 | $access_log_format = undef, 155 | $error_log_file = undef, 156 | $error_log_pipe = undef, 157 | $error_log_syslog = undef, 158 | $custom_wsgi_process_options = {}, 159 | $headers = undef, 160 | $request_headers = undef, 161 | $vhost_custom_fragment = undef, 162 | ) { 163 | 164 | include mistral::deps 165 | include mistral::params 166 | 167 | Anchor['mistral::install::end'] -> Class['apache'] 168 | 169 | openstacklib::wsgi::apache { 'mistral_wsgi': 170 | bind_host => $bind_host, 171 | bind_port => $port, 172 | group => $::mistral::params::group, 173 | path => $path, 174 | priority => $priority, 175 | servername => $servername, 176 | ssl => $ssl, 177 | ssl_ca => $ssl_ca, 178 | ssl_cert => $ssl_cert, 179 | ssl_certs_dir => $ssl_certs_dir, 180 | ssl_chain => $ssl_chain, 181 | ssl_crl => $ssl_crl, 182 | ssl_crl_path => $ssl_crl_path, 183 | ssl_key => $ssl_key, 184 | threads => $threads, 185 | user => $::mistral::params::user, 186 | vhost_custom_fragment => $vhost_custom_fragment, 187 | workers => $workers, 188 | wsgi_daemon_process => 'mistral', 189 | wsgi_process_display_name => $wsgi_process_display_name, 190 | wsgi_process_group => 'mistral', 191 | wsgi_script_dir => $::mistral::params::mistral_wsgi_script_path, 192 | wsgi_script_file => 'app', 193 | wsgi_script_source => $::mistral::params::mistral_wsgi_script_source, 194 | headers => $headers, 195 | request_headers => $request_headers, 196 | custom_wsgi_process_options => $custom_wsgi_process_options, 197 | access_log_file => $access_log_file, 198 | access_log_pipe => $access_log_pipe, 199 | access_log_syslog => $access_log_syslog, 200 | access_log_format => $access_log_format, 201 | error_log_file => $error_log_file, 202 | error_log_pipe => $error_log_pipe, 203 | error_log_syslog => $error_log_syslog, 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "OpenStack Contributors", 3 | "dependencies": [ 4 | { 5 | "name": "puppetlabs/inifile", 6 | "version_requirement": ">=2.0.0 <7.0.0" 7 | }, 8 | { 9 | "name": "puppetlabs/stdlib", 10 | "version_requirement": ">=5.0.0 <10.0.0" 11 | }, 12 | { 13 | "name": "openstack/keystone", 14 | "version_requirement": ">=26.0.0 <27.0.0" 15 | }, 16 | { 17 | "name": "openstack/openstacklib", 18 | "version_requirement": ">=26.0.0 <27.0.0" 19 | }, 20 | { 21 | "name": "openstack/oslo", 22 | "version_requirement": ">=26.0.0 <27.0.0" 23 | } 24 | ], 25 | "description": "Installs and configures OpenStack mistral.", 26 | "issues_url": "https://bugs.launchpad.net/puppet-mistral", 27 | "license": "Apache-2.0", 28 | "name": "openstack-mistral", 29 | "operatingsystem_support": [ 30 | { 31 | "operatingsystem": "Debian", 32 | "operatingsystemrelease": [ 33 | "12" 34 | ] 35 | }, 36 | { 37 | "operatingsystem": "RedHat", 38 | "operatingsystemrelease": [ 39 | "9" 40 | ] 41 | }, 42 | { 43 | "operatingsystem": "CentOS", 44 | "operatingsystemrelease": [ 45 | "9" 46 | ] 47 | }, 48 | { 49 | "operatingsystem": "Ubuntu", 50 | "operatingsystemrelease": [ 51 | "24.04" 52 | ] 53 | } 54 | ], 55 | "project_page": "https://launchpad.net/puppet-mistral", 56 | "requirements": [ 57 | { 58 | "name": "puppet", 59 | "version_requirement": ">= 7.0.0 < 9.0.0" 60 | } 61 | ], 62 | "source": "https://opendev.org/openstack/puppet-mistral.git", 63 | "summary": "Puppet module for OpenStack Mistral", 64 | "version": "26.0.0" 65 | } 66 | -------------------------------------------------------------------------------- /releasenotes/notes/action-providers-cfg-group-a0da23b665358ebd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added ``mistral::action_providers`` and ``mistral::legacy_action_providers`` 5 | classes to configure the ``[action_providers]`` and ``[legacy_action_providers]`` 6 | configuration groups in Mistral. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/add-cron-trigger-67fb843e4950eb16.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add new parameters that allow configuring cron trigger 4 | settings. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-cron-trigger-interval-94df2eb3506cb7cb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add the execution_interval parameter to the cron trigger manifest. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add-log_file-for-logging-9aa0a919d7d36bc2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add the log_file option for logging. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-notfier-support-1e0645068547f64f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add new parameters that allow configuring notifier settings. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add-notification-transport-url-5a3e7f6d1630d14b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add olso.messaging notification transport_url via puppet-olso 4 | resource. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-openstackclient-client-af0f5c3f707e1f49.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add openstackclient installation to the client class. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add-pool_timeout-option-for-db-ad535206b8ecf55d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds the pool_timeout option for configuring oslo.db. This will 5 | configure this value for pool_timeout with SQLAlchemy. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/add-service_token_roles-option-8e3895d3bf4b6100.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add support to configure service_token_roles in authtoken middleware. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add-use_journal-option-for-logging-ba712fd13d62d609.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds the use_journal option for configuring oslo.log. This will enable 5 | passing the logs to journald. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/add_db_sync_timeout-956bcd2a88592600.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Adds db_sync_timeout parameter to db sync. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/add_enable_proxy_header_parsing-8613ae19724ef119.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - This adds the enable_proxy_headers parsing option which is used by the 4 | http_proxy_to_wsgi middleware. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add_event_engine-4294e0fe85331fc6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add support for Mistral event engine. 4 | 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add_messaging_notification_parameters-a569813623df3529.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add new parameter "notification_topics", AMQP topic used for 4 | OpenStack notifications. 5 | - Add new parameter "notification_driver", driver or drivers to 6 | handle sending notifications. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/add_mysql_enable_ndb-option-9a9788aa8e48c2bb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add mysql_enable_ndb parameter to select mysql storage engine. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/add_rabbit_kombu_options-8185738b6f0d8522.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds the kombu_failover_strategy option for configuring oslo.messaging.rabbit. 5 | This will determines how the next RabbitMQ node is chosen in case the one we 6 | are currently connected to becomes unavailable. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/add_watch_log_file-option-8659aea1935f31dd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::logging::watch_log_file`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/amqp_auto_delete-8552b7085fdbb335.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add a new ``amqp_auto_delete`` parameter, so that transient queues are 5 | automatically deleted. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/apache-headers-4a1675bcdb266037.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``mistral::wsgi::apache`` class now supports customizing 5 | request/response headers added by apache. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/api-keystone-authtoken-5563be4c165b35fc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Added `auth_strategy` to ::mistral::api to configure the inclusion of 5 | ::mistral::keystone::authtoken during the api configuration. Set this to 6 | something other than 'keystone' to have ::mistral::api not include the 7 | authtoken configuration. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/bug-1961601-1df5a15bead1daf3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - | 4 | Now the base ``Puppet::Provider::Mistral`` class loads service user 5 | credential using the proper keystoneauth parameters. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/centos-9-support-740222508780fcfa.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Now this module supports CentOS 9 and Red Hat Enterprise Linux 9. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/cleanup-coordination-590887c92de88031.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following parameters have been removed. 5 | 6 | - ``mistral::coordination_backend_url`` 7 | - ``mistral::coordination_heartbeat_interval`` 8 | -------------------------------------------------------------------------------- /releasenotes/notes/coordination-6da1ae2202029007.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::coordination`` class has been added. 5 | 6 | deprecations: 7 | - | 8 | The following parameters have been deprecated in favor of the new 9 | ``mistral::coordination`` class. 10 | 11 | - ``mistral::coordination_backend_url`` 12 | - ``mistral::coordination_heartbeat_interval`` 13 | -------------------------------------------------------------------------------- /releasenotes/notes/db_sync_class_default-40f42cf762187f17.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - By default the mistral::db::sync class will be included 4 | This can be disable by setting mistral::sync_db to false. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-coordination-aa2bbdc971b9a850.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``mistral::coordination`` class has been deprecated, because 5 | the coordination code in mistral was deprecated. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-coordination-heartbeat_interval-37a35124e18bd918.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``mistral::coordination::heartbeat_interval`` parameter has been 5 | deprecated and has no effect now. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-rabbit_heartbeat_in_pthread-644ca905479767d6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``mistral::rabbit_heartbeat_in_pthread`` parameter has been deprecated 5 | and will be removed in the future release. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate-watch_log_file-57d04617cbac6847.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``mistral::logging::watch_log_file`` parameter has been deprecated. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_auth_uri_parameter-8df63f76c70b0cba.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - auth_uri is deprecated and will be removed in a future release. 4 | Please use www_authenticate_uri instead. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_database_min_pool_size-option-848a4c6b7de5dea7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - database_min_pool_size option is now deprecated for removal, the 4 | parameter has no effect. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_database_options-141a6d8da8eb891b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``mistrall::database_connection`` has been deprecated and will be 5 | removed in a future release. Use the ``mistral::db::database_connection`` 6 | parameter instead. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_idle_timeout_parameter-b1568af63281c7ae.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - database_idle_timeout is deprecated and will be removed in a future 4 | release. Please use database_connection_recycle_time instead. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_pki_related_parameters-8b82bde77dc30fcd.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - check_revocations_for_cached option is now deprecated for removal, the 4 | parameter has no effect. 5 | - hash_algorithms option is now deprecated for removal, the parameter 6 | has no effect. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_revocation_cache_time_parameter-3e3ec8dd06f29c08.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - revocation_cache_time option is now deprecated for removal, the 4 | parameter has no effect. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_rpc_backend_parameter-5f612bed0889238b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - mistral::rpc_backend is deprecated and will be removed in a future 4 | release. Please use mistral::default_transport_url instead. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/deprecate_verbose_parameter-ad43da49125142de.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - verbose option is now deprecated for removal, the 4 | parameter has no effect. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/disable-apache-ssl-dc981c60fe16d6d7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Default value of the ``mistral::wsgi::apache::ssl`` parameter has been 5 | changed from ``true`` to ``false`` and now ssl is disabled by default. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/drop-fedora-02fd4ff7da62a9bc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Fedora is no longer supported. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/drop_qpid-9384d349ee594f57.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Drop all Qpid support, it was removed from Oslo in Mitaka. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/enable_cancel_on_failover-9917be4e60bc9d78.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::rabbit_enable_cancel_on_failover`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/engine-opts-fef47b623ca867c1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The following parameters have been added to the ``mistral::engine`` class. 5 | 6 | - ``execution_integrity_check_delay`` 7 | - ``execution_integrity_check_batch_size`` 8 | - ``action_definition_cache_time`` 9 | - ``start_subworkflows_via_rpc`` 10 | -------------------------------------------------------------------------------- /releasenotes/notes/execution_expiration_policy-cleanup-dc52ae9a060f8d87.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The following parameters of the ``mistral::engine`` class have been 5 | removed. 6 | 7 | - ``evaluation_interval`` 8 | - ``older_than`` 9 | -------------------------------------------------------------------------------- /releasenotes/notes/execution_expiration_policy-d0e9ebbd2e3b8c76.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::execution_expiration_policy`` class has been added. 5 | 6 | deprecations: 7 | - | 8 | The following parameters of the ``mistral::engine`` class have been 9 | deprecated in favor of the new ``mistral::execution_expiration_policy`` 10 | class. 11 | 12 | - ``evaluation_interval`` 13 | - ``older_than`` 14 | -------------------------------------------------------------------------------- /releasenotes/notes/external_dependency_management-8d3dea7e8ac36c51.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Dependencies are now managed in an external class. 4 | This allows installing Mistral via other methods besides 5 | packages. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/first_release-d4c9a7d326ead137.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | This is the first release of puppet-mistral module. 4 | 5 | features: 6 | - Allow to deploy Mistral API, Engine and Executor. 7 | - Manage Keystone resources for Mistral. 8 | - Allow to deploy Mistral API in WSGI with Apache. 9 | - Manage Mistral database. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/fix_debian_common_package_name-3268b0e603bd292f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - The name of the mistal common package was incorrect 4 | on debian based systems. The correct package name 5 | is 'mistral-common' 6 | -------------------------------------------------------------------------------- /releasenotes/notes/hc-enable_by_file_paths-be1bd2c96e55168f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::healthcheck::enable_by_file_paths`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/healthcheck-7b8fc85f5e53b674.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::healthcheck`` class has been added. This class manages 5 | parameters of healthcheck middlware in oslo.middleware. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/healthcheck-allowed_source_ranges-5fa7ca65f936a8ef.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::healthcheck::allowed_source_ranges`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/healthcheck-ignore_proxied_requests-a52d17b5c7ca1818.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::healthcheck::ignore_proxied_requests`` parameter has 5 | been added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/heartbeats-98aed300614308da.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add new parameters to configure hearbeat related options, max_missed_heartbeats 5 | check_interval and first_heartbeat_timeout. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/httpd-logs-piped-syslog-2b591ac833260287.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Added parameters for advanced configuration of httpd access and error log 5 | destinations including piped logging and syslog (see `mod_syslog`). Note 6 | that mod_syslog requires Apache2 >= 2.5.0. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/include_db_sync-c5e9c2c5cef49eb1.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - The class mistral::db::sync will be included by default. 4 | This matches what most other modules do. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone-auth-name-6717f5018361ef99.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | fixes: 3 | - The keystone auth class has been updated to provide a default service_name 4 | to allow a user to specify a custom auth_name that may not contain the 5 | name of the service. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone-authtoken-interface-9d2b4a88e71c2807.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::keystone::authtoken::interface`` parameter has been 5 | added, which can be used to set the interface parameter in authtoken 6 | middleware. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone-authtoken-service_type-e5f633ea1fdc30d5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::keystone::authtoken::service_type`` parameter has been 5 | added to configure the service_type parameter in authtoken middleware. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/keystone_authtoken-4eefe6058143c876.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Configure keystonemiddleware in a consistent way with all options required 4 | for Keystone v3. 5 | deprecations: 6 | - mistral::keystone_tenant is deprecated in favor of mistral::keystone::authtoken::project_name. 7 | - mistral::keystone_user is deprecated in favor of mistral::keystone::authtoken::username. 8 | - mistral::keystone_password is deprecated in favor of mistral::keystone::authtoken::password. 9 | - mistral::identity_uri is deprecated in favor of mistral::keystone::authtoken::auth_url. 10 | - mistral::auth_uri is deprecated in favor of mistral::keystone::authtoken::auth_uri. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/log-json-50d88f4669a867be.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Expose use_json logging parameter, which enables JSON formatted logging. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/max_request_body_size-86d0d951e94d181e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Add support to configure `[oslo_middleware]/max_request_body_size` with 5 | `$max_request_body_size`. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/migrate-policy-format-from-json-to-yaml-8a43ac1cf4d5ea54.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Now policy.yaml is used by default instead of policy.json. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/mistral_cors-744479c133f69360.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Allows configuring CORS settings. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/openstack_db_tag-a79c0b390eeba4bb.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add openstack-db tag to Exec that run db-sync. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/os_workers_for_worker_count-6deab8168bc940c2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - Parameters that control the number of spawned child processes for 4 | distributing processing have had their default value changed from 5 | ::processorcount to ::os_workers. 6 | - Switched default api worker count for the api service when 7 | not run under apache to use os_workers. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/oslo_policy-enforce_scope-6b163a9f10f23d18.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::policy::enforce_scope`` parameter has been added to 5 | support the corresponding parameter in oslo.policy library. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/policy-dirs-2ed6895c4391e395.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | There is now a new policy_dirs parameter in the mistral::policy class, 5 | so one can set a custom path. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/policy-enforce_new_defaults-2a64c8ab57788bdc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::policy::enforce_new_defaults`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/policy_default_rule-4d536844113b9239.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::policy::policy_default_rule`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/policy_purge_config-8ba7d9eea990947d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Adds new purge_config parameter. When set to true, the policy file is 5 | cleared during configuration process. This allows to remove any existing 6 | rules before applying them or clean the file when all policies got removed. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/prepare-to-change-apache-ssl-e83f6f9a4dcf6f8b.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Default value of the ``mistral::wsgi::apache::ssl`` parameter will be 5 | changed from ``true`` to ``false`` in a future release. Make sure 6 | the parameter is set to the desired value. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/provider-deprecate-at-params-484966d315226d95.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - | 4 | The ``mistral_workflow`` resource type has been using the credential 5 | written in the ``[keystone_authtoken]`` section of ``mistral.conf``. 6 | However this behavior has been deprecated and now the resource types first 7 | looks for the yaml files in ``/etc/openstack/puppet``. Make sure one of 8 | ``clouds.yaml`` or ``admin-clouds.yaml`` (which is created by 9 | puppet-keystone) is created in that directory. 10 | -------------------------------------------------------------------------------- /releasenotes/notes/puppet-8-819db188ea16cbf3.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | This module now officially supports Puppet 8. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/puppet4-mysql-func-9b2078d1c2e1d0db.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | This module now requires a puppetlabs-mysql version >= 6.0.0 5 | -------------------------------------------------------------------------------- /releasenotes/notes/rabbit-connection-params-deprecation-8f2abf8d3cb0594d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | deprecations: 3 | - mistral::rabbit_host, mistral::rabbit_hosts, mistral::rabbit_password, 4 | mistral::rabbit_port, mistral::rabbit_userid and 5 | mistral::rabbit_virtual_host are deprecated. 6 | mistral::default_transport_url should be used instead. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/rabbit_qos_prefetch_count-c8a97c06fc25d7e4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::rabbit_qos_prefetch_count`` parameter has been added. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/rabbit_transient_queues_ttl-c4243834920ec44d.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | A new parameter ``rabbit_transient_queues_ttl`` has been added to the 5 | mistral class to configure how long transtient queue should stay until 6 | they are automatically deleted. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/rabbit_transient_quorum_queue-a460a413e55f9484.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The new ``mistral::rabbit_transient_quorum_queue`` parameter has been 5 | added. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/rabbitmq-heartbeat-over-pthread-802f3f789d9d99f4.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Allow users to run the RabbitMQ heartbeat over a native python thread in the 5 | oslo.messaging RabbitMQ driver, by using the `rabbit_heartbeat_in_pthread` 6 | option in configuration. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/release-note-ubuntu-py3-4545fea5c4a994d6.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | prelude: > 3 | In this release Ubuntu has moved all projects that supported it to python3 4 | which means that there will be a lot of changes. The Puppet OpenStack project 5 | does not test the upgrade path from python2 to python3 packages so there might 6 | be manual steps required when moving to the python3 packages. 7 | upgrade: 8 | - | 9 | Ubuntu packages are now using python3, the upgrade path is not tested by 10 | Puppet OpenStack. Manual steps may be required when upgrading. 11 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-auth-uri-d82acb9eefbbab2f.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated parameter auth_uri is now removed, please use www_authenticate_uri. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-centos-8-df961bc77456455e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | CentOS 8 Stream is no longer supported by this module. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-coordination-heartbeat_interval-719d61392b7e7db7.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated ``mistral::coordination::heartbeat_interval`` parameter has 5 | been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-database-params-8bf2195a6f15a3f5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``mistral::database_connection`` parameter has been removed. 5 | 6 | - | 7 | The ``mistral::db::database_min_pool_size`` parameter has been removed. 8 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-9b4d20fce995e540.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated parameters evaluation_interval and older_than in 5 | mistral::executor is now removed. 6 | Please use evaluation_interval and older_than in mistral::engine instead. 7 | - | 8 | The deprecated parameters keystone_user, keystone_password, keystone_tenant, 9 | identity_uri and auth_uri in ::mistral is now removed. 10 | Please use username, password, project_name, auth_url and www_authenticate_uri 11 | in ::mistral::keystone::authtoken instead. 12 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-logging-1a61a633edfff7b0.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated parameters use_syslog, use_stderr, log_facility, log_dir and 5 | debug in the init class is now removed. Please set them in the logging class. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-deprecated-rabbit-params-987b59530e476762.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated mistral::rabbit_host, mistral::rabbit_hosts, mistral::rabbit_password, 5 | mistral::rabbit_port, mistral::rabbit_userid and mistral::rabit_virtual_host are now 6 | removed. Please use mistral::default_transport_url instead. 7 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-puppet-6-b28be43d146e429c.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | Puppet 6 is no longer supported. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove-watch_log_file-1fb36de4dd0e2c32.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The ``mistral::logging::watch_log_file`` parameter has been removed. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_keystone_revocation_cache_time_option-86c386c2484fd9d8.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Deprecated keystone::authtoken::revocation_cache_time option has been removed. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_deprecated_pki_related_options-bba5dfd118aae1ed.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - | 4 | The deprecated pki related options check_revocations_for_cached and 5 | hash_algorithms option has been removed. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_idle_timeout_option-a6024ea16d4e01d2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | upgrade: 3 | - Deprecated idle_timeout option has been removed. 4 | -------------------------------------------------------------------------------- /releasenotes/notes/remove_verbose-b6ae287286f00640.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | other: 3 | - The verbose option was marked to be removed in Ocata, 4 | in Newton the option was deprecated. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/service_token_roles_required-84c00ff15c72c2e5.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Service_token_roles_required missing in the server config file which 4 | allows backwards compatibility to ensure that the service tokens are 5 | compared against a list of possible roles for validity. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/switch_to_oslo_messaging-70e92a6709162b1e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Use oslo module for messaging (rabbit) configuration. 4 | Messaging related parameters were switched to $::os_service_default. 5 | Docs string for parameter were updated according to oslo module. 6 | -------------------------------------------------------------------------------- /releasenotes/notes/system_scope-keystone-9a41ff0d799142db.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | The ``system_scope`` parameter has been added to 5 | the ``mistral::keystone::authtoken`` class. 6 | 7 | - | 8 | The ``mistral::keystone::auth`` class now supports customizing roles 9 | assigned to the mistral service user. 10 | 11 | - | 12 | The ``mistral::keystone::auth`` class now supports defining assignmet of 13 | system-scoped roles to the mistral service user. 14 | -------------------------------------------------------------------------------- /releasenotes/notes/ubuntu-jammy-32947dc87597ce5e.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | This module now supports Ubuntu 22.04 (Jammy Jellyfish). 5 | 6 | upgrade: 7 | - | 8 | This module no longer supports Ubuntu 20.04 (Focal Fossa). 9 | -------------------------------------------------------------------------------- /releasenotes/notes/ubuntu-noble-8754d488ab4b6acc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - | 4 | Ubuntu 24.04 is now formally supported. 5 | 6 | upgrade: 7 | - | 8 | Ubuntu 22.04 is no longer supported. 9 | -------------------------------------------------------------------------------- /releasenotes/notes/use-reno-1caaec4ba5aa4285.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Release notes are no longer maintained by hand, we now use the reno tool to 4 | manage them. 5 | -------------------------------------------------------------------------------- /releasenotes/notes/wsgi_process_options-945733f0b0d9f355.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | features: 3 | - Add parameter to apache_wsgi to allow overwrite 4 | and/or add additional wsgi process options. 5 | -------------------------------------------------------------------------------- /releasenotes/source/2023.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/2023.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2023.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2023.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2023.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/2024.2.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2024.2 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2024.2 7 | -------------------------------------------------------------------------------- /releasenotes/source/2025.1.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | 2025.1 Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/2025.1 7 | -------------------------------------------------------------------------------- /releasenotes/source/_static/.placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openstack/puppet-mistral/ba711f966c0bc3b29a0f660e712eb1c828ac9be0/releasenotes/source/_static/.placeholder -------------------------------------------------------------------------------- /releasenotes/source/index.rst: -------------------------------------------------------------------------------- 1 | ======================================== 2 | Welcome to puppet-mistral Release Notes! 3 | ======================================== 4 | 5 | Contents 6 | ======== 7 | 8 | .. toctree:: 9 | :maxdepth: 2 10 | 11 | unreleased 12 | 2025.1 13 | 2024.2 14 | 2024.1 15 | 2023.2 16 | 2023.1 17 | zed 18 | yoga 19 | xena 20 | wallaby 21 | victoria 22 | ussuri 23 | train 24 | stein 25 | rocky 26 | queens 27 | pike 28 | ocata 29 | newton 30 | mitaka 31 | 32 | 33 | Indices and tables 34 | ================== 35 | 36 | * :ref:`genindex` 37 | * :ref:`search` 38 | -------------------------------------------------------------------------------- /releasenotes/source/mitaka.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Mitaka Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/mitaka 7 | -------------------------------------------------------------------------------- /releasenotes/source/newton.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Newton Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/newton 7 | -------------------------------------------------------------------------------- /releasenotes/source/ocata.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Ocata Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: origin/stable/ocata 7 | -------------------------------------------------------------------------------- /releasenotes/source/pike.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Pike Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/pike 7 | -------------------------------------------------------------------------------- /releasenotes/source/queens.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Queens Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/queens 7 | -------------------------------------------------------------------------------- /releasenotes/source/rocky.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Rocky Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/rocky 7 | -------------------------------------------------------------------------------- /releasenotes/source/stein.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | Stein Series Release Notes 3 | =================================== 4 | 5 | .. release-notes:: 6 | :branch: stable/stein 7 | -------------------------------------------------------------------------------- /releasenotes/source/train.rst: -------------------------------------------------------------------------------- 1 | ========================== 2 | Train Series Release Notes 3 | ========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/train 7 | -------------------------------------------------------------------------------- /releasenotes/source/unreleased.rst: -------------------------------------------------------------------------------- 1 | ============================== 2 | Current Series Release Notes 3 | ============================== 4 | 5 | .. release-notes:: 6 | -------------------------------------------------------------------------------- /releasenotes/source/ussuri.rst: -------------------------------------------------------------------------------- 1 | =========================== 2 | Ussuri Series Release Notes 3 | =========================== 4 | 5 | .. release-notes:: 6 | :branch: stable/ussuri 7 | -------------------------------------------------------------------------------- /releasenotes/source/victoria.rst: -------------------------------------------------------------------------------- 1 | ============================= 2 | Victoria Series Release Notes 3 | ============================= 4 | 5 | .. release-notes:: 6 | :branch: stable/victoria 7 | -------------------------------------------------------------------------------- /releasenotes/source/wallaby.rst: -------------------------------------------------------------------------------- 1 | ============================ 2 | Wallaby Series Release Notes 3 | ============================ 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/wallaby 7 | -------------------------------------------------------------------------------- /releasenotes/source/xena.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Xena Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/xena 7 | -------------------------------------------------------------------------------- /releasenotes/source/yoga.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Yoga Series Release Notes 3 | ========================= 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/yoga 7 | -------------------------------------------------------------------------------- /releasenotes/source/zed.rst: -------------------------------------------------------------------------------- 1 | ======================== 2 | Zed Series Release Notes 3 | ======================== 4 | 5 | .. release-notes:: 6 | :branch: unmaintained/zed 7 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = puppet-mistral 3 | summary = Puppet module for OpenStack Mistral 4 | description_file = 5 | README.md 6 | author = Puppet Labs and OpenStack Contributors 7 | author_email = openstack-discuss@lists.openstack.org 8 | home_page = https://docs.openstack.org/puppet-openstack-guide/latest 9 | license = Apache License, Version 2.0 10 | classifier = 11 | Intended Audience :: Developers 12 | Intended Audience :: Information Technology 13 | Intended Audience :: System Administrators 14 | License :: OSI Approved :: Apache Software License 15 | Operating System :: POSIX :: Linux 16 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | # implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | import setuptools 17 | 18 | setuptools.setup( 19 | setup_requires=['pbr>=2.0.0'], 20 | py_modules=[], 21 | pbr=True) 22 | -------------------------------------------------------------------------------- /spec/acceptance/10_basic_mistral_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'basic mistral' do 4 | 5 | context 'default parameters' do 6 | 7 | it 'should work with no errors' do 8 | pp= <<-EOS 9 | include openstack_integration 10 | include openstack_integration::repos 11 | include openstack_integration::apache 12 | include openstack_integration::rabbitmq 13 | include openstack_integration::mysql 14 | include openstack_integration::memcached 15 | include openstack_integration::keystone 16 | include openstack_integration::mistral 17 | EOS 18 | 19 | # Run it twice and test for idempotency 20 | apply_manifest(pp, :catch_failures => true) 21 | apply_manifest(pp, :catch_changes => true) 22 | end 23 | 24 | describe port(8989) do 25 | it { is_expected.to be_listening } 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /spec/acceptance/99_mistral_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper_acceptance' 2 | 3 | describe 'basic mistral_config resource' do 4 | 5 | context 'default parameters' do 6 | 7 | it 'should work with no errors' do 8 | pp= <<-EOS 9 | Exec { logoutput => 'on_failure' } 10 | 11 | File <||> -> Mistral_config <||> 12 | 13 | file { '/etc/mistral' : 14 | ensure => directory, 15 | } 16 | file { '/etc/mistral/mistral.conf' : 17 | ensure => file, 18 | } 19 | 20 | mistral_config { 'DEFAULT/thisshouldexist' : 21 | value => 'foo', 22 | } 23 | 24 | mistral_config { 'DEFAULT/thisshouldnotexist' : 25 | value => '', 26 | } 27 | 28 | mistral_config { 'DEFAULT/thisshouldexist2' : 29 | value => '', 30 | ensure_absent_val => 'toto', 31 | } 32 | 33 | mistral_config { 'DEFAULT/thisshouldnotexist2' : 34 | value => 'toto', 35 | ensure_absent_val => 'toto', 36 | } 37 | 38 | mistral_config { 'DEFAULT/thisshouldexist3' : 39 | value => ['foo', 'bar'], 40 | } 41 | EOS 42 | 43 | 44 | # Run it twice and test for idempotency 45 | apply_manifest(pp, :catch_failures => true) 46 | apply_manifest(pp, :catch_changes => true) 47 | end 48 | 49 | describe file('/etc/mistral/mistral.conf') do 50 | it { is_expected.to exist } 51 | it { is_expected.to contain('thisshouldexist=foo') } 52 | it { is_expected.to contain('thisshouldexist2=') } 53 | it { is_expected.to contain('thisshouldexist3=foo') } 54 | it { is_expected.to contain('thisshouldexist3=bar') } 55 | 56 | describe '#content' do 57 | subject { super().content } 58 | it { is_expected.to_not match /thisshouldnotexist/ } 59 | end 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /spec/classes/mistral_action_providers_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::action_providers' do 4 | let :params do 5 | {} 6 | end 7 | 8 | shared_examples 'mistral::action_providers' do 9 | context 'with defaults' do 10 | it { 11 | is_expected.to contain_mistral_config('action_providers/allowlist').with_value('') 12 | is_expected.to contain_mistral_config('action_providers/denylist').with_value('') 13 | } 14 | end 15 | 16 | context 'with parameters' do 17 | before do 18 | params.merge!({ 19 | :allowlist => ['allow0', 'allow1'], 20 | :denylist => ['deny0', 'deny1'], 21 | }) 22 | end 23 | 24 | it { 25 | is_expected.to contain_mistral_config('action_providers/allowlist').with_value('allow0,allow1') 26 | is_expected.to contain_mistral_config('action_providers/denylist').with_value('deny0,deny1') 27 | } 28 | end 29 | end 30 | 31 | on_supported_os({ 32 | :supported_os => OSDefaults.get_supported_os 33 | }).each do |os,facts| 34 | context "on #{os}" do 35 | let (:facts) do 36 | facts.merge!(OSDefaults.get_facts()) 37 | end 38 | 39 | it_behaves_like 'mistral::action_providers' 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /spec/classes/mistral_api_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::api' do 4 | let :params do 5 | { 6 | :api_workers => '1', 7 | :enabled => true, 8 | :manage_service => true, 9 | :bind_host => '127.0.0.1', 10 | :bind_port => '1234', 11 | :enable_proxy_headers_parsing => false, 12 | :max_request_body_size => '102400', 13 | :allow_action_execution_deletion => false 14 | } 15 | end 16 | 17 | let :pre_condition do 18 | "class { 'mistral::keystone::authtoken': 19 | password => 'foo', 20 | }" 21 | end 22 | 23 | shared_examples 'mistral::api' do 24 | context 'config params' do 25 | it { is_expected.to contain_class('mistral::params') } 26 | it { is_expected.to contain_class('mistral::policy') } 27 | it { is_expected.to contain_class('mistral::keystone::authtoken') } 28 | 29 | it { is_expected.to contain_mistral_config('api/api_workers').with_value( params[:api_workers] ) } 30 | it { is_expected.to contain_mistral_config('api/host').with_value( params[:bind_host] ) } 31 | it { is_expected.to contain_mistral_config('api/port').with_value( params[:bind_port] ) } 32 | it { is_expected.to contain_oslo__middleware('mistral_config').with( 33 | :enable_proxy_headers_parsing => params[:enable_proxy_headers_parsing], 34 | :max_request_body_size => params[:max_request_body_size], 35 | )} 36 | it { is_expected.to contain_mistral_config('api/allow_action_execution_deletion').with_value( params[:allow_action_execution_deletion] ) } 37 | 38 | end 39 | 40 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 41 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 42 | before do 43 | params.merge!(param_hash) 44 | end 45 | 46 | it 'configures mistral-api service' do 47 | is_expected.to contain_service('mistral-api').with( 48 | :ensure => params[:enabled] ? 'running' : 'stopped', 49 | :name => platform_params[:api_service_name], 50 | :enable => params[:enabled], 51 | :hasstatus => true, 52 | :hasrestart => true, 53 | :tag => 'mistral-service', 54 | ) 55 | is_expected.to contain_service('mistral-api').that_subscribes_to(nil) 56 | end 57 | end 58 | end 59 | 60 | context 'with enable_proxy_headers_parsing' do 61 | before do 62 | params.merge!({:enable_proxy_headers_parsing => true }) 63 | end 64 | 65 | it { is_expected.to contain_oslo__middleware('mistral_config').with( 66 | :enable_proxy_headers_parsing => params[:enable_proxy_headers_parsing], 67 | )} 68 | end 69 | 70 | context 'with max_request_body_size' do 71 | before do 72 | params.merge!({:max_request_body_size => '102400' }) 73 | end 74 | 75 | it { is_expected.to contain_oslo__middleware('mistral_config').with( 76 | :max_request_body_size => params[:max_request_body_size], 77 | )} 78 | end 79 | 80 | context 'with disabled service managing' do 81 | before do 82 | params.merge!({ 83 | :manage_service => false 84 | }) 85 | end 86 | 87 | it 'does not configure mistral-api service' do 88 | is_expected.to_not contain_service('mistral-api') 89 | end 90 | end 91 | 92 | context 'when running mistral-api in wsgi' do 93 | before do 94 | params.merge!({ :service_name => 'httpd' }) 95 | end 96 | 97 | let :pre_condition do 98 | "include apache 99 | include mistral::db 100 | class { 'mistral': } 101 | class { 'mistral::keystone::authtoken': 102 | password => 'foo', 103 | }" 104 | end 105 | 106 | it 'configures mistral-api service with Apache' do 107 | is_expected.to contain_service('mistral-api').with( 108 | :ensure => 'stopped', 109 | :name => platform_params[:api_service_name], 110 | :enable => false, 111 | :tag => ['mistral-service'], 112 | ) 113 | end 114 | end 115 | 116 | context 'when service_name is not valid' do 117 | before do 118 | params.merge!({ :service_name => 'foobar' }) 119 | end 120 | 121 | it { should raise_error(Puppet::Error, /Invalid service_name/) } 122 | end 123 | end 124 | 125 | on_supported_os({ 126 | :supported_os => OSDefaults.get_supported_os 127 | }).each do |os,facts| 128 | context "on #{os}" do 129 | let (:facts) do 130 | facts.merge!(OSDefaults.get_facts()) 131 | end 132 | 133 | let (:platform_params) do 134 | case facts[:os]['family'] 135 | when 'Debian' 136 | { :api_service_name => 'mistral-api' } 137 | when 'RedHat' 138 | { :api_service_name => 'openstack-mistral-api' } 139 | end 140 | end 141 | 142 | it_behaves_like 'mistral::api' 143 | end 144 | end 145 | end 146 | -------------------------------------------------------------------------------- /spec/classes/mistral_client_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::client' do 4 | 5 | shared_examples_for 'mistral client' do 6 | 7 | it { is_expected.to contain_class('mistral::deps') } 8 | it { is_expected.to contain_class('mistral::params') } 9 | 10 | it 'installs mistral client package' do 11 | is_expected.to contain_package('python-mistralclient').with( 12 | :ensure => 'present', 13 | :name => platform_params[:client_package], 14 | :tag => ['openstack', 'openstackclient'] 15 | ) 16 | end 17 | 18 | it { is_expected.to contain_class('openstacklib::openstackclient') } 19 | end 20 | 21 | on_supported_os({ 22 | :supported_os => OSDefaults.get_supported_os 23 | }).each do |os,facts| 24 | context "on #{os}" do 25 | let (:facts) do 26 | facts.merge!(OSDefaults.get_facts()) 27 | end 28 | 29 | let(:platform_params) do 30 | case facts[:os]['family'] 31 | when 'Debian' 32 | { :client_package => 'python3-mistralclient' } 33 | when 'RedHat' 34 | { :client_package => 'python3-mistralclient' } 35 | end 36 | end 37 | 38 | it_behaves_like 'mistral client' 39 | end 40 | end 41 | 42 | end 43 | -------------------------------------------------------------------------------- /spec/classes/mistral_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::config' do 4 | shared_examples 'mistral::config' do 5 | let :params do 6 | { 7 | :mistral_config => { 8 | 'DEFAULT/foo' => { 'value' => 'fooValue' }, 9 | 'DEFAULT/bar' => { 'value' => 'barValue' }, 10 | 'DEFAULT/baz' => { 'ensure' => 'absent' } 11 | } 12 | } 13 | end 14 | 15 | it { should contain_class('mistral::deps') } 16 | 17 | it { 18 | should contain_mistral_config('DEFAULT/foo').with_value('fooValue') 19 | should contain_mistral_config('DEFAULT/bar').with_value('barValue') 20 | should contain_mistral_config('DEFAULT/baz').with_ensure('absent') 21 | } 22 | end 23 | 24 | on_supported_os({ 25 | :supported_os => OSDefaults.get_supported_os 26 | }).each do |os,facts| 27 | context "on #{os}" do 28 | let (:facts) do 29 | facts.merge!(OSDefaults.get_facts()) 30 | end 31 | 32 | it_behaves_like 'mistral::config' 33 | end 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /spec/classes/mistral_coordination_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::coordination' do 4 | shared_examples 'mistral::coordination' do 5 | context 'with default parameters' do 6 | it { 7 | is_expected.to contain_oslo__coordination('mistral_config').with( 8 | :backend_url => '' 9 | ) 10 | } 11 | end 12 | 13 | context 'with specified parameters' do 14 | let :params do 15 | { 16 | :backend_url => 'etcd3+http://127.0.0.1:2379', 17 | } 18 | end 19 | 20 | it { 21 | is_expected.to contain_oslo__coordination('mistral_config').with( 22 | :backend_url => 'etcd3+http://127.0.0.1:2379' 23 | ) 24 | } 25 | end 26 | end 27 | 28 | on_supported_os({ 29 | :supported_os => OSDefaults.get_supported_os 30 | }).each do |os,facts| 31 | context "on #{os}" do 32 | let (:facts) do 33 | facts.merge(OSDefaults.get_facts()) 34 | end 35 | 36 | it_behaves_like 'mistral::coordination' 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /spec/classes/mistral_cors_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::cors' do 4 | 5 | shared_examples_for 'mistral::cors' do 6 | it 'configure cors default params' do 7 | is_expected.to contain_oslo__cors('mistral_config').with( 8 | :allowed_origin => '', 9 | :allow_credentials => '', 10 | :expose_headers => '', 11 | :max_age => '', 12 | :allow_methods => '', 13 | :allow_headers => '', 14 | ) 15 | end 16 | 17 | context 'with specific parameters' do 18 | let :params do 19 | { :allowed_origin => '*', 20 | :allow_credentials => true, 21 | :expose_headers => 'Content-Language,Expires', 22 | :max_age => 3600, 23 | :allow_methods => 'GET,POST,PUT,DELETE,OPTIONS', 24 | :allow_headers => 'Content-Type,Cache-Control', 25 | } 26 | end 27 | 28 | it 'configure cors params' do 29 | is_expected.to contain_oslo__cors('mistral_config').with( 30 | :allowed_origin => '*', 31 | :allow_credentials => true, 32 | :expose_headers => 'Content-Language,Expires', 33 | :max_age => 3600, 34 | :allow_methods => 'GET,POST,PUT,DELETE,OPTIONS', 35 | :allow_headers => 'Content-Type,Cache-Control', 36 | ) 37 | end 38 | end 39 | end 40 | 41 | on_supported_os({ 42 | :supported_os => OSDefaults.get_supported_os 43 | }).each do |os,facts| 44 | context "on #{os}" do 45 | let (:facts) do 46 | facts.merge!(OSDefaults.get_facts()) 47 | end 48 | 49 | it_behaves_like 'mistral::cors' 50 | end 51 | end 52 | 53 | end 54 | -------------------------------------------------------------------------------- /spec/classes/mistral_cron_trigger_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::cron_trigger' do 4 | 5 | shared_examples_for 'mistral cron trigger' do 6 | it 'configure cron trigger default params' do 7 | is_expected.to contain_mistral_config('cron_trigger/enabled').with_value('') 8 | is_expected.to contain_mistral_config('cron_trigger/execution_interval').with_value('') 9 | end 10 | 11 | context 'with specific parameters' do 12 | let :params do 13 | { :enabled => true, 14 | :execution_interval => 60, 15 | } 16 | end 17 | 18 | it 'configure cron trigger params' do 19 | is_expected.to contain_mistral_config('cron_trigger/enabled').with_value(true) 20 | is_expected.to contain_mistral_config('cron_trigger/execution_interval').with_value(60) 21 | end 22 | end 23 | end 24 | 25 | on_supported_os({ 26 | :supported_os => OSDefaults.get_supported_os 27 | }).each do |os,facts| 28 | context "on #{os}" do 29 | let (:facts) do 30 | facts.merge!(OSDefaults.get_facts()) 31 | end 32 | 33 | it_configures 'mistral cron trigger' 34 | end 35 | end 36 | 37 | end 38 | -------------------------------------------------------------------------------- /spec/classes/mistral_db_mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::db::mysql' do 4 | let :pre_condition do 5 | "include mysql::server" 6 | end 7 | 8 | let :params do 9 | { 10 | :password => 'mistralpass', 11 | } 12 | end 13 | 14 | shared_examples 'mistral::db::mysql' do 15 | it { is_expected.to contain_class('mistral::deps') } 16 | 17 | context 'with only required params' do 18 | it { should contain_openstacklib__db__mysql('mistral').with( 19 | :user => 'mistral', 20 | :password => 'mistralpass', 21 | :dbname => 'mistral', 22 | :host => '127.0.0.1', 23 | :charset => 'utf8', 24 | :collate => 'utf8_general_ci', 25 | )} 26 | end 27 | 28 | context 'overriding allowed_hosts param to array' do 29 | before do 30 | params.merge!( :allowed_hosts => ['127.0.01', '%'] ) 31 | end 32 | 33 | it { should contain_openstacklib__db__mysql('mistral').with( 34 | :allowed_hosts => params[:allowed_hosts], 35 | )} 36 | end 37 | 38 | context 'overriding allowed_hosts param to string' do 39 | before do 40 | params.merge!( :allowed_hosts => '192.168.1.1' ) 41 | end 42 | 43 | it { should contain_openstacklib__db__mysql('mistral').with( 44 | :allowed_hosts => params[:allowed_hosts], 45 | )} 46 | end 47 | end 48 | 49 | on_supported_os({ 50 | :supported_os => OSDefaults.get_supported_os 51 | }).each do |os,facts| 52 | context "on #{os}" do 53 | let (:facts) do 54 | facts.merge!(OSDefaults.get_facts()) 55 | end 56 | 57 | it_behaves_like 'mistral::db::mysql' 58 | end 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /spec/classes/mistral_db_postgresql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::db::postgresql' do 4 | 5 | shared_examples_for 'mistral::db::postgresql' do 6 | let :req_params do 7 | { :password => 'mistralpass' } 8 | end 9 | 10 | let :pre_condition do 11 | 'include postgresql::server' 12 | end 13 | 14 | context 'with only required parameters' do 15 | let :params do 16 | req_params 17 | end 18 | 19 | it { is_expected.to contain_class('mistral::deps') } 20 | 21 | it { is_expected.to contain_openstacklib__db__postgresql('mistral').with( 22 | :user => 'mistral', 23 | :password => 'mistralpass', 24 | :dbname => 'mistral', 25 | :encoding => nil, 26 | :privileges => 'ALL', 27 | )} 28 | end 29 | 30 | end 31 | 32 | on_supported_os({ 33 | :supported_os => OSDefaults.get_supported_os 34 | }).each do |os,facts| 35 | context "on #{os}" do 36 | let (:facts) do 37 | facts.merge(OSDefaults.get_facts({ 38 | # puppet-postgresql requires the service_provider fact provided by 39 | # puppetlabs-postgresql. 40 | :service_provider => 'systemd' 41 | })) 42 | end 43 | 44 | it_configures 'mistral::db::postgresql' 45 | end 46 | end 47 | 48 | end 49 | -------------------------------------------------------------------------------- /spec/classes/mistral_db_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::db' do 4 | shared_examples 'mistral::db' do 5 | context 'with default parameters' do 6 | it { should contain_class('mistral::deps') } 7 | 8 | it { should contain_oslo__db('mistral_config').with( 9 | :db_max_retries => '', 10 | :connection => 'sqlite:////var/lib/mistral/mistral.sqlite', 11 | :connection_recycle_time => '', 12 | :max_pool_size => '', 13 | :max_retries => '', 14 | :retry_interval => '', 15 | :max_overflow => '', 16 | :pool_timeout => '', 17 | :mysql_enable_ndb => '', 18 | )} 19 | end 20 | 21 | context 'with specific parameters' do 22 | let :params do 23 | { 24 | :database_connection => 'mysql+pymysql://mistral:mistral@localhost/mistral', 25 | :database_connection_recycle_time => '3601', 26 | :database_max_pool_size => '11', 27 | :database_max_retries => '11', 28 | :database_retry_interval => '11', 29 | :database_db_max_retries => '-1', 30 | :database_max_overflow => '21', 31 | :database_pool_timeout => '21', 32 | :mysql_enable_ndb => true, 33 | } 34 | end 35 | 36 | it { should contain_class('mistral::deps') } 37 | 38 | it { should contain_oslo__db('mistral_config').with( 39 | :db_max_retries => '-1', 40 | :connection => 'mysql+pymysql://mistral:mistral@localhost/mistral', 41 | :connection_recycle_time => '3601', 42 | :max_pool_size => '11', 43 | :max_retries => '11', 44 | :retry_interval => '11', 45 | :max_overflow => '21', 46 | :pool_timeout => '21', 47 | :mysql_enable_ndb => true, 48 | )} 49 | end 50 | end 51 | 52 | on_supported_os({ 53 | :supported_os => OSDefaults.get_supported_os 54 | }).each do |os,facts| 55 | context "on #{os}" do 56 | let (:facts) do 57 | facts.merge!(OSDefaults.get_facts()) 58 | end 59 | 60 | it_behaves_like 'mistral::db' 61 | end 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /spec/classes/mistral_db_sync_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::db::sync' do 4 | 5 | shared_examples_for 'mistral-db-sync' do 6 | 7 | it { is_expected.to contain_class('mistral::deps') } 8 | 9 | it 'runs mistral-db-manage upgrade head' do 10 | 11 | is_expected.to contain_exec('mistral-db-sync').with( 12 | :command => 'mistral-db-manage upgrade head', 13 | :path => '/usr/bin', 14 | :user => 'mistral', 15 | :refreshonly => 'true', 16 | :try_sleep => 5, 17 | :tries => 10, 18 | :timeout => 300, 19 | :logoutput => 'on_failure', 20 | :subscribe => ['Anchor[mistral::install::end]', 21 | 'Anchor[mistral::config::end]', 22 | 'Anchor[mistral::dbsync::begin]'], 23 | :notify => 'Anchor[mistral::dbsync::end]', 24 | :tag => 'openstack-db', 25 | ) 26 | 27 | is_expected.to contain_exec('mistral-db-populate').with( 28 | :command => 'mistral-db-manage populate', 29 | :path => '/usr/bin', 30 | :user => 'mistral', 31 | :refreshonly => 'true', 32 | :timeout => 300, 33 | :logoutput => 'on_failure', 34 | :subscribe => ['Anchor[mistral::install::end]', 35 | 'Anchor[mistral::config::end]', 36 | 'Anchor[mistral::dbsync::begin]'], 37 | :notify => 'Anchor[mistral::dbsync::end]', 38 | :tag => 'openstack-db', 39 | ) 40 | 41 | end 42 | 43 | end 44 | 45 | on_supported_os({ 46 | :supported_os => OSDefaults.get_supported_os 47 | }).each do |os,facts| 48 | context "on #{os}" do 49 | let (:facts) do 50 | facts.merge(OSDefaults.get_facts()) 51 | end 52 | 53 | it_configures 'mistral-db-sync' 54 | end 55 | end 56 | 57 | end 58 | -------------------------------------------------------------------------------- /spec/classes/mistral_deps_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::deps' do 4 | shared_examples 'mistral::deps' do 5 | it { 6 | should contain_anchor('mistral::install::begin') 7 | should contain_anchor('mistral::install::end') 8 | should contain_anchor('mistral::config::begin') 9 | should contain_anchor('mistral::config::end') 10 | should contain_anchor('mistral::db::begin') 11 | should contain_anchor('mistral::db::end') 12 | should contain_anchor('mistral::dbsync::begin') 13 | should contain_anchor('mistral::dbsync::end') 14 | should contain_anchor('mistral::service::begin') 15 | should contain_anchor('mistral::service::end') 16 | } 17 | end 18 | 19 | on_supported_os({ 20 | :supported_os => OSDefaults.get_supported_os 21 | }).each do |os,facts| 22 | context "on #{os}" do 23 | let (:facts) do 24 | facts.merge!(OSDefaults.get_facts()) 25 | end 26 | 27 | it_behaves_like 'mistral::deps' 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /spec/classes/mistral_engine_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::engine' do 4 | let :params do 5 | {} 6 | end 7 | 8 | shared_examples 'mistral::engine' do 9 | context 'with defaults' do 10 | it { is_expected.to contain_class('mistral::params') } 11 | 12 | it 'configures mistral-engine parameters' do 13 | is_expected.to contain_mistral_config('engine/host')\ 14 | .with_value('') 15 | is_expected.to contain_mistral_config('engine/topic')\ 16 | .with_value('') 17 | is_expected.to contain_mistral_config('engine/version')\ 18 | .with_value('') 19 | is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb') 20 | .with_value('') 21 | is_expected.to contain_mistral_config('engine/execution_integrity_check_delay') 22 | .with_value('') 23 | is_expected.to contain_mistral_config('engine/execution_integrity_check_batch_size') 24 | .with_value('') 25 | is_expected.to contain_mistral_config('engine/action_definition_cache_time') 26 | .with_value('') 27 | is_expected.to contain_mistral_config('engine/start_subworkflows_via_rpc') 28 | .with_value('') 29 | end 30 | end 31 | 32 | context 'config params' do 33 | before do 34 | params.merge!({ 35 | :host => 'foo_host', 36 | :topic => 'foo_topic', 37 | :version => '1.0', 38 | :execution_field_size_limit_kb => 1024, 39 | :execution_integrity_check_delay => 20, 40 | :execution_integrity_check_batch_size => 5, 41 | :action_definition_cache_time => 60, 42 | :start_subworkflows_via_rpc => false, 43 | }) 44 | end 45 | 46 | it 'configures mistral-engine parameters' do 47 | is_expected.to contain_mistral_config('engine/host')\ 48 | .with_value(params[:host]) 49 | is_expected.to contain_mistral_config('engine/topic')\ 50 | .with_value(params[:topic]) 51 | is_expected.to contain_mistral_config('engine/version')\ 52 | .with_value(params[:version]) 53 | is_expected.to contain_mistral_config('engine/execution_field_size_limit_kb') 54 | .with_value(params[:execution_field_size_limit_kb]) 55 | is_expected.to contain_mistral_config('engine/execution_integrity_check_delay') 56 | .with_value(params[:execution_integrity_check_delay]) 57 | is_expected.to contain_mistral_config('engine/execution_integrity_check_batch_size') 58 | .with_value(params[:execution_integrity_check_batch_size]) 59 | is_expected.to contain_mistral_config('engine/action_definition_cache_time') 60 | .with_value(params[:action_definition_cache_time]) 61 | is_expected.to contain_mistral_config('engine/start_subworkflows_via_rpc') 62 | .with_value(params[:start_subworkflows_via_rpc]) 63 | end 64 | end 65 | 66 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 67 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 68 | before do 69 | params.merge!(param_hash) 70 | end 71 | 72 | it 'configures mistral-engine service' do 73 | is_expected.to contain_service('mistral-engine').with( 74 | :ensure => params[:enabled] ? 'running' : 'stopped', 75 | :name => platform_params[:engine_service_name], 76 | :enable => params[:enabled], 77 | :hasstatus => true, 78 | :hasrestart => true, 79 | :tag => 'mistral-service', 80 | ) 81 | is_expected.to contain_service('mistral-engine').that_subscribes_to(nil) 82 | end 83 | end 84 | end 85 | 86 | context 'with disabled service managing' do 87 | before do 88 | params.merge!({ 89 | :manage_service => false 90 | }) 91 | end 92 | 93 | it 'does not configure mistral-engine service' do 94 | is_expected.to_not contain_service('mistral-engine') 95 | end 96 | end 97 | end 98 | 99 | on_supported_os({ 100 | :supported_os => OSDefaults.get_supported_os 101 | }).each do |os,facts| 102 | context "on #{os}" do 103 | let (:facts) do 104 | facts.merge!(OSDefaults.get_facts()) 105 | end 106 | 107 | let (:platform_params) do 108 | case facts[:os]['family'] 109 | when 'Debian' 110 | { :engine_service_name => 'mistral-engine' } 111 | when 'RedHat' 112 | { :engine_service_name => 'openstack-mistral-engine' } 113 | end 114 | end 115 | 116 | it_behaves_like 'mistral::engine' 117 | end 118 | end 119 | end 120 | -------------------------------------------------------------------------------- /spec/classes/mistral_event_engine_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::event_engine' do 4 | 5 | let :params do 6 | { :enabled => true, 7 | :manage_service => true, 8 | :host => 'foo_host', 9 | :topic => 'foo_topic', 10 | :event_definitions_cfg_file => 'foo_cfg_file'} 11 | end 12 | 13 | shared_examples_for 'mistral-event-engine' do 14 | 15 | context 'config params' do 16 | 17 | it { is_expected.to contain_class('mistral::params') } 18 | 19 | it { is_expected.to contain_mistral_config('event_engine/host').with_value( params[:host] ) } 20 | it { is_expected.to contain_mistral_config('event_engine/topic').with_value( params[:topic] ) } 21 | it { is_expected.to contain_mistral_config('event_engine/event_definitions_cfg_file').with_value( params[:event_definitions_cfg_file] ) } 22 | 23 | end 24 | 25 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 26 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 27 | before do 28 | params.merge!(param_hash) 29 | end 30 | 31 | it 'configures mistral-event-engine service' do 32 | 33 | is_expected.to contain_service('mistral-event-engine').with( 34 | :ensure => params[:enabled] ? 'running' : 'stopped', 35 | :name => platform_params[:event_engine_service_name], 36 | :enable => params[:enabled], 37 | :hasstatus => true, 38 | :hasrestart => true, 39 | :tag => 'mistral-service', 40 | ) 41 | is_expected.to contain_service('mistral-event-engine').that_subscribes_to(nil) 42 | end 43 | end 44 | end 45 | 46 | context 'with disabled service managing' do 47 | before do 48 | params.merge!({ 49 | :manage_service => false 50 | }) 51 | end 52 | 53 | it 'does not configure mistral-event-engine service' do 54 | is_expected.to_not contain_service('mistral-event-engine') 55 | end 56 | end 57 | 58 | end 59 | 60 | on_supported_os({ 61 | :supported_os => OSDefaults.get_supported_os 62 | }).each do |os,facts| 63 | context "on #{os}" do 64 | let (:facts) do 65 | facts.merge!(OSDefaults.get_facts()) 66 | end 67 | 68 | let(:platform_params) do 69 | case facts[:os]['family'] 70 | when 'Debian' 71 | { :event_engine_service_name => 'mistral-event-engine' } 72 | when 'RedHat' 73 | { :event_engine_service_name => 'openstack-mistral-event-engine' } 74 | end 75 | end 76 | 77 | it_configures 'mistral-event-engine' 78 | end 79 | end 80 | 81 | end 82 | -------------------------------------------------------------------------------- /spec/classes/mistral_execution_expiration_policy_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::execution_expiration_policy' do 4 | 5 | shared_examples_for 'mistral::execution_expiration_policy' do 6 | context 'with defaults' do 7 | it 'configures execution_expiration_policy parameters' do 8 | is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval')\ 9 | .with_value('') 10 | is_expected.to contain_mistral_config('execution_expiration_policy/older_than')\ 11 | .with_value('') 12 | is_expected.to contain_mistral_config('execution_expiration_policy/max_finished_executions')\ 13 | .with_value('') 14 | is_expected.to contain_mistral_config('execution_expiration_policy/batch_size')\ 15 | .with_value('') 16 | is_expected.to contain_mistral_config('execution_expiration_policy/ignored_states')\ 17 | .with_value('') 18 | end 19 | end 20 | 21 | context 'with specific parameters' do 22 | let :params do 23 | { 24 | :evaluation_interval => 120, 25 | :older_than => 1, 26 | :max_finished_executions => 0, 27 | :batch_size => 10, 28 | :ignored_states => ['SUCCESS', 'ERROR', 'CANCELLED'] 29 | } 30 | end 31 | 32 | it 'configures execution_expiration_policy parameters' do 33 | is_expected.to contain_mistral_config('execution_expiration_policy/evaluation_interval')\ 34 | .with_value(120) 35 | is_expected.to contain_mistral_config('execution_expiration_policy/older_than')\ 36 | .with_value(1) 37 | is_expected.to contain_mistral_config('execution_expiration_policy/max_finished_executions')\ 38 | .with_value(0) 39 | is_expected.to contain_mistral_config('execution_expiration_policy/batch_size')\ 40 | .with_value(10) 41 | is_expected.to contain_mistral_config('execution_expiration_policy/ignored_states')\ 42 | .with_value('SUCCESS,ERROR,CANCELLED') 43 | end 44 | end 45 | end 46 | 47 | on_supported_os({ 48 | :supported_os => OSDefaults.get_supported_os 49 | }).each do |os,facts| 50 | context "on #{os}" do 51 | let (:facts) do 52 | facts.merge!(OSDefaults.get_facts()) 53 | end 54 | 55 | it_configures 'mistral::execution_expiration_policy' 56 | end 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /spec/classes/mistral_executor_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::executor' do 4 | let :params do 5 | { 6 | :enabled => true, 7 | :manage_service => true, 8 | :host => true, 9 | :topic => true, 10 | :version => true 11 | } 12 | end 13 | 14 | shared_examples 'mistral::executor' do 15 | context 'config params' do 16 | it { is_expected.to contain_class('mistral::params') } 17 | 18 | it { is_expected.to contain_mistral_config('executor/host').with_value( params[:host] ) } 19 | it { is_expected.to contain_mistral_config('executor/topic').with_value( params[:topic] ) } 20 | it { is_expected.to contain_mistral_config('executor/version').with_value( params[:version] ) } 21 | end 22 | 23 | [{:enabled => true}, {:enabled => false}].each do |param_hash| 24 | context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do 25 | before do 26 | params.merge!(param_hash) 27 | end 28 | 29 | it 'configures mistral-executor service' do 30 | 31 | is_expected.to contain_service('mistral-executor').with( 32 | :ensure => params[:enabled] ? 'running' : 'stopped', 33 | :name => platform_params[:executor_service_name], 34 | :enable => params[:enabled], 35 | :hasstatus => true, 36 | :hasrestart => true, 37 | :tag => 'mistral-service', 38 | ) 39 | is_expected.to contain_service('mistral-executor').that_subscribes_to(nil) 40 | end 41 | end 42 | end 43 | 44 | context 'with disabled service managing' do 45 | before do 46 | params.merge!({ 47 | :manage_service => false 48 | }) 49 | end 50 | 51 | it 'does not configure mistral-executor service' do 52 | is_expected.to_not contain_service('mistral-executor') 53 | end 54 | end 55 | end 56 | 57 | on_supported_os({ 58 | :supported_os => OSDefaults.get_supported_os 59 | }).each do |os,facts| 60 | context "on #{os}" do 61 | let (:facts) do 62 | facts.merge!(OSDefaults.get_facts()) 63 | end 64 | 65 | let (:platform_params) do 66 | case facts[:os]['family'] 67 | when 'Debian' 68 | { :executor_service_name => 'mistral-executor' } 69 | when 'RedHat' 70 | { :executor_service_name => 'openstack-mistral-executor' } 71 | end 72 | end 73 | 74 | it_behaves_like 'mistral::executor' 75 | end 76 | end 77 | end 78 | -------------------------------------------------------------------------------- /spec/classes/mistral_healthcheck_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::healthcheck' do 4 | 5 | shared_examples_for 'mistral::healthcheck' do 6 | 7 | context 'with default parameters' do 8 | let :params do 9 | {} 10 | end 11 | 12 | it 'configures default values' do 13 | is_expected.to contain_mistral_config('healthcheck/enabled').with_value('') 14 | 15 | is_expected.to contain_oslo__healthcheck('mistral_config').with( 16 | :detailed => '', 17 | :backends => '', 18 | :allowed_source_ranges => '', 19 | :ignore_proxied_requests => '', 20 | :disable_by_file_path => '', 21 | :disable_by_file_paths => '', 22 | :enable_by_file_paths => '', 23 | ) 24 | end 25 | end 26 | 27 | context 'with specific parameters' do 28 | let :params do 29 | { 30 | :enabled => true, 31 | :detailed => true, 32 | :backends => ['disable_by_file'], 33 | :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], 34 | :ignore_proxied_requests => false, 35 | :disable_by_file_path => '/etc/mistral/healthcheck/disabled', 36 | :disable_by_file_paths => ['8989:/etc/mistral/healthcheck/disabled'], 37 | :enable_by_file_paths => ['/etc/mistral/healthcheck/enabled'], 38 | } 39 | end 40 | 41 | it 'configures specified values' do 42 | is_expected.to contain_mistral_config('healthcheck/enabled').with_value(true) 43 | 44 | is_expected.to contain_oslo__healthcheck('mistral_config').with( 45 | :detailed => true, 46 | :backends => ['disable_by_file'], 47 | :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], 48 | :ignore_proxied_requests => false, 49 | :disable_by_file_path => '/etc/mistral/healthcheck/disabled', 50 | :disable_by_file_paths => ['8989:/etc/mistral/healthcheck/disabled'], 51 | :enable_by_file_paths => ['/etc/mistral/healthcheck/enabled'], 52 | ) 53 | end 54 | end 55 | end 56 | 57 | on_supported_os({ 58 | :supported_os => OSDefaults.get_supported_os 59 | }).each do |os,facts| 60 | context "on #{os}" do 61 | let (:facts) do 62 | facts.merge!(OSDefaults.get_facts()) 63 | end 64 | 65 | it_configures 'mistral::healthcheck' 66 | end 67 | end 68 | 69 | end 70 | -------------------------------------------------------------------------------- /spec/classes/mistral_init_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral' do 4 | let :req_params do 5 | { 6 | :purge_config => false, 7 | } 8 | end 9 | 10 | shared_examples 'mistral' do 11 | context 'with only required params' do 12 | let :params do 13 | req_params 14 | end 15 | 16 | it { is_expected.to contain_class('mistral::params') } 17 | 18 | it 'passes purge to resource' do 19 | is_expected.to contain_resources('mistral_config').with({ 20 | :purge => false 21 | }) 22 | end 23 | 24 | it 'should contain default config' do 25 | is_expected.to contain_mistral_config('DEFAULT/report_interval').with(:value => '') 26 | is_expected.to contain_mistral_config('DEFAULT/service_down_time').with(:value => '') 27 | is_expected.to contain_mistral_config('action_heartbeat/max_missed_heartbeats').with(:value => '') 28 | is_expected.to contain_mistral_config('action_heartbeat/check_interval').with(:value => '') 29 | is_expected.to contain_mistral_config('action_heartbeat/first_heartbeat_timeout').with(:value => '') 30 | is_expected.to contain_oslo__messaging__default('mistral_config').with( 31 | :transport_url => '', 32 | :rpc_response_timeout => '', 33 | :control_exchange => '' 34 | ) 35 | is_expected.to contain_oslo__messaging__notifications('mistral_config').with( 36 | :transport_url => '', 37 | :driver => '', 38 | :topics => '' 39 | ) 40 | is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 41 | :rabbit_use_ssl => '', 42 | :heartbeat_timeout_threshold => '', 43 | :heartbeat_rate => '', 44 | :heartbeat_in_pthread => nil, 45 | :rabbit_qos_prefetch_count => '', 46 | :kombu_reconnect_delay => '', 47 | :kombu_failover_strategy => '', 48 | :amqp_durable_queues => '', 49 | :amqp_auto_delete => '', 50 | :kombu_ssl_ca_certs => '', 51 | :kombu_ssl_certfile => '', 52 | :kombu_ssl_keyfile => '', 53 | :kombu_ssl_version => '', 54 | :rabbit_ha_queues => '', 55 | :rabbit_quorum_queue => '', 56 | :rabbit_transient_quorum_queue => '', 57 | :rabbit_transient_queues_ttl => '', 58 | :rabbit_quorum_delivery_limit => '', 59 | :rabbit_quorum_max_memory_length => '', 60 | :rabbit_quorum_max_memory_bytes => '', 61 | :enable_cancel_on_failover => '', 62 | ) 63 | is_expected.to contain_mistral_config('openstack_actions/os_actions_endpoint_type').with( 64 | :value => '' 65 | ) 66 | end 67 | end 68 | 69 | context 'with enable ha queues' do 70 | let :params do 71 | req_params.merge({'rabbit_ha_queues' => true}) 72 | end 73 | 74 | it 'should contain rabbit_ha_queues' do 75 | is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 76 | :rabbit_ha_queues => true 77 | ) 78 | end 79 | end 80 | 81 | context 'with rabbit default transport url configured' do 82 | let :params do 83 | req_params.merge({'default_transport_url' => 'rabbit://user:pass@host:1234/virt' }) 84 | end 85 | 86 | it 'should contain transport_url' do 87 | is_expected.to contain_oslo__messaging__default('mistral_config').with( 88 | :transport_url => 'rabbit://user:pass@host:1234/virt', 89 | ) 90 | end 91 | end 92 | 93 | context 'with rabbit notification transport url configured' do 94 | let :params do 95 | req_params.merge({ 96 | :notification_transport_url => 'rabbit://user:pass@host:1234/virt', 97 | :notification_topics => 'openstack', 98 | :notification_driver => 'messagingv1', 99 | }) 100 | end 101 | 102 | it 'should contain transport_url' do 103 | is_expected.to contain_oslo__messaging__notifications('mistral_config').with( 104 | :transport_url => 'rabbit://user:pass@host:1234/virt', 105 | :driver => 'messagingv1', 106 | :topics => 'openstack', 107 | ) 108 | end 109 | end 110 | 111 | context 'with rabbitmq heartbeats' do 112 | let :params do 113 | req_params.merge({ 114 | :rabbit_heartbeat_timeout_threshold => '60', 115 | :rabbit_heartbeat_rate => '10', 116 | :rabbit_heartbeat_in_pthread => true 117 | }) 118 | end 119 | 120 | it 'should contain heartbeat config' do 121 | is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 122 | :heartbeat_timeout_threshold => '60', 123 | :heartbeat_rate => '10', 124 | :heartbeat_in_pthread => true, 125 | ) 126 | end 127 | end 128 | 129 | context 'with SSL enabled with kombu' do 130 | let :params do 131 | req_params.merge!({ 132 | :rabbit_use_ssl => true, 133 | :kombu_ssl_ca_certs => '/path/to/ssl/ca/certs', 134 | :kombu_ssl_certfile => '/path/to/ssl/cert/file', 135 | :kombu_ssl_keyfile => '/path/to/ssl/keyfile', 136 | :kombu_ssl_version => 'TLSv1' 137 | }) 138 | end 139 | 140 | it { is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 141 | :rabbit_use_ssl => true, 142 | :kombu_ssl_ca_certs => '/path/to/ssl/ca/certs', 143 | :kombu_ssl_certfile => '/path/to/ssl/cert/file', 144 | :kombu_ssl_keyfile => '/path/to/ssl/keyfile', 145 | :kombu_ssl_version => 'TLSv1' 146 | )} 147 | end 148 | 149 | context 'with SSL enabled without kombu' do 150 | let :params do 151 | req_params.merge!({ 152 | :rabbit_use_ssl => true, 153 | }) 154 | end 155 | 156 | it { is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 157 | :rabbit_use_ssl => true, 158 | )} 159 | end 160 | 161 | context 'with SSL disabled' do 162 | let :params do 163 | req_params.merge!({ 164 | :rabbit_use_ssl => false, 165 | }) 166 | end 167 | 168 | it { is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 169 | :rabbit_use_ssl => false, 170 | )} 171 | end 172 | 173 | context 'with amqp_durable_queues enabled' do 174 | let :params do 175 | req_params.merge({ 176 | :amqp_durable_queues => true, 177 | }) 178 | end 179 | it { is_expected.to contain_oslo__messaging__rabbit('mistral_config').with( 180 | :amqp_durable_queues => true 181 | )} 182 | end 183 | 184 | context 'with os_actions_keystone_endpoint overridden' do 185 | let :params do 186 | req_params.merge({ 187 | :os_actions_endpoint_type => 'internal', 188 | }) 189 | end 190 | 191 | it { is_expected.to contain_mistral_config('openstack_actions/os_actions_endpoint_type').with_value('internal') } 192 | end 193 | 194 | context 'with heartbeats parameters overridden' do 195 | let :params do 196 | req_params.merge({ 197 | :max_missed_heartbeats => '30', 198 | :check_interval => '40', 199 | :first_heartbeat_timeout => '7200', 200 | }) 201 | end 202 | 203 | it { is_expected.to contain_mistral_config('action_heartbeat/max_missed_heartbeats').with_value('30') } 204 | it { is_expected.to contain_mistral_config('action_heartbeat/check_interval').with_value('40') } 205 | it { is_expected.to contain_mistral_config('action_heartbeat/first_heartbeat_timeout').with_value('7200') } 206 | end 207 | end 208 | 209 | on_supported_os({ 210 | :supported_os => OSDefaults.get_supported_os 211 | }).each do |os,facts| 212 | context "on #{os}" do 213 | let (:facts) do 214 | facts.merge!(OSDefaults.get_facts()) 215 | end 216 | 217 | it_behaves_like 'mistral' 218 | end 219 | end 220 | end 221 | -------------------------------------------------------------------------------- /spec/classes/mistral_keystone_auth_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Unit tests for mistral::keystone::auth 3 | # 4 | 5 | require 'spec_helper' 6 | 7 | describe 'mistral::keystone::auth' do 8 | shared_examples_for 'mistral::keystone::auth' do 9 | context 'with default class parameters' do 10 | let :params do 11 | { :password => 'mistral_password' } 12 | end 13 | 14 | it { is_expected.to contain_keystone__resource__service_identity('mistral').with( 15 | :configure_user => true, 16 | :configure_user_role => true, 17 | :configure_endpoint => true, 18 | :configure_service => true, 19 | :service_name => 'mistral', 20 | :service_type => 'workflowv2', 21 | :service_description => 'OpenStack Workflow Service', 22 | :region => 'RegionOne', 23 | :auth_name => 'mistral', 24 | :password => 'mistral_password', 25 | :email => 'mistral@localhost', 26 | :tenant => 'services', 27 | :roles => ['admin'], 28 | :system_scope => 'all', 29 | :system_roles => [], 30 | :public_url => 'http://127.0.0.1:8989/v2', 31 | :internal_url => 'http://127.0.0.1:8989/v2', 32 | :admin_url => 'http://127.0.0.1:8989/v2', 33 | ) } 34 | end 35 | 36 | context 'when overriding parameters' do 37 | let :params do 38 | { :password => 'mistral_password', 39 | :auth_name => 'alt_mistral', 40 | :email => 'alt_mistral@alt_localhost', 41 | :tenant => 'alt_service', 42 | :roles => ['admin', 'service'], 43 | :system_scope => 'alt_all', 44 | :system_roles => ['admin', 'member', 'reader'], 45 | :configure_endpoint => false, 46 | :configure_user => false, 47 | :configure_user_role => false, 48 | :configure_service => false, 49 | :service_description => 'Alternative OpenStack Workflow Service', 50 | :service_name => 'alt_service', 51 | :service_type => 'alt_workflowv2', 52 | :region => 'RegionTwo', 53 | :public_url => 'https://10.10.10.10:80', 54 | :internal_url => 'http://10.10.10.11:81', 55 | :admin_url => 'http://10.10.10.12:81' } 56 | end 57 | 58 | it { is_expected.to contain_keystone__resource__service_identity('mistral').with( 59 | :configure_user => false, 60 | :configure_user_role => false, 61 | :configure_endpoint => false, 62 | :configure_service => false, 63 | :service_name => 'alt_service', 64 | :service_type => 'alt_workflowv2', 65 | :service_description => 'Alternative OpenStack Workflow Service', 66 | :region => 'RegionTwo', 67 | :auth_name => 'alt_mistral', 68 | :password => 'mistral_password', 69 | :email => 'alt_mistral@alt_localhost', 70 | :tenant => 'alt_service', 71 | :roles => ['admin', 'service'], 72 | :system_scope => 'alt_all', 73 | :system_roles => ['admin', 'member', 'reader'], 74 | :public_url => 'https://10.10.10.10:80', 75 | :internal_url => 'http://10.10.10.11:81', 76 | :admin_url => 'http://10.10.10.12:81', 77 | ) } 78 | end 79 | end 80 | 81 | on_supported_os({ 82 | :supported_os => OSDefaults.get_supported_os 83 | }).each do |os,facts| 84 | context "on #{os}" do 85 | let (:facts) do 86 | facts.merge!(OSDefaults.get_facts()) 87 | end 88 | 89 | it_behaves_like 'mistral::keystone::auth' 90 | end 91 | end 92 | end 93 | -------------------------------------------------------------------------------- /spec/classes/mistral_keystone_authtoken_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::keystone::authtoken' do 4 | 5 | let :params do 6 | { :password => 'mistral_password', } 7 | end 8 | 9 | shared_examples 'mistral::keystone::authtoken' do 10 | 11 | context 'with default parameters' do 12 | 13 | it 'configure keystone_authtoken' do 14 | contain_keystone__resources__authtoken('mistral_config').with( 15 | :username => 'mistral', 16 | :password => 'mistral_password', 17 | :auth_url => 'http://localhost:5000', 18 | :project_name => 'services', 19 | :user_domain_name => 'Default', 20 | :project_domain_name => 'Default', 21 | :system_scope => '', 22 | :insecure => '', 23 | :auth_section => '', 24 | :auth_type => 'password', 25 | :www_authenticate_uri => 'http://localhost:5000', 26 | :auth_version => '', 27 | :cache => '', 28 | :cafile => '', 29 | :certfile => '', 30 | :delay_auth_decision => '', 31 | :enforce_token_bind => '', 32 | :http_connect_timeout => '', 33 | :http_request_max_retries => '', 34 | :include_service_catalog => '', 35 | :keyfile => '', 36 | :memcache_pool_conn_get_timeout => '', 37 | :memcache_pool_dead_retry => '', 38 | :memcache_pool_maxsize => '', 39 | :memcache_pool_socket_timeout => '', 40 | :memcache_pool_unused_timeout => '', 41 | :memcache_secret_key => '', 42 | :memcache_security_strategy => '', 43 | :memcache_use_advanced_pool => '', 44 | :memcached_servers => '', 45 | :manage_memcache_package => false, 46 | :region_name => '', 47 | :token_cache_time => '', 48 | :service_token_roles => '', 49 | :service_token_roles_required => '', 50 | :service_type => '', 51 | :interface => '', 52 | ) 53 | end 54 | end 55 | 56 | context 'when overriding parameters' do 57 | before do 58 | params.merge!({ 59 | :www_authenticate_uri => 'https://10.0.0.1:9999/', 60 | :username => 'myuser', 61 | :password => 'mypasswd', 62 | :auth_url => 'http://127.0.0.1:5000', 63 | :project_name => 'service_project', 64 | :user_domain_name => 'domainX', 65 | :project_domain_name => 'domainX', 66 | :system_scope => 'all', 67 | :insecure => false, 68 | :auth_section => 'new_section', 69 | :auth_type => 'password', 70 | :auth_version => 'v3', 71 | :cache => 'somevalue', 72 | :cafile => '/opt/stack/data/cafile.pem', 73 | :certfile => 'certfile.crt', 74 | :delay_auth_decision => false, 75 | :enforce_token_bind => 'permissive', 76 | :http_connect_timeout => '300', 77 | :http_request_max_retries => '3', 78 | :include_service_catalog => true, 79 | :keyfile => 'keyfile', 80 | :memcache_pool_conn_get_timeout => '9', 81 | :memcache_pool_dead_retry => '302', 82 | :memcache_pool_maxsize => '11', 83 | :memcache_pool_socket_timeout => '2', 84 | :memcache_pool_unused_timeout => '61', 85 | :memcache_secret_key => 'secret_key', 86 | :memcache_security_strategy => 'ENCRYPT', 87 | :memcache_use_advanced_pool => true, 88 | :memcached_servers => ['memcached01:11211','memcached02:11211'], 89 | :manage_memcache_package => true, 90 | :region_name => 'region2', 91 | :token_cache_time => '301', 92 | :service_token_roles => ['service'], 93 | :service_token_roles_required => false, 94 | :service_type => 'identity', 95 | :interface => 'internal', 96 | }) 97 | end 98 | 99 | it 'configure keystone_authtoken' do 100 | contain_keystone__resources__authtoken('mistral_config').with( 101 | :www_authenticate_uri => 'https://10.0.0.1:9999/', 102 | :username => 'myuser', 103 | :password => 'mypasswd', 104 | :auth_url => 'http://127.0.0.1:5000', 105 | :project_name => 'service_project', 106 | :user_domain_name => 'domainX', 107 | :project_domain_name => 'domainX', 108 | :system_scope => 'all', 109 | :insecure => false, 110 | :auth_section => 'new_section', 111 | :auth_type => 'password', 112 | :auth_version => 'v3', 113 | :cache => 'somevalue', 114 | :cafile => '/opt/stack/data/cafile.pem', 115 | :certfile => 'certfile.crt', 116 | :delay_auth_decision => false, 117 | :enforce_token_bind => 'permissive', 118 | :http_connect_timeout => '300', 119 | :http_request_max_retries => '3', 120 | :include_service_catalog => true, 121 | :keyfile => 'keyfile', 122 | :memcache_pool_conn_get_timeout => '9', 123 | :memcache_pool_dead_retry => '302', 124 | :memcache_pool_maxsize => '11', 125 | :memcache_pool_socket_timeout => '2', 126 | :memcache_pool_unused_timeout => '61', 127 | :memcache_secret_key => 'secret_key', 128 | :memcache_security_strategy => 'ENCRYPT', 129 | :memcache_use_advanced_pool => true, 130 | :memcached_servers => ['memcached01:11211','memcached02:11211'], 131 | :manage_memcache_package => true, 132 | :region_name => 'region2', 133 | :token_cache_time => '301', 134 | :service_token_roles => ['service'], 135 | :service_token_roles_required => false, 136 | :service_type => 'identity', 137 | :interface => 'internal', 138 | ) 139 | end 140 | end 141 | 142 | context 'when overriding parameters via params hash' do 143 | before do 144 | params.merge!({ 145 | :username => 'myuser', 146 | :params => { 'username' => 'myotheruser' }, 147 | }) 148 | end 149 | 150 | it 'configure keystone_authtoken' do 151 | contain_keystone__resources__authtoken('mistral_config').with( 152 | :username => 'myotheruser', 153 | ) 154 | end 155 | end 156 | end 157 | 158 | on_supported_os({ 159 | :supported_os => OSDefaults.get_supported_os 160 | }).each do |os,facts| 161 | context "on #{os}" do 162 | let (:facts) do 163 | facts.merge!(OSDefaults.get_facts()) 164 | end 165 | 166 | it_configures 'mistral::keystone::authtoken' 167 | end 168 | end 169 | 170 | end 171 | -------------------------------------------------------------------------------- /spec/classes/mistral_legacy_action_providers_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::legacy_action_providers' do 4 | let :params do 5 | {} 6 | end 7 | 8 | shared_examples 'mistral::legacy_action_providers' do 9 | context 'with defaults' do 10 | it { 11 | is_expected.to contain_mistral_config('legacy_action_providers/load_action_plugins').with_value('') 12 | is_expected.to contain_mistral_config('legacy_action_providers/load_action_generators').with_value('') 13 | is_expected.to contain_mistral_config('legacy_action_providers/only_builtin_actions').with_value('') 14 | is_expected.to contain_mistral_config('legacy_action_providers/allowlist').with_value('') 15 | is_expected.to contain_mistral_config('legacy_action_providers/denylist').with_value('') 16 | } 17 | end 18 | 19 | context 'with parameters' do 20 | before do 21 | params.merge!({ 22 | :load_action_plugins => true, 23 | :load_action_generators => false, 24 | :only_builtin_actions => true, 25 | :allowlist => ['allow0', 'allow1'], 26 | :denylist => ['deny0', 'deny1'], 27 | }) 28 | end 29 | 30 | it { 31 | is_expected.to contain_mistral_config('legacy_action_providers/load_action_plugins').with_value(true) 32 | is_expected.to contain_mistral_config('legacy_action_providers/load_action_generators').with_value(false) 33 | is_expected.to contain_mistral_config('legacy_action_providers/only_builtin_actions').with_value(true) 34 | is_expected.to contain_mistral_config('legacy_action_providers/allowlist').with_value('allow0,allow1') 35 | is_expected.to contain_mistral_config('legacy_action_providers/denylist').with_value('deny0,deny1') 36 | } 37 | end 38 | end 39 | 40 | on_supported_os({ 41 | :supported_os => OSDefaults.get_supported_os 42 | }).each do |os,facts| 43 | context "on #{os}" do 44 | let (:facts) do 45 | facts.merge!(OSDefaults.get_facts()) 46 | end 47 | 48 | it_behaves_like 'mistral::legacy_action_providers' 49 | end 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /spec/classes/mistral_logging_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::logging' do 4 | 5 | let :params do 6 | { 7 | } 8 | end 9 | 10 | let :log_params do 11 | { 12 | :logging_context_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s', 13 | :logging_default_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s', 14 | :logging_debug_format_suffix => '%(funcName)s %(pathname)s:%(lineno)d', 15 | :logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s', 16 | :log_config_append => '/etc/mistral/logging.conf', 17 | :publish_errors => true, 18 | :default_log_levels => { 19 | 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN', 20 | 'sqlalchemy' => 'WARN', 'suds' => 'INFO', 'iso8601' => 'WARN', 21 | 'requests.packages.urllib3.connectionpool' => 'WARN' }, 22 | :fatal_deprecations => true, 23 | :instance_format => '[instance: %(uuid)s] ', 24 | :instance_uuid_format => '[instance: %(uuid)s] ', 25 | :log_date_format => '%Y-%m-%d %H:%M:%S', 26 | :use_syslog => true, 27 | :use_json => true, 28 | :use_journal => true, 29 | :use_stderr => false, 30 | :log_facility => 'LOG_FOO', 31 | :log_dir => '/var/log', 32 | :log_file => '/var/log/mistral/mistral.log', 33 | :debug => true, 34 | } 35 | end 36 | 37 | shared_examples_for 'mistral-logging' do 38 | 39 | context 'with basic logging options and default settings' do 40 | it_configures 'basic default logging settings' 41 | end 42 | 43 | context 'with basic logging options and non-default settings' do 44 | before { params.merge!( log_params ) } 45 | it_configures 'basic non-default logging settings' 46 | end 47 | 48 | context 'with extended logging options' do 49 | before { params.merge!( log_params ) } 50 | it_configures 'logging params set' 51 | end 52 | 53 | context 'without extended logging options' do 54 | it_configures 'logging params unset' 55 | end 56 | 57 | end 58 | 59 | shared_examples 'basic default logging settings' do 60 | it 'configures mistral logging settings with default values' do 61 | is_expected.to contain_oslo__log('mistral_config').with( 62 | :use_syslog => '', 63 | :use_json => '', 64 | :use_journal => '', 65 | :use_stderr => '', 66 | :syslog_log_facility => '', 67 | :log_dir => '/var/log/mistral', 68 | :log_file => '', 69 | :debug => '', 70 | ) 71 | end 72 | end 73 | 74 | shared_examples 'basic non-default logging settings' do 75 | it 'configures mistral logging settings with non-default values' do 76 | is_expected.to contain_oslo__log('mistral_config').with( 77 | :use_syslog => true, 78 | :use_json => true, 79 | :use_journal => true, 80 | :use_stderr => false, 81 | :syslog_log_facility => 'LOG_FOO', 82 | :log_dir => '/var/log', 83 | :log_file => '/var/log/mistral/mistral.log', 84 | :debug => true, 85 | ) 86 | end 87 | end 88 | 89 | shared_examples_for 'logging params set' do 90 | it 'enables logging params' do 91 | is_expected.to contain_oslo__log('mistral_config').with( 92 | :logging_context_format_string => 93 | '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s', 94 | :logging_default_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s', 95 | :logging_debug_format_suffix => '%(funcName)s %(pathname)s:%(lineno)d', 96 | :logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s', 97 | :log_config_append => '/etc/mistral/logging.conf', 98 | :publish_errors => true, 99 | :default_log_levels => { 100 | 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN', 101 | 'sqlalchemy' => 'WARN', 'suds' => 'INFO', 'iso8601' => 'WARN', 102 | 'requests.packages.urllib3.connectionpool' => 'WARN' }, 103 | :fatal_deprecations => true, 104 | :instance_format => '[instance: %(uuid)s] ', 105 | :instance_uuid_format => '[instance: %(uuid)s] ', 106 | :log_date_format => '%Y-%m-%d %H:%M:%S', 107 | ) 108 | end 109 | end 110 | 111 | shared_examples_for 'logging params unset' do 112 | [ :logging_context_format_string, :logging_default_format_string, 113 | :logging_debug_format_suffix, :logging_exception_prefix, 114 | :log_config_append, :publish_errors, 115 | :default_log_levels, :fatal_deprecations, 116 | :instance_format, :instance_uuid_format, 117 | :log_date_format, ].each { |param| 118 | it { is_expected.to contain_oslo__log('mistral_config').with("#{param}" => '') } 119 | } 120 | end 121 | 122 | on_supported_os({ 123 | :supported_os => OSDefaults.get_supported_os 124 | }).each do |os,facts| 125 | context "on #{os}" do 126 | let (:facts) do 127 | facts.merge(OSDefaults.get_facts()) 128 | end 129 | 130 | it_configures 'mistral-logging' 131 | end 132 | end 133 | 134 | end 135 | -------------------------------------------------------------------------------- /spec/classes/mistral_notifier_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::notifier' do 4 | 5 | shared_examples_for 'mistral::notifier' do 6 | it 'configure notifier default params' do 7 | is_expected.to contain_mistral_config('notifier/type').with_value('') 8 | is_expected.to contain_mistral_config('notifier/host').with_value('') 9 | is_expected.to contain_mistral_config('notifier/topic').with_value('') 10 | is_expected.to contain_mistral_config('notifier/notify').with_value('') 11 | end 12 | 13 | context 'with specific parameters' do 14 | let :params do 15 | { :type => "remote", 16 | :host => "localhost", 17 | :topic => "mistral-event-stream", 18 | :notify_publishers => "[{'type': 'noop'}]", 19 | } 20 | end 21 | 22 | it 'configure notifier params' do 23 | is_expected.to contain_mistral_config('notifier/type').with_value('remote') 24 | is_expected.to contain_mistral_config('notifier/host').with_value('localhost') 25 | is_expected.to contain_mistral_config('notifier/topic').with_value('mistral-event-stream') 26 | is_expected.to contain_mistral_config('notifier/notify').with_value("[{'type': 'noop'}]") 27 | end 28 | end 29 | end 30 | 31 | on_supported_os({ 32 | :supported_os => OSDefaults.get_supported_os 33 | }).each do |os,facts| 34 | context "on #{os}" do 35 | let (:facts) do 36 | facts.merge!(OSDefaults.get_facts()) 37 | end 38 | 39 | it_configures 'mistral::notifier' 40 | end 41 | end 42 | 43 | end 44 | -------------------------------------------------------------------------------- /spec/classes/mistral_policy_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::policy' do 4 | shared_examples 'mistral::policy' do 5 | 6 | context 'setup policy with parameters' do 7 | let :params do 8 | { 9 | :enforce_scope => false, 10 | :enforce_new_defaults => false, 11 | :policy_path => '/etc/mistral/policy.yaml', 12 | :policy_default_rule => 'default', 13 | :policy_dirs => '/etc/mistral/policy.d', 14 | :policies => { 15 | 'context_is_admin' => { 16 | 'key' => 'context_is_admin', 17 | 'value' => 'foo:bar' 18 | } 19 | } 20 | } 21 | end 22 | 23 | it 'set up the policies' do 24 | is_expected.to contain_openstacklib__policy('/etc/mistral/policy.yaml').with( 25 | :policies => { 26 | 'context_is_admin' => { 27 | 'key' => 'context_is_admin', 28 | 'value' => 'foo:bar' 29 | } 30 | }, 31 | :policy_path => '/etc/mistral/policy.yaml', 32 | :file_user => 'root', 33 | :file_group => 'mistral', 34 | :file_format => 'yaml', 35 | :purge_config => false, 36 | :tag => 'mistral', 37 | ) 38 | is_expected.to contain_oslo__policy('mistral_config').with( 39 | :enforce_scope => false, 40 | :enforce_new_defaults => false, 41 | :policy_file => '/etc/mistral/policy.yaml', 42 | :policy_default_rule => 'default', 43 | :policy_dirs => '/etc/mistral/policy.d', 44 | ) 45 | end 46 | end 47 | 48 | context 'with empty policies and purge_config enabled' do 49 | let :params do 50 | { 51 | :enforce_scope => false, 52 | :enforce_new_defaults => false, 53 | :policy_path => '/etc/mistral/policy.yaml', 54 | :policies => {}, 55 | :purge_config => true, 56 | } 57 | end 58 | 59 | it 'set up the policies' do 60 | is_expected.to contain_openstacklib__policy('/etc/mistral/policy.yaml').with( 61 | :policies => {}, 62 | :policy_path => '/etc/mistral/policy.yaml', 63 | :file_user => 'root', 64 | :file_group => 'mistral', 65 | :file_format => 'yaml', 66 | :purge_config => true, 67 | :tag => 'mistral', 68 | ) 69 | is_expected.to contain_oslo__policy('mistral_config').with( 70 | :enforce_scope => false, 71 | :enforce_new_defaults => false, 72 | :policy_file => '/etc/mistral/policy.yaml', 73 | ) 74 | end 75 | end 76 | end 77 | 78 | on_supported_os({ 79 | :supported_os => OSDefaults.get_supported_os 80 | }).each do |os,facts| 81 | context "on #{os}" do 82 | let (:facts) do 83 | facts.merge!(OSDefaults.get_facts()) 84 | end 85 | 86 | it_behaves_like 'mistral::policy' 87 | end 88 | end 89 | end 90 | -------------------------------------------------------------------------------- /spec/classes/mistral_wsgi_apache_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe 'mistral::wsgi::apache' do 4 | 5 | shared_examples_for 'apache serving mistral with mod_wsgi' do 6 | context 'with default parameters' do 7 | it { is_expected.to contain_class('mistral::deps') } 8 | it { is_expected.to contain_class('mistral::params') } 9 | it { is_expected.to contain_openstacklib__wsgi__apache('mistral_wsgi').with( 10 | :bind_port => 8989, 11 | :group => 'mistral', 12 | :path => '/', 13 | :priority => 10, 14 | :servername => 'foo.example.com', 15 | :ssl => false, 16 | :threads => 1, 17 | :user => 'mistral', 18 | :workers => facts[:os_workers], 19 | :wsgi_daemon_process => 'mistral', 20 | :wsgi_process_group => 'mistral', 21 | :wsgi_script_dir => platform_params[:wsgi_script_path], 22 | :wsgi_script_file => 'app', 23 | :wsgi_script_source => platform_params[:wsgi_script_source], 24 | :headers => nil, 25 | :request_headers => nil, 26 | :access_log_file => nil, 27 | :access_log_pipe => nil, 28 | :access_log_syslog => nil, 29 | :access_log_format => nil, 30 | :error_log_file => nil, 31 | :error_log_pipe => nil, 32 | :error_log_syslog => nil, 33 | :custom_wsgi_process_options => {}, 34 | )} 35 | end 36 | 37 | context 'when overriding parameters' do 38 | let :params do 39 | { 40 | :servername => 'dummy.host', 41 | :bind_host => '10.42.51.1', 42 | :port => 12345, 43 | :ssl => true, 44 | :wsgi_process_display_name => 'mistral', 45 | :workers => 37, 46 | :custom_wsgi_process_options => { 47 | 'python_path' => '/my/python/path', 48 | }, 49 | :headers => ['set X-XSS-Protection "1; mode=block"'], 50 | :request_headers => ['set Content-Type "application/json"'], 51 | :vhost_custom_fragment => 'Timeout 99', 52 | } 53 | end 54 | it { is_expected.to contain_class('mistral::deps') } 55 | it { is_expected.to contain_class('mistral::params') } 56 | it { is_expected.to contain_openstacklib__wsgi__apache('mistral_wsgi').with( 57 | :bind_host => '10.42.51.1', 58 | :bind_port => 12345, 59 | :group => 'mistral', 60 | :path => '/', 61 | :servername => 'dummy.host', 62 | :ssl => true, 63 | :threads => 1, 64 | :user => 'mistral', 65 | :vhost_custom_fragment => 'Timeout 99', 66 | :workers => 37, 67 | :wsgi_daemon_process => 'mistral', 68 | :wsgi_process_display_name => 'mistral', 69 | :wsgi_process_group => 'mistral', 70 | :wsgi_script_dir => platform_params[:wsgi_script_path], 71 | :wsgi_script_file => 'app', 72 | :wsgi_script_source => platform_params[:wsgi_script_source], 73 | :headers => ['set X-XSS-Protection "1; mode=block"'], 74 | :request_headers => ['set Content-Type "application/json"'], 75 | :custom_wsgi_process_options => { 76 | 'python_path' => '/my/python/path', 77 | }, 78 | )} 79 | end 80 | 81 | context 'with custom access logging' do 82 | let :params do 83 | { 84 | :access_log_format => 'foo', 85 | :access_log_syslog => 'syslog:local0', 86 | :error_log_syslog => 'syslog:local1', 87 | } 88 | end 89 | 90 | it { should contain_openstacklib__wsgi__apache('mistral_wsgi').with( 91 | :access_log_format => params[:access_log_format], 92 | :access_log_syslog => params[:access_log_syslog], 93 | :error_log_syslog => params[:error_log_syslog], 94 | )} 95 | end 96 | 97 | context 'with access_log_file' do 98 | let :params do 99 | { 100 | :access_log_file => '/path/to/file', 101 | } 102 | end 103 | 104 | it { should contain_openstacklib__wsgi__apache('mistral_wsgi').with( 105 | :access_log_file => params[:access_log_file], 106 | )} 107 | end 108 | 109 | context 'with access_log_pipe' do 110 | let :params do 111 | { 112 | :access_log_pipe => 'pipe', 113 | } 114 | end 115 | 116 | it { should contain_openstacklib__wsgi__apache('mistral_wsgi').with( 117 | :access_log_pipe => params[:access_log_pipe], 118 | )} 119 | end 120 | 121 | context 'with error_log_file' do 122 | let :params do 123 | { 124 | :error_log_file => '/path/to/file', 125 | } 126 | end 127 | 128 | it { should contain_openstacklib__wsgi__apache('mistral_wsgi').with( 129 | :error_log_file => params[:error_log_file], 130 | )} 131 | end 132 | 133 | context 'with error_log_pipe' do 134 | let :params do 135 | { 136 | :error_log_pipe => 'pipe', 137 | } 138 | end 139 | 140 | it { should contain_openstacklib__wsgi__apache('mistral_wsgi').with( 141 | :error_log_pipe => params[:error_log_pipe], 142 | )} 143 | end 144 | end 145 | 146 | on_supported_os({ 147 | :supported_os => OSDefaults.get_supported_os 148 | }).each do |os,facts| 149 | context "on #{os}" do 150 | let (:facts) do 151 | facts.merge!(OSDefaults.get_facts({ 152 | :os_workers => 8, 153 | })) 154 | end 155 | 156 | let(:platform_params) do 157 | case facts[:os]['family'] 158 | when 'Debian' 159 | { 160 | :wsgi_script_path => '/usr/lib/cgi-bin/mistral', 161 | :wsgi_script_source => '/usr/bin/mistral-wsgi-api' 162 | } 163 | when 'RedHat' 164 | { 165 | :wsgi_script_path => '/var/www/cgi-bin/mistral', 166 | :wsgi_script_source => '/usr/bin/mistral-wsgi-api' 167 | } 168 | 169 | end 170 | end 171 | it_configures 'apache serving mistral with mod_wsgi' 172 | end 173 | end 174 | end 175 | -------------------------------------------------------------------------------- /spec/shared_examples.rb: -------------------------------------------------------------------------------- 1 | shared_examples_for "a Puppet::Error" do |description| 2 | it "with message matching #{description.inspect}" do 3 | expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # Load libraries here to simulate how they live together in a real puppet run (for provider unit tests) 2 | $LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'inifile', 'lib')) 3 | $LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib')) 4 | require 'puppetlabs_spec_helper/module_spec_helper' 5 | require 'shared_examples' 6 | require 'puppet-openstack_spec_helper/facts' 7 | 8 | fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) 9 | 10 | RSpec.configure do |c| 11 | c.alias_it_should_behave_like_to :it_configures, 'configures' 12 | c.alias_it_should_behave_like_to :it_raises, 'raises' 13 | 14 | c.module_path = File.join(fixture_path, 'modules') 15 | end 16 | 17 | at_exit { RSpec::Puppet::Coverage.report! } 18 | -------------------------------------------------------------------------------- /spec/spec_helper_acceptance.rb: -------------------------------------------------------------------------------- 1 | require 'puppet-openstack_spec_helper/litmus_spec_helper' 2 | -------------------------------------------------------------------------------- /spec/unit/provider/mistral_config/openstackconfig_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | provider_class = Puppet::Type.type(:mistral_config).provider(:openstackconfig) 3 | describe provider_class do 4 | 5 | it 'should default to the default setting when no other one is specified' do 6 | resource = Puppet::Type::Mistral_config.new( 7 | {:name => 'DEFAULT/foo', :value => 'bar'} 8 | ) 9 | provider = provider_class.new(resource) 10 | expect(provider.section).to eq('DEFAULT') 11 | expect(provider.setting).to eq('foo') 12 | end 13 | 14 | it 'should allow setting to be set explicitly' do 15 | resource = Puppet::Type::Mistral_config.new( 16 | {:name => 'dude/foo', :value => 'bar'} 17 | ) 18 | provider = provider_class.new(resource) 19 | expect(provider.section).to eq('dude') 20 | expect(provider.setting).to eq('foo') 21 | end 22 | 23 | it 'should ensure absent when is specified as a value' do 24 | resource = Puppet::Type::Mistral_config.new( 25 | {:name => 'dude/foo', :value => ''} 26 | ) 27 | provider = provider_class.new(resource) 28 | provider.exists? 29 | expect(resource[:ensure]).to eq :absent 30 | end 31 | 32 | it 'should ensure absent when value matches ensure_absent_val' do 33 | resource = Puppet::Type::Mistral_config.new( 34 | {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' } 35 | ) 36 | provider = provider_class.new(resource) 37 | provider.exists? 38 | expect(resource[:ensure]).to eq :absent 39 | end 40 | 41 | end 42 | -------------------------------------------------------------------------------- /spec/unit/type/mistral_config_spec.rb: -------------------------------------------------------------------------------- 1 | require 'puppet' 2 | require 'puppet/type/mistral_config' 3 | describe 'Puppet::Type.type(:mistral_config)' do 4 | before :each do 5 | @mistral_config = Puppet::Type.type(:mistral_config).new(:name => 'DEFAULT/foo', :value => 'bar') 6 | end 7 | 8 | it 'should require a name' do 9 | expect { 10 | Puppet::Type.type(:mistral_config).new({}) 11 | }.to raise_error(Puppet::Error, 'Title or name must be provided') 12 | end 13 | 14 | it 'should not expect a name with whitespace' do 15 | expect { 16 | Puppet::Type.type(:mistral_config).new(:name => 'f oo') 17 | }.to raise_error(Puppet::Error, /Parameter name failed/) 18 | end 19 | 20 | it 'should fail when there is no section' do 21 | expect { 22 | Puppet::Type.type(:mistral_config).new(:name => 'foo') 23 | }.to raise_error(Puppet::Error, /Parameter name failed/) 24 | end 25 | 26 | it 'should not require a value when ensure is absent' do 27 | Puppet::Type.type(:mistral_config).new(:name => 'DEFAULT/foo', :ensure => :absent) 28 | end 29 | 30 | it 'should accept a valid value' do 31 | @mistral_config[:value] = 'bar' 32 | expect(@mistral_config[:value]).to eq(['bar']) 33 | end 34 | 35 | it 'should accept a value with whitespace' do 36 | @mistral_config[:value] = 'b ar' 37 | expect(@mistral_config[:value]).to eq(['b ar']) 38 | end 39 | 40 | it 'should accept valid ensure values' do 41 | @mistral_config[:ensure] = :present 42 | expect(@mistral_config[:ensure]).to eq(:present) 43 | @mistral_config[:ensure] = :absent 44 | expect(@mistral_config[:ensure]).to eq(:absent) 45 | end 46 | 47 | it 'should not accept invalid ensure values' do 48 | expect { 49 | @mistral_config[:ensure] = :latest 50 | }.to raise_error(Puppet::Error, /Invalid value/) 51 | end 52 | 53 | it 'should autorequire the package that install the file' do 54 | catalog = Puppet::Resource::Catalog.new 55 | anchor = Puppet::Type.type(:anchor).new(:name => 'mistral::install::end') 56 | catalog.add_resource anchor, @mistral_config 57 | dependency = @mistral_config.autorequire 58 | expect(dependency.size).to eq(1) 59 | expect(dependency[0].target).to eq(@mistral_config) 60 | expect(dependency[0].source).to eq(anchor) 61 | end 62 | 63 | end 64 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | minversion = 3.1 3 | skipsdist = True 4 | envlist = releasenotes 5 | ignore_basepython_conflict = True 6 | 7 | [testenv] 8 | basepython = python3 9 | 10 | [testenv:releasenotes] 11 | deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} 12 | -r{toxinidir}/doc/requirements.txt 13 | commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html 14 | --------------------------------------------------------------------------------