20 Commits

Author SHA1 Message Date
Takashi Kajinami
a5cb8965d5 Fix unit tests incompatible with puppetlab-stdlib 8.0.0
Since puppetlabs-stdlib 8.0.0, ensure_packages automatically translates
'ensure => present'  to 'ensure => installed' and that translation
breaks existing assertions in unit tests.

Change-Id: I35500af08e39725bab61be036f780c74e38313b9
2021-09-23 17:03:52 +00:00
Takashi Kajinami
2a53c66ed3 Re-implement openstacklib::policy
openstacklib::policy has never been used in any other modules because
it was implemented as a class not reusable for each service.
This change re-implements openstacklib::policy as a defined resource
type so that we can use this implementation from each puppet modules.

The openstacklib::policy resource type provides the purge_config
parameter. When this parameter is set to true, a policy file is cleared
during configuration process. This allows users to remove any existing
rules before applying their own (no) rules.

Change-Id: I9bb486c9191c50c11717dcb9c6af00d17c3aa8f5
2021-08-10 10:25:12 +09:00
Thomas Goirand
508fc7adde Get rid of the $pyvers variable
Since everyone has switched to Python3, it's time for the removal of the
$pyvers variable.

Change-Id: I371ef3a2e257e6d197238e7e9cbfd9d445405be5
2021-06-29 08:06:57 +09:00
Zuul
de68e1eace Merge "Add support for iscsid configuration" 2021-06-28 10:47:27 +00:00
Takashi Kajinami
6e67434c27 Add support for iscsid configuration
The iscsid service is used in sevral components like nova, cinder,
glance and so on to connect to iscsi devices. This change introduces
the new class to manage basic configuration of the iscsid service.

Co-authored-by: Alfredo Moralejo <amoralej@redhat.com>
Change-Id: I3fc6d1192632cc1458d00900508d548f522e9cdb
2021-06-04 20:40:50 +09:00
Takashi Kajinami
f0b36283fe Drop Fedora support
Fedora support is never tested, and has been unmaintained for a while.
Because we don't expect any actual user using OpenStack on Fedora, this
change drops support for Fedora directly.

Change-Id: I63c96cd92bad210c0a9527c59f8e1347967172a3
2021-05-26 23:06:00 +09:00
beagles
4622709879 Add support for yaml format policy files
This patch adds a 'file_format' field to the policies definition to
allow overriding the default file format which is currently json.

Change-Id: Iec610053a9250cb78c2a17bfc2c197bf55d9df86
Related-Bug: #1885602
2020-07-13 20:36:11 +00:00
Takashi Kajinami
f74e9b84fb Refactor os distro/version check in client ut
... so that we can easilty understand which distro and which version
we expect python3 packages.

Change-Id: I385a4a5b123519961791ef6d842ab84990ea00c9
2020-04-01 15:57:52 +09:00
Tobias Urdin
63cd960253 Inherit pyvers from openstacklib::defaults
Depends-On: https://review.openstack.org/#/c/633162/
Change-Id: Ied4fcd08ce82543907c4cf8fd5f2780e63a47eed
2019-01-25 15:55:18 +00:00
Tobias Urdin
4d08ab70cb Cleanup spec testing
Change-Id: I3c13fc2f8bc3582fd72206b3c711ff5863943b09
2018-11-01 17:54:51 +01:00
20ac1f925a Install python3-openstackclient in Fedora or RedHat > 7
Fedora repo [1] has python3 packages, start consuming those.

[1] http://trunk.rdoproject.org/fedora/current/

Change-Id: I8e2ec45e38275fb0910f5921662cb7cf865edd0a
2018-10-25 16:49:16 +05:30
Benedikt Trefzer
a39a44faf9 make openstackclient package name configurable
Change-Id: Ie7d770af6d1238c3f68b7c743e8fa5255a9a5995
2018-09-10 10:33:01 +02:00
Tobias Urdin
4ef3b1e843 Remove allow_virtual for Package in defaults
We only test and support Puppet 4 and Puppet 5
now and this parameter to the Package resource
defaults to true in these versions making this
unneccesary.

Change-Id: I1459cf5382cd3090c051b25c884399d5cf37d264
2018-05-18 13:49:12 +02:00
Tobias Urdin
709b28006b openstacklib::openstackclient Debian python3
This change adds support for installing the
python3-openstackclient package on Debian.

On Ubuntu and RedHat based the package name
is still python-openstackclient.

Change-Id: I8a0c5dfa9274dca167ad3bb33ab151fb693f5d4d
2018-04-24 15:54:35 +02:00
Alex Schultz
525d77195e Improve tests with rspec-puppet-facts
This change updates the tests to use rspec-puppet-facts when doing
different OS testing. Additionally as part of this change, there are
improvements to the openstacklib::policycrd testing which uncovered
issues with the verify_contents catalog test. The verify_contents calls
have been replaced with heredocs to better test when multiple services
are excluded.

Change-Id: I86bae2b16026e15b6e4445f3749419b8802bc94d
2016-10-26 17:49:59 -06:00
Sofer Athlan-Guyot
8cf821dc2f Default file for all. Use it for virtual package.
This file is to be included by all puppet modules.

First feature is to make sure that allow_virtual is set to true for all
openstack modules.  It's set to false for puppet 3.6.1 to
4.0.0 [1]

[1] https://docs.puppet.com/puppet/3.6/reference/release_notes.html#puppet-361

Change-Id: I9d0a10d48124ee71ea80134ceef96436c8ee196e
Closes-Bug: 1599113
Related-Bug: 1597753
Depends-On: I2699eaa3a10589c9a0c680bb1de489994fe01b67
2016-07-06 15:24:37 +02:00
Matthew Black
45f8a57770 Added policy-rc.d class.
On debian os family systems the methodology is to
start services when installed. This causes a problem
with keystone sometimes at random in CI jobs.

Change-Id: Id0b38743a9bf536f69d155e1d6e664a5585e5e1d
2016-04-22 10:41:36 -04:00
Gael Chamoulaud
3fa6399cad 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 order to be prepared
for rspec 3.x move.

In details:
* Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
* Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
* Fix spec tests for rspec-puppet 2.0.0
* Clean Gemfile (remove over-specificication of runtime deps of
  puppetlabs_spec_helper)

Change-Id: Ice356e35a65204a62e47f49dd4f5816208a6dace
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:13:33 +02:00
Yanis Guenane
37935472f1 policy.json: Allow puppet modules to manage policy.json
Currently puppet modules does not allow one to manage policy.json.
This commit aims to create a common resource for people to manage
their policies.

Change-Id: I1cd7765cdcbddb7e7ad5d720f1efa382641712f2
2014-09-25 08:42:18 -04:00
Colleen Murphy
474a3bbabe Create basic module structure with required files
Change-Id: I9984ffa0e5f0fa379fae559b44457c34fa10ccd2
2014-07-01 08:37:43 -07:00