Commit Graph

48 Commits

Author SHA1 Message Date
Takashi Kajinami d9840e99d0 Refactor resource dependencies
This refactors resource dependencies to improve the following points.

 - Avoid unnecessary dependencies across services. For example aodh
   service does not require cinder db.

 - Restart only api service when config files like paste.ini, which
   are used only be api service is changed.

Change-Id: Iadb8552abf55228729bf5d31795b1e4bbb8b9929
2024-03-01 02:31:36 +09:00
Takashi Kajinami 3021cd9daf replace validate_legacy with proper data types
the validate_legacy function is marked for deprecation in
v9.0.0 from puppetlabs-stdlib.

Depends-on: https://review.opendev.org/c/openstack/puppet-openstacklib/+/885996
Change-Id: I144468b4f5536a48702e457f2a5db879f3ca217a
2023-06-23 09:26:59 +09:00
Takashi Kajinami 5fe73417a2 Add strict validation about boolean parameters
This ensures the parameters used by if-else logic accept only boolean
values because non-boolean can result in unexpected behavior.

Change-Id: Ia67f4aba2c3064f9b0ba93430b9c0f7a14800ced
2023-03-16 13:21:52 +09:00
Takashi Kajinami da45ce8a21 Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: Ib395d70d0d528adfef6600f67f9cd6bb238f8206
2023-03-02 11:31:36 +09:00
Takashi Kajinami 43105f3130 Clean up direct dependencies on puppetlabs-apache
This change removes direct reference to some classes in
puppetlabs-apache. Details are explained below.

- The api class doesn't need access to anything defined in
  apache::params

- The following classes are included by the openstacklib::wsgi::apache
  resource type, and current inclusions are just redundant.

Change-Id: I88684f7f246b226844dc724a35d1cec95742704e
2021-12-09 10:21:14 +09:00
Zuul 93d2d31f07 Merge "aph/api_cfn: Clear the related parameters when ssl is disabled" 2021-11-12 12:21:25 +00:00
Takashi Kajinami 8645f8d70c aph/api_cfn: Clear the related parameters when ssl is disabled
... instead of leaving these parameters unmanaged.

Change-Id: I046b32f01eb73e6989b3b18390e4103aab970554
2021-11-11 08:13:26 +09:00
Takashi Kajinami 3703f8805a Do not manage services when manage_service is disabled
Change-Id: I40e3ef55255eeb13dd3d27d91570b955801aa99e
2021-11-10 22:41:47 +09:00
Tobias Urdin 5f6411c3dd Convert all class usage to relative names
Change-Id: I9982b8476ca9dab8a338b66db75d6da6519f9266
2019-12-08 23:07:36 +01:00
Matthias Bastian 9e98fa3cec Improve restarting Apache
The previous approach could lead to restarting Apache after
Anchor['heat::service::end']. The new approach is already used in other
Puppet modules and guarantees restarting Apache between the service
anchors.

Change-Id: Ia4ccc8a6477f490f42b588b3e6a9d5c0f7ff6d88
2018-08-14 16:58:08 +02:00
Tobias Urdin 742f0e2d54 Fix bug introduced by notify apache for heat-api
The change [1] was wrong since it uses the wrong resource
name for the puppetlabs-apache Service defintion [2].

Instead of the revert this fixes it by changing it back to
the proper variable which has the value 'httpd'.

[1] https://review.openstack.org/#/c/581411/
[2] https://github.com/puppetlabs/puppetlabs-apache/blob/master/manifests/service.pp#L43

Change-Id: Ic943293d1ff9aa33c8095feb2b14d96a30a37914
2018-07-14 13:40:26 +02:00
Andreas Jaekel f10256ae3e Notify not only heat-api service but also apache
Not only the heat-api and heat-api-cfn services are notified, but also
the apache service if the API is run using apache. This ensures apache
is restarted on config changes.

Change-Id: I68feb50a466b56b027573cda099191f6b26ddbfd
2018-07-10 17:55:37 +02:00
Juan Antonio Osorio Robles fe394add6f Add manifests to deploy APIs over httpd
This includes a resource that will generically create the vhost for
the specified API.

Co-Authored-By: Thomas Herve <therve@redhat.com>
Depends-On: I9a9246522810de546a7c460ab1133d6bf9081a15
Change-Id: I253f46f5ad943971dd9ea6995591c72a36953bdb
2017-03-02 14:15:18 +02:00
Juan Antonio Osorio Robles f55c866119 Enforce use_ssl flag
Setting the certificate and key in heat's configuration has the
effect of enabling SSL. So, one can actually enable SSL using those
and ignore the use_ssl flag.

This commit enforces that flag, so if the flag is not set, then those
parameters shouldn't be persisted in Heat's configuration.

A unit test was removed for each of the correspondent API's because they no
longer apply. If ssl is not enabled, then heat_config resources containing
those configurations are not present in the resource catalog.

