165 Commits

Author SHA1 Message Date
Takashi Kajinami
e7a09d24df nova_flavor: Fix broken idempotency with properties
Make sure that nova_flavor resource is idempotent when the "properties"
property is set. Also fix the typo causing undefined method error.

Closes-Bug: #2059949
Change-Id: I17a9d92c44b8dfe329b22b309d7a0408df707d1a
(cherry picked from commit 820695b463d4dead2f00834458e770c9a3c0dec4)
(cherry picked from commit 3d7de53fc44b1c4caa611056956629e30985f49d)
2024-04-04 00:19:42 +00:00
Takashi Kajinami
7f7e1010ef Do not use system scope tokens in providers
This is partial revert of 0ed626e1461fecc4f443fcd543a99ba945539b1f .

After discussing several problems caused by scope separation, we
decided to suspend implementing the scope enforcement and focus on
project personas like reader role. As the result of that decision,
the system admin persona will be removed, thus we should use
the project admin persona instead. The previous policy rules to allow
system scope access have been reverted by [1].

This does not revert the original patch to keep the unit tests which
were hugely refactored by that change.

[1] 066e1e69d1394839a9f0bde4ca8c3a0db2d52396

Change-Id: I85847850602ab3526d2fdb1a56bb927183198825
2022-10-06 10:37:04 +09:00
Takashi Kajinami
75475c06be Use the common provider for libvirt daemons
Currently we implement separate providers for all libvirt configuration
files but this is quite redundant because we have the same logic in
all providers.

This change refactors these providers makes use the libvirtd_config
provider used as the base implementation.

Change-Id: I486211306620d245262678875be3ec607640e921
2022-09-12 10:56:16 +09:00
Takashi Kajinami
322599b75d Switch provider to manage paste.ini file
... so that we users can use '<SERVICE DEFAULT>' similarly to
the resource types to manage the <service>.conf files.

Closes-Bug: #1981118
Change-Id: I4092da4732d5e68ce190e7341df7a01166954504
2022-07-09 10:04:03 +00:00
Zuul
0c35a804af Merge "Remove handling of 'u' prefix" 2022-05-23 17:31:14 +00:00
Zuul
c697f79f3e Merge "Remove novajoin support" 2022-05-23 17:31:12 +00:00
Takashi Kajinami
571848bcdb Remove handling of 'u' prefix
... because the prefix is no longer printed in Python 3.

In python 2
>>> print({u'foo': u'baa'})
{u'foo': u'baa'}
>>> print([u'foo', 'baa'])
[u'foo', 'baa']

In python 3
>>> print({u'foo': u'baa'})
{'foo': 'baa'}
>>> print([u'foo', 'baa'])
['foo', 'baa']

Change-Id: If670215181dd338dbcf32e06ff3a1d745651e9b6
2022-05-18 10:43:53 +09:00
Takashi Kajinami
90be242323 Remove novajoin support
The novajoin[1] project has been unmaintained for last two years.
We deprecated support for the service during the previous cycle[2],
and no longer expect any user requires it.

[1] https://opendev.org/x/novajoin
[2] 70bb80f6d33a4c81a370cd051a4a47c5a2b2c88c

Change-Id: I8f21036de12d78ca25fddaf02399e4c38b490ed5
2022-05-18 08:26:19 +09:00
Takashi Kajinami
5242d3a08b Support virtlockd configurations
... so that this module supports configuration of all libvirt daemons.

Change-Id: I93a02935df3a23e15b4a37081dc2a6ea646f6c79
2022-04-19 09:13:48 +09:00
Takashi Kajinami
0ed626e146 Use system scope credentials in providers
This change enforces usage of system scope credentials to manage
flavors, aggregates, and services, following the new policy rules for
SRBAC support in nova.

The logic to look up credential for the nova service user from
[keystone_authtoken] is left to keep backward compatibility but is
deprecated and will be removed.

Depends-on: https://review.opendev.org/806474
Depends-on: https://review.opendev.org/828025
Depends-on: https://review.opendev.org/828874
Change-Id: I71779f0f1459d64914589a94a440336386266306
2022-02-21 14:54:47 +00:00
Takashi Kajinami
77138476e0 nova_flavor: Add the new project_name property
The nova_flavor resource has been providing the project property which
accepts both project name and id. However this implementation results
in broken idempotency with project name used.

This change introduces a separate project_name property, so that users
can use project name with proper idempotency.

