18 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
Tobias Urdin
41dae27b09 Add per module policy service refresh
Updating the policies for this project should only
refresh the services that reads it.

Change-Id: Ie190999dfdce7fe75bbc1889ec11feda796e226c
2023-06-26 00:04:40 +02:00
Takashi Kajinami
e5c3e2756d Expose policy_default_rule
The option has been managed by the underlying puppet-oslo module but
has not been configurable. This introduces the parameter to customize
the option.

Change-Id: Ib7d19a8d3b634b3f2c88222881b175f74771de00
2023-01-23 14:27:32 +09:00
Takashi Kajinami
b7d4441ce9 Allow purging policy files
This change introduces the new purge_config parameter to the policy
class so that any policy rules not managed by puppet manifests can be
cleared.

Co-Authored-By: Martin Schuppert <mschuppert@redhat.com>
Depends-On: https://review.opendev.org/802305
Change-Id: Ife9db20f914ae773881f4c78871b8232ecf42d17
2021-09-04 22:03:34 +09:00
Thomas Goirand
37bd354401 Allow to configure policy_dirs
This patch makes it possible to override the current service default,
which is /etc/<service>/policy.d .

Change-Id: I9dea409a46bd8d22388853582de8f64034cf0d03
2021-04-01 23:01:27 +02:00
Takashi Kajinami
704c10fce4 Add support for oslo_policy/enforce_new_defaults
Depends-on: https://review.opendev.org/781428
Change-Id: Ic012fdd97529baebef8840f364084e7f946b6908
2021-03-24 16:38:22 +09:00
Takashi Kajinami
e08f3cd6fe Add support for the oslo_policy/enforce_scope parameter
Depends-on: https://review.opendev.org/#/c/759008/
Change-Id: Ice8c1420a2386887965dd587e90b35d3314b0c27
2021-03-16 12:36:29 +09:00
Takashi Kajinami
b4e9a1a6e4 Use yaml instead of json for policy file
Because usage of json for policy file will be deprecated and replaced
by yaml[1].

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Depends-on: https://review.opendev.org/769647
Change-Id: Id19b8fc7ded7b3a25a7b028687780caad32deae9
2021-01-07 08:44:59 +00:00
Emilien Macchi
fd952e2a84 Add group to policy management
The move of policy.json into code means the file may not exist. We've
added support to ensure that the file exists in the openstacklib but we
need to make sure the permissions are right for each service. This adds
the group information to the policies so it works right.

Depends-On: I26e8b1384f4f69712da9d06a4c565dfd1f17c9ed
Change-Id: I748ed0cba392d783e75b2cf16833a687d6152a22
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
2018-01-11 15:54:59 +00:00
ZhongShengping
40a0967ac7 oslo policy: check puppet resource instead of actual config in spec
Change-Id: If00ed6d398e0c5835bc75427a7b561b64b624520
2017-05-23 15:01:27 +08:00
Mykyta Karpin
7359b5129e Switch heat to rspec-puppet-facts
This change updates the heat tests to use rspec-puppet-facts
to test multiple operating systems.

Change-Id: Ic6e1542d5befba529f753b346ff842ed88d1292e
2016-11-11 13:11:39 +02:00
iberezovskiy
57ecb27673 Fix facts for policy test
Change-Id: I5affd954caf123987ed00598e80c417177c0dc43
2016-06-07 19:55:34 +03:00
ZhongShengping
5c343cfd0d Test multiple operating systems for policy
Use on_supported_os function to test multiple
operating systems for class heat::policy.

Change-Id: Iaf8b50e442108ddd7e040051ada1477f3355b38e
2016-06-07 08:49:26 +08:00
dmburmistrov
7c8cecf7fe Set oslo::policy in heat
Change-Id: I96f3706512a31fa99fb36ffc32c13ed303c58e2c
2016-04-13 18:06:48 +03:00
Mykyta Karpin
d57948dcfe Add os_service_default support to heat tests
Heat classes tests are modified to support
	os_service_default facts.

Change-Id: Ie8201de4158f1442eade93fee042453f4effb34c
2015-11-18 13:57:58 +02:00
Sebastien Badia
d7e9fe0e7a spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the
rspec-puppet release 2.0.0, in the mean time, we update rspec syntax
in order to be prepared for rspec 3.x move.

In details:
  * Use shared_examples "a Puppet::Error" for puppet::error tests
  * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
  * Fix spec tests for rspec-puppet 2.0.0
  * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
  * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)
  * Remove un-used puppet-lint (name_containing_dash config)

Change-Id: I1b82e4f6ec0b1bbf52e86c5d127413a26277ae8c
Card: https://trello.com/c/eHXc1Ryd/4-investigate-the-necessary-change-to-be-rspec-puppet-2-0-0-compliant
2015-03-02 13:54:32 +01:00
Yanis Guenane
fd34b59ba5 policy.pp : Fix duplicate ressource issue openstacklib::policy
Currently, in the policy.pp file the class openstacklib::policy
is called. The same apply for all components resulting in a
Duplicate Ressource issue. Using directly the underlying ressource
openstacklib::policy::base we prevent this issue.

Change-Id: I96df810db8c14e564baca508b7d2eec71c6573c3
2014-11-10 13:58:30 -05: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