Change-Id: I87fb234943829d7f0d8786e98e90b81e9a71c8ef
2016-06-15 16:48:10 +03:00
Mykyta Karpin 811f7ce4b0 Switch Heat to $::os_service_default - part 2
Switching to os_service_default fact below classes:
heat
heat::api
heat::api_cfn
heat::api_cloudwatch
heat::engine

Change-Id: Iff0275b701f2096f6f927ff962ef06c673827b4e
2016-01-25 18:53:16 +02:00
Jenkins d36b5391dd Merge "Fix up doc string for workers variable" 2015-10-24 09:20:06 +00:00
Sam Morrison bf3b36044a Fix up doc string for workers variable
Change-Id: Ie886a5e2603dd38c2642393cb553806b3e749d43
2015-10-22 09:52:55 +11:00
Clayton O'Neill dca9fe942b Move deps & external hooks into a standalone class
Previously the anchors and dependencies that allow external hooks were
all in the main ::heat class.  However, if you wanted to include just
::heat::db::mysql, then it would fail, since it assumed the main heat
class was included.  This moves all of those resources and relationships
into a new class, ::heat::deps.  All of the classes will now include
this class so that the anchors and deps are always evaluated even if
only a portion of the classes are used, and even if ::heat isn't pulled
in.

Change-Id: I4297df160a7afae2b66c1ac76e37de313fa4fb09
Closes-Bug: #1507934
2015-10-20 09:57:36 -04:00
Clayton O'Neill b2f791400d Add hooks for external install & svc management
This adds defined anchor points for external modules to hook into the
software install, config and service dependency chain.  This allows
external modules to manage software installation (virtualenv,
containers, etc) and service management (pacemaker) without needing rely
on resources that may change or be renamed.

Change-Id: I032ee01505e0cbc125b0e219c436b77c93f57720
2015-08-29 03:19:02 +00:00
Yanis Guenane 0cf89d487e Rely on autorequire for config resource ordering
Currently we specify the ordering of config resources wherever it is
necessary based on the presence of the file it will write to, or the
presence of the package in charge of providing the file it will write
to.

Those kind of ordering can be specified directly at the resource level
using the autorequire mechanism. With this patch, any config resource
will make sure the package in charge of providing the file will be
installed first.

Change-Id: I6476060c97d350640b5a254738a60e319ad522e9
2015-08-12 19:03:34 +02:00
Yanis Guenane 0e850373a8 Add tag to package and service resources
In order to be able to take an action after all the packages of the
module have been installed/updated or all the services have been
started/restarted, we set a 'heat-package' and 'heat-service' tag
for each package and service of this module.

At the moment, there is a generic openstack tag that is not specific
enough if one wants to take action upon a single module change.

Use case :

If an action needs to be taken after all the packages have been
installed or updated : Package <| tag == 'heat-package' |> -> X

Change-Id: I38a6b422054dbf0fceacf6b7e329dbb3cb0fa9cb
2015-07-22 20:22:24 +02:00
Clayton O'Neill 8b6cf3bbb7 Make package_ensure consistent across classes
This adds a package_ensure parameter to all classes that did not have it
and updated all package resources to use the package_ensure parameter.

Change-Id: I49c3e50153bc5eba323c5a766ed1f30c23653985
2015-04-23 13:42:56 -04:00
Yanis Guenane 744f4bbcf5 Create a sync_db boolean for Heat.
Other components offer the option to decide whether or not to run the
db sync command. Heat was missing this feature. This commit add this
feature for Heat.

Change-Id: I06b669123fe08e02c66ee34dab78a943ff5de90c
2015-04-07 11:51:28 +02:00
Gael Chamoulaud 73df608936 Tag all Heat packages
Some users wish to override the default package provider by their own.

Tag all packages with the 'openstack' to allow mass resource attributes
override using resource collectors.

Closes-bug: #1391209

Change-Id: I09e54700438894e22d29605fec51bb056baf4050
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-28 19:07:21 +01:00
Sebastien Badia 44e1bbf039 Add Puppet 4.x lint checks
This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins. Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: If5f03538be85cee4a1d3b4c9a87eae1230432114
2015-03-02 13:54:32 +01:00
Gael Chamoulaud 45a35dc2ec Add puppet-lint-param-docs plugins to puppet-lint
- This puppet-lint plugin checks if all parameters are documented
- Fix some unaligned arrows
- https://github.com/domcleal/puppet-lint-param-docs

Change-Id: I5e73747b726191bc4fc55e6e227892507e185871
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2014-11-13 12:42:40 +01:00
Yanis Guenane 92d5df6f65 policy.json: Allow one to manage them from the puppet module
This commit allow a deployer to manage the policies via this module
It relies on augeas to change only the policy needed. The init takes
a hash of policies and apply them.

Change-Id: If41f08571577bb799a373202dc58c2577bbe7f74
2014-10-22 10:51:14 -04:00
Martin Magr 2ee54962a8 Add manage_service feature
puppet-heat lacks of disabling service managing. This patch adds
$manage_service parameter to all relevant classes.