Closes-Bug: #1790795
Change-Id: Idee4af6931b8cf4a21d88f4cd38fe83468ec8efa
2022-02-18 01:32:03 +09:00
Zuul
4db2df55a9 Merge "nova_flavor: Strip '' from project id value" 2022-02-15 10:31:00 +00:00
Zuul
c008eb0143 Merge "nova_flavor: Refactor property setter" 2022-02-14 20:00:29 +00:00
Takashi Kajinami
f40bf357c0 nova_flavor: Refactor property setter
This change replaces redundant implementation of some property setters
by the common template.

Change-Id: I527aa84d52dd787169e38f81a1c2fde9f67a3046
2022-02-13 23:15:34 +09:00
Takashi Kajinami
599703b530 Remove unused str2hash
Change-Id: I9732ccbdafa79b11d8cb4955381794b922e16385
2022-02-13 21:34:35 +09:00
Takashi Kajinami
0ce7d9fe9e Ensure auth_endpoint is cleared by reset
Change-Id: I9d81eff950a50a2139c874ecc426040bcc0a93d4
2022-02-12 23:20:34 +09:00
Takashi Kajinami
60acc82c22 Fix missing update of property_hash
When a resource is created, the :ensure parameter should be set to
'present' so that exists returns true. In addition, the whole hash
should be cleared when a resource is deleted, otherwise subsequent
access might look up stale values. This change ensures property_hash is
updated in create/destroy accordingly.

This change also fixes the incorrect handling of "project" property
in nova_flavor which is causing unexpected update.

Finally, the ignored unit tests are fixed, to test the above fixes.

Change-Id: I611e3d0428674e7438fe15b276667f7b379d136e
2022-02-12 23:19:38 +09:00
Takashi Kajinami
ed1b0dbf3a nova_flavor: Strip '' from project id value
Currently the project field shows a list of projects like;

project=['ec085e18-22bb-403b-8ba5-0f9c6d67dffa']

The commit 86764de9cd90b9b09898da6061aaa786906620df added the logic to
handle this format but it missed surrounding quote(') which should be
also removed.

Change-Id: If65221db5a9e60e797b834a305d385d3fea4db16
2022-02-12 00:40:19 +09:00
Takashi Kajinami
3b47f97063 Remove inefficient usage of autorequire
This change removes inefficient usage of autorequire, with the wrong
resource name(The resource name should include section name) in
some resource types. The necessary dependency is already enforced by
another autorequire which depends on service::end anchor.

Change-Id: I0993e2c9ed80d476ca984edf9d6167818a1cb1bb
2022-01-20 22:51:30 +09:00
Takashi Kajinami
6bf4526ff1 Add support for rootwrap.conf
Change-Id: I69a85a9fc5179d984325747c63b3bb52a0153b22
2021-12-27 12:03:58 +09:00
Takashi Kajinami
1f43e25cc7 Allow customizing separator for api-paste.ini
The api-paste.ini accepts not only "=" but also ":" and some services
like Barbican have been using ":" for their default api-paste.ini
files.

[composite:main]
use = egg:Paste#urlmap
/: barbican_version
/v1: barbican-api-keystone

This change allows users to use ":" so that they can update the ini
files with keeping it consistent with the default fules

Depends-on: https://review.opendev.org/813614
Change-Id: I8ebe0c65b0e71380ba5a58a81b57e595e8dd29f8
2021-10-15 13:57:01 +09:00
Takashi Kajinami
414830e48b Remove the deprecated nova_api_paste_ini resource type
Change-Id: I7868ad180e5691b94507b09fc5b61459ed7265e0
2021-10-15 13:57:01 +09:00
Rajesh Tailor
448c9d3517 Enable support for Libvirt modular daemons
This change enables support for modular libvirt
daemon configurations.

NOTE: As of now, this change doesn't handle any modular daemons
socket configuration.

Change-Id: I90c3dd7bd63f9f54e43eee7bc2f58d165ca80e57
2021-09-28 23:34:14 +09:00
Takashi Kajinami
55874cb8ea Remove resource types to manage security groups and rules
The nova_security_group resource type and the nova_security_rule
resource type are dependent on subcommands of nova cli which were
already removed during Pike cycle[1][2]. This change removes these
invalid resource types.

Deprecation process is skipped because these resource types have not
worked as intended for a long period and we don't expect any user is
still using these invalid implementations.

[1] security group      : a298b29cc7e6b7330945b1890f0a4bd4c9f3fde6
[2] security groip rules: 0896bdc52a307c0b9598da0b6b837a95f0c00b9a

Closes-Bug: #1941947
Change-Id: Ic72911bab169b0ab171a1701b6871a3d03f7951b
2021-08-28 22:40:34 +09:00
Erik Berg
7111aa75f9 Allow for a more permissible regex
Some openstack installations use characters that are not in \w, the
old regex, now moved to string2hash was more permissible, and
there's probably no reason the regex in pythondict2hash can't be
just as permissible.

Change-Id: I35b964d96e6a558f1a10daa2391a398db60ea800
2021-08-09 11:37:46 +02:00
Takashi Kajinami
26dbd52717 Libvirt: quote config parameters in resource types
This change implements the quote parameter in libvirtd_config and
virtlogd_config, so that we can quote the value by that simple
parameter instead of implementing a logic in each manifests.

Also, with this change libvirtd_config and virtlogd_config supports
$::os_service_default, so that we can define absence of parameters more
easily.

Depends-on: https://review.opendev.org/792735
Change-Id: I3030ca34088019be932a9cc33344f7fb473a9aea
2021-06-22 16:13:52 +05:30
Zuul
0367a5ceed Merge "Clean up floating ip pool management for nova-network" 2021-04-27 12:11:00 +00:00
Zuul
c9234bcaed Merge "Debian api_uwsgi_config: Switch to :ini_setting" 2021-04-26 16:27:21 +00:00
Takashi Kajinami
1c0a03c6d8 Clean up floating ip pool management for nova-network
... because it was deprecated during the previous cycle and has been
useless since nova-network was removed.

Change-Id: If637debcd25b17183311e16e1bf5b76c453c634f
2021-04-26 22:08:55 +09:00
Zuul
5d18eb4152 Merge "nova_flavor: Accept array format about access_project_ids" 2021-04-20 15:21:42 +00:00
Thomas Goirand
98f286cd7b Debian api_uwsgi_config: Switch to :ini_setting
On each puppet run, I'm seeing:
value changed ['12'] to '12' (corrective)

Therefore, this patch switches from :openstackconfig to :ini_setting
to make runs indenpotant.

Change-Id: I2bd2a61263db8d7e54397ab85b4c51b79644adf2
2021-04-20 17:03:48 +02:00
Takashi Kajinami
86764de9cd nova_flavor: Accept array format about access_project_ids
The latest openstackclient doesn't show none but empty array([]) when
no access_project_ids is set for an flavor.
This change ensure that array format is properly handled to avoid
error during updating nova flavor using the nova_flavor resource.

Closes-Bug: #1924222
Change-Id: I976f70f1f4015536201c6c3acac3f1e4dbca4ccb
2021-04-15 14:31:00 +09:00
Thomas Goirand
8334bd3666 Add support for nova_api_{metadata_,}uwsgi_config in Debian
This patch is adding the configuration of the number of workers,
threads, and the size of the listen queue in Debian, which uses
uwsgi to run Nova API and api-metadata. Therefore, this patch adds
two new nova_api_uwsgi_config and nova_api_metadata_uwsgi_config
providers as well as two new nova::wsgi::uwsgi_api and
nova::wsgi::uwsgi_api_metadata classes.

Change-Id: Idd141edc5cddcfd79cf23e2041dbd1ce6a8252a8
2021-04-11 00:19:00 +02:00
Takashi Kajinami
1f1428e01b Fix wrong notification between api service and httpd
nova-api service should be stopped before httpd service is started,
thus nova-api should notify httpd.

Change-Id: Ibffb65269daaeca62554cfbecb536361ab70611a
2020-10-19 07:55:08 +09:00
Takashi Kajinami
924e9d3f02 Deprecate floating ip pool management for nova-network
Change-Id: If6bd13bed00ab954eb2b920dd5f1a59fcbeee736
2020-08-27 08:48:54 +09:00
Takashi Kajinami
fa5e4ff7cb Use anchor to require necessary packages
... so that correct packages are required according without re-defining
them in resource implementations.

Change-Id: If3ae4736d655975d83f49676b8128d4e9f8b0cf4
2020-05-04 03:18:02 +09:00
Takashi Kajinami
b5c5d7acc3 Rename nova_paste_api_ini to nova_api_paste_ini
... so that the name is consistent with the other puppet modules.

Change-Id: I8237b7760f3f7a7bf2806524b2582ef85d3bc6d5
2020-05-03 00:34:19 +09:00
Takashi Kajinami
bccf7a3959 Refer keystone_authtoken instead of neutron to detect region
... because we generally use parameters under keystone_authtoken
to find credentials.

This patch also removes useless and incorrect handling about keystone
version, so that domain parameters are correctly set.

Change-Id: Ibfd489e977e8f8f52defecacc00cb8afcd1596a1
2020-04-15 11:07:04 +09:00
Takashi Kajinami
9e07a3f69a Add support to configure virtlogd
Add a new class nova::compute::libvirt::virtlogd to manage virtlogd
configuration, which is located in /etc/libvirt/virtlogd.conf.

Change-Id: Iddfec9557ac93935744aa96b813eb54bda876deb
2019-12-10 21:31:40 +09:00
Emilien Macchi
edcd126dab Fix properties in nova_aggregate provider for osc >= 4.0.0
Similar to I6a68505d15473b140c85a199a09d2fee45864800

Openstackclient 4.0.0 changed the way some properties are displayed
on screen.

Old:
...,"Properties"
...,"foo='bar'"

New:
...,"Properties"
...,"{u'foo': u'bar'}"
or
...,"{'foo': 'bar'}"

This is breaking idempotency on the nova_aggregate provider, since it
does not detect them correctly. This patch aims at fixing this, by
trying to detect the new format, and using JSON parsing in that case.

Closes-Bug: #1845616
Depends-On: https://review.opendev.org/#/c/685537/
Change-Id: I7e8fef9fdb913e53fa459ce09577f574fd059a13
2019-09-30 15:18:32 -04:00
Zuul
a6e7f4cf12 Merge "Remove nova-network code" 2019-05-22 22:59:23 +00:00
Brian Haley
b3028e63ee Change to use non-deprecated security group rule syntax
--src-ip and --src-group were deprecated in 2016, change
to use --remote-ip and --remote-group, respectively.
Related to https://review.opendev.org/#/c/659400/

Change-Id: Ie609380b130410e3548eeacffd72871c6b5722ea
2019-05-16 10:51:27 -04:00
Tobias Urdin
8cae2def75 Remove nova-network code
These was deprecated last cycle and can now be removed.

Depends-On: https://review.opendev.org/#/c/658557/
Change-Id: I6f7fde1f475acec82bafc66183211f317b4c7795
2019-05-11 21:23:36 +02:00
Tobias Urdin
5302224c85 Remove cells v1 code
Removes all the deprecated cells v1 code that was
deprecated in the Stein release.

Change-Id: I9171fbb957174b60b4f69bab48d1386b523af3bd
2019-05-01 01:09:22 +02:00
Tobias Urdin
d65396b7b4 Use puppet4 functions-api
Change-Id: I3aad89ddc53d08c4357dd278f8dc6560137ab0ae
2018-12-17 23:22:34 +00:00
Zuul
aea8506c0a Merge "Deprecate nova-network code" 2018-11-19 03:54:30 +00:00
Tobias Urdin
fa8660917a Add cells v1 deprecation notice and remove broken code
In Nova cells v1 has been deprecated since Ocata but we
have no notices about it. This adds warnings about it
being deprecated and will be removed.

The functionality in nova::cells when passing create_cells
parameter is broken and has therefore been removed and
instead outputs a warning and is deprecated.

A known issue has been added to the release notes to inform
about this. It's probably safe to say that nobody is using it
since it has been broken since we switched over to transport_url
for rabbit, it's also safe to probably assume that no deployments
that run cell v1 right now will be running a later version of Nova.

Closes-Bug: 1687395
Change-Id: I564fc4f43a752b051280dce095a52ca4d477fb09
2018-11-02 14:59:39 +01:00
Tobias Urdin
1296187b85 Deprecate nova-network code
Nova will be removing nova-network soon, this deprecates all
the classes and parameters that are related to nova-network
and will be removed when nova removes it's support.

Please see references in nova.conf [1] and the nova release notes. [2]

[1] https://docs.openstack.org/nova/rocky/configuration/sample-config.html
[2] https://docs.openstack.org/releasenotes/nova/rocky.html

Depends-On: https://review.openstack.org/#/c/614577/
Change-Id: If87ad30e1be62cb767d98045d075340c9513bc90
2018-11-02 14:47:22 +01:00
Alex Schultz
3d877926f0 Fixup functions for 5.5.7+
Recent changes to Puppet (5.5.7+) has broken some of the legacy function
items we were doing in puppet-nova. We'll likely need to update all the
functions to the new syntax but for now this change is to address
current issues.

Change-Id: If1d675cec6fe64e8a812fb638078b0ab1c66b5de
Closes-Bug: #1799757
2018-10-25 08:12:35 -06:00
Matthias Bastian
24b9b667ed Make providers use auth_url for authentication
When reading credentials from the configuration's keystone_authtoken
section www_authenticate_uri was used as URL for Keystone.
As www_authenticate_uri is a public endpoint that is not necessarily
reachable for the Puppet agent, this change uses the more appropriate
auth_url as Keystone URL.

Change-Id: I52fdeaaf773e0fc7e111e58ffb02ef9485eed260
2018-08-06 10:45:27 +02:00