Closes-bug: #1359823
Change-Id: I54245b39f3484ccdb9910aa0fa4c8dc2bae3f0ce
2014-09-19 15:13:21 +02:00
Yanis Guenane 025b8cb830 Enable heat server to be run in SSL mode
This commit allows one to specify cert and key file
to run heat server in SSL mode.

Note: The flag use_ssl per se is not used in heat yet,
its purpose here it to verify collateral parameters.

Change-Id: I94d0b461adc752b028770aea71bf4e4612722539
2014-05-23 13:14:50 -04:00
Emilien Macchi 498ce5093c api: bring workers support
Allow to configure the number of workers for Heat API services.

Change-Id: I94f938ede1f7f5e97adb406d592206e667d30f8d
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2014-02-18 21:27:27 +01:00
Francesco Vollero 67f0661443 Enable execution of heat-manage db_sync
This patch is aiming to correct a fault in puppet-heat that was not
executing the heat-manage db_sync that was making this module in the
end not fully working.

At this stage there are no tests to support this change but I am
willing to add those in a later commit.

This patch it's been rebased according to this change: https://review.openstack.org/46227

This new patchset include a patch from Sebastien Badia and should
make all the tests green with Change id: I2aa8fc070e5f5ee18040200e4a5b4f6161550280

Change-Id: Ib7731ab429ea92947f52bcf015facc8864466586
2013-09-26 17:08:37 +02:00
Francesco Vollero 7d4a5ecfa6 Remove heat::db from all the components of the module.
This patch is needed to completely remove any require heat::db that
point to heat::db that was removed in change:
I4584cdb12d1f9e624228e6ee34b4bcfbf649a12e

The patch is connected to the fact that in the cited change we
missed those references.

Change-Id: Idd9dcefd52c63e9c8cd74fc39bc4b7ba04f981bc
2013-09-12 11:23:51 +02:00
Ian Wienand 84dbad08b7 Consolidate config into single file
Upstream commits [1,2] modified heat to use a single config file.
This modifies the puppet config of each component to use different
sections of the same file.

Some notes about the change:

 - each of heat-api, heat-api-cfn, heat-api-cloudwatch has indvidual
   options for bind_port, bind_host
 - heat-engine options live under DEFAULT (it does not bind to any
   ports)
 - new log_dir global
 - slight fixes to ENCRYPTION_KEY generation for new heat.conf name
 - include rspec tests for api-cfn & api-cloudwatch

Fixes bug 1214824

[1] https://review.openstack.org/#/c/39980/
[2] https://review.openstack.org/#/c/43697/

Change-Id: I7d8865a809da71696b944ab0654a1f728cd827df
2013-08-30 07:23:56 +10:00
Mathieu Gagné 1b21b36636 Use Puppet boolean for better consistency
This fixes puppet-lint warning "quoted boolean value".

Change-Id: I2ab34d535accaf621b1058658f5f371ae4aca921
2013-08-09 15:39:30 -04:00
Emilien Macchi 03ef6a7b7f Update the module for new config file method
Since we have now an only config file (heat.conf) with this patch:
https://review.openstack.org/#/c/36476/

This patch updates the module and delete old configuration files
support and add a test.

Also, I fixed some tab issues in manifests.
Fix bug #1207858

Change-Id: If3d044e2581156fa5ce4de19f5c740328efa0aa8
2013-08-06 23:28:31 +02:00
Francesco Vollero ac80ddbf6f Changes to make it work with Fedora 2013-07-22 18:13:55 +02:00
Émilien Macchi adf5af8b9f Fix api.pp with RabbitMQ 2013-06-09 23:56:26 +02:00
Émilien Macchi a28a0e4e3a Fix api.pp with RabbitMQ 2013-06-09 23:55:10 +02:00
Émilien Macchi a7e8f56feb Drop db-sync stuff 2013-06-09 23:06:40 +02:00
Émilien Macchi 753936f408 Fix typos in manifests with virtual ressources 2013-06-03 21:45:12 +02:00
Émilien Macchi 87372458d1 Update API + Engine 2013-06-01 18:27:22 +02:00
Émilien Macchi b9e4f2253b Update Heat API manifest 2013-05-31 23:01:14 +02:00
Émilien Macchi 57a4863a0b Update Heat API manifest 2013-05-31 22:54:05 +02:00
Émilien Macchi 7200fc9f82 Update API manifests with Rabbit flags 2013-05-30 22:24:23 +02:00
Émilien Macchi 3bdd5d7a33 Set good providers to manifests 2013-05-30 22:05:19 +02:00
Émilien Macchi f3907b9642 Drop heat_config because of new providers 2013-05-30 21:54:04 +02:00
Émilien Macchi fbaeef4c7f Configure api.pp manifest 2013-05-30 18:37:18 +02:00
Émilien Macchi 2e240569ef Basic manifests 2013-05-30 17:44:13 +02:00