26 Commits

Author SHA1 Message Date
Tobias Urdin
345fac687a Fix dependency cycle
There is a dependency cycle when using the nova::compute::libvirt
class and the nova::compute::rbd class in the same manifest.

The 'set-secret-value virsh' resource says before the
nova::config::end resource but up it's dependency path the
new libvirtd-tcp sources introduced in [1] depends requires
the nova::config::end anchor.

This removes the before nova::config::end on the set-secret-value
resources and only makes it depend on the get-or-set resource.

2020-06-05 08:26:58.966645 | centos-8 | (Anchor[nova::config::end] =>
Service[libvirtd-tcp] => Service[libvirt] => Exec[get-or-set virsh
secret] => Exec[set-secret-value virsh] =>
Anchor[nova::config::end])\nTry the '--graph' option and opening the
resulting '.dot' file in OmniGraffle or GraphViz

[1] https://review.opendev.org/#/c/730689/

Change-Id: Iab96968de75d7064b3aecf266d0f24b7b98dc809
2020-06-05 09:01:57 +00:00
Tobias Urdin
7deecfbdf2 Convert all class usage to relative names
Change-Id: Ibe5a433cb67c38c0c9b05a50bffa2eda7391f241
2019-12-08 23:13:08 +01:00
zhangbailin
a5419eca27 Fix outdated links and document spelling error
Update doc links according to OpenStack document migration.
Use https instead of http for docs links.
1)http://docs.openstack.org/releasenotes/puppet-nova/
  --> https://docs.openstack.org/releasenotes/puppet-nova/
2)http://governance.openstack.org/badges/puppet-nova.svg
  --> https://governance.openstack.org/tc/badges/puppet-nova.svg
3)http://governance.openstack.org/reference/tags/index.html
  --> https://governance.openstack.org/tc/reference/tags/index.html
4)http://docs.openstack.org/infra/bindep/
  -->https://docs.openstack.org/infra/bindep/
Closes-Bug:#1717739

Change-Id: I89afa0516cc1c0f0abf390bf4425f2d0efffd603
2017-09-16 19:22:50 -07:00
Alex Schultz
ca1bdcfd7b Fix resources for latest puppet
Running the unit tests under the latest puppet fails because of
undefined resources. This change updates the references to use
collectors if they are optional or change the definitions in the files
for resources that are defined in the existing class.

Change-Id: Ic91a8d577675fd1f2fb21543320426bfe49b1a2e
Closes-Bug: #1702964
2017-08-01 22:11:46 +00:00
Rajesh Tailor
ebc69a06ba Trivial-Fix: Fix typos
Change-Id: I227375cd6cd1eef44efc986d56b5e688bc98fbc8
2017-05-15 12:54:46 +05:30
Valery Tschopp
1003a8fd86 virsh secret uuid are case insensitive
Change-Id: I3d2f13e3b4a3c4b9ef8e49cd19d12d3e866ad69b
Closes-bug: #1671029
2017-03-09 11:06:08 +01:00
Tobias Urdin
f3d1c7afe0 Fix a string only containing a variable
Changes so that a string that only contained
a variable is changed to the variable so that
the module fully passes puppet-lint without
any warnings.

Change-Id: Ie6345c849e91f8668511fffb088b207bdd426300
2016-12-09 14:46:38 +01:00
Carlos Camacho
19625e85d1 Removing WARNING: line has more than 140 characters in puppet-nova profiles
Some lint checks are returning:
WARNING: line has more than 140 characters

This patch will remove those warnings by adding \'s or
reducing variables names

Change in favor of using latest version of puppet-lint

2016-09-09 15:01:33.093779 | manifests/api.pp:415:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093857 | manifests/api.pp:513:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093882 | manifests/compute.pp:188:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093904 | manifests/compute.pp:192:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093924 | manifests/compute.pp:196:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093945 | manifests/compute.pp:204:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093966 | manifests/compute/rbd.pp:104:WARNING: line has more than 140 characters
2016-09-09 15:01:33.093986 | manifests/init.pp:598:WARNING: line has more than 140 characters
2016-09-09 15:01:33.094008 | manifests/keystone/auth.pp:114:WARNING: line has more than 140 characters
2016-09-09 15:01:33.094030 | manifests/keystone/auth.pp:115:WARNING: line has more than 140 characters
2016-09-09 15:01:33.094050 | manifests/network.pp:205:WARNING: line has more than 140 characters
2016-09-09 15:01:33.094071 | manifests/params.pp:136:WARNING: line has more than 140 characters

Change-Id: I61a4e50f8ed72907c831ea158056061e1e61aa82
2016-09-13 11:46:03 +02:00
Giulio Fidente
a2794ea407 Update virsh secret if rbd_keyring or libvirt_rbd_secret_uuid change
This change allows puppet to regenerate the virsh secret or update
its key if one of rbd_keyring or libvirt_rbd_secret_uuid change.

Closes-Bug: 1583998
Related-Bug: 1606918
Change-Id: I66d343c7c6a4ef0e7ceabe099af00a170f845b2f
Co-Authored-By: Giulio Fidente <gfidente@redhat.com>
2016-08-03 08:30:04 +08:00
Emilien Macchi
c336c7bfe5 rbd: make sure libvirt is run before get-or-set virsh secret
If we try to get-or-set virsh secret before starting libvirt, we got
this:
Failed to connect socket to '/var/run/libvirt/libvirt-sock'

Also, drop the requirement on nova::config::end Anchor for libvirt
service, that already needs to run before nova-compute service.
It's created a dependency cycle:
Anchor[nova::config::end] => Service[libvirt] => Exec[get-or-set virsh
secret] => Exec[set-secret-value virsh] => Anchor[nova::config::end]

Also, stop requiring ceph-client-package Package resource in the
'get-or-set virsh secret' Exec, since the resource is not required in
this class.

This patch is an attempt to prevent this situation and allow to deploy
nova-compute with RBD in a single Puppet run.

Change-Id: I69a7d40e7d1847be06a843986ace4f0602272fe1
2016-02-22 12:34:40 -05:00
Ivan Chavero
69870241d1 Install ceph client libraries when using rbd
Ceph client libraries might not be installed when using the
nova::compute::rbd class.

Change-Id: Icc2c8e688abbc6d8a1877bfea7be6b30204d1a52
2016-01-28 19:26:41 -08:00
Clayton O'Neill
64b1838863 Fix typo in hooks patch
Change-Id: Ifece12de086922b859cdbe57b72fbed38bb63247
2015-12-09 12:37:10 +00:00
Clayton O'Neill
cb77bc295f 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: I0b524e354b095f2642fd38a2f88536d15bcdf855
2015-12-08 10:14:11 -05:00
Derek Higgins
b3aed59424 Revert "Fixed value rbd.keyring not update"
This reverts commit 32504c8fdb221cdcce644342ed4eb18d7bacc681.
This commit has broken the trileo ceph ci with "failed to
get secret " errors.

Change-Id: Ibe137e1c511b36bc2fcd03e2ac948a74aa2593da
Closes-bug: #1502035
2015-10-02 09:31:36 +01:00
guessi
32504c8fdb Fixed value rbd.keyring not update
the value of `rbd.keyring` is protected by `creates` defined in
`get-or-set virsh secret`, with this changes, allowing system to
detect if the value of `rbd.keyring` is chnaged or not. If it's
changed puppet will regenerated with required changes, or puppet
will leave it untouched.

Change-Id: Ic683f2488123d8d751996a4ba17770d703f38e40
2015-09-24 13:58:06 +08:00
David Moreau Simard
2374ee3e2b Add parameter to control use of rbd for the ephemeral storage
Currently the rbd class configures Nova so that it uses the
rbd driver for both the ephemeral and the persistent storage.
One might want to use it to attach Cinder volumes (persistent)
but not for the ephemeral storage instead, which be on local
disks or even backed by a different driver.

This change adds a parameter to control use of rbd driver for
the ephemeral storage, setting it to true by default to
preserve the old behavior.

Co-Authored-By: Giulio Fidente <gfidente@redhat.com>
Co-Authored-By: Emilien Macchi <emilien@redhat.com>

Change-Id: I4ae0fd605c5a57aa23bea83b06530a50844d24a0
Closes-bug: 1365554
2015-06-25 12:29:11 +00:00
David Moreau Simard
7d1171986e Ensure /etc/nova exists before creating secret.xml
Without declaring a dependency, secret.xml can be
created before the folder is created through
the installation of the nova packages.

Closes-bug: #1458628
Change-Id: I0b9aec13866e4e334bcaf967192b2bc310ae20fb
2015-05-25 13:14:27 -04:00
Giulio Fidente
a8ba5a41cd Allow libvirt secret key setting from param
Currently the libvirt secret key is demanded to the ceph cluster
via the $(ceph auth get-key ...) command which requires the ceph
cluste to be already up and also assumes the computes are provisioned
with the client.admin keyring.

With this change we add a libvirt_rbd_secret_key parameter which,
if passed, is used instead so that computes can be configured
without the distribution of additional keys.

Change-Id: I70da06159c0d3c6fa204b5f7a468909ffab4d633
Closes-Bug: #1439949
2015-04-03 14:23:49 +02:00
Giulio Fidente
c44f7f023f Fix behaviour of 'set-secret-value virsh' exec
Aims at fixing two issues: we had an unless clause which was only
checking if the secret was already defined, not if the value for
the secret was set; when providing the value for the secret, we
were mistakenly referring to the secret by its XML dump instead of
its UUID.

Change-Id: I513599735e974c07a6a0e46fd319930740f259cc
Closes-Bug: #1425601
2015-03-30 18:51:22 +00:00
Clayton O'Neill
00e744a9b1 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: I48838fa11902247101c0473abff65cbb2558f609
2015-02-16 15:58:23 -05:00
David Moreau Simard
2fca925128 virsh returns a list of secret uuids, not keyring names
virsh secret-list outputs a list of secret UUIDs
and whether or not they are used. You would not
find keyring names such as client.volumes or
client.nova in there.

Change-Id: I425187f26018e7c7505fe584ac5cd50a82a32a6b
2014-09-15 07:24:24 -04:00
Jens-Christian Fischer
69b7a3c366 Don't define virsh secret if already defined
We test to see if the ceph secret already has been defined before
installing the secret again.

This is mainly done to keep our Foreman runs clean, as it reports
on hosts that have had changes applied. Without the 'unless' clause
any node that has the nova compute class installed will report as
having changes applied.

Change-Id: I05e83f07570d4a0e67a700bd9d9030eef1c261c3
2014-07-23 10:06:34 +02:00
Clayton O'Neill
cb0b48016a Allow configuring the rbd keyring name
Change-Id: I7342ec1337cf86c0e4bc66b1788e65c53b2878ce
2014-05-19 18:18:26 -04:00
Donald Talton
4fb7ee5e6f Removed references to ML2 plugin.
The plugin description was left over from the template this was built from.

Change-Id: I1fb1cfa1cc70648cdc661c650015ecfeba77eccf
2014-03-11 09:35:53 -07:00
Michael Chapman
aad7a0a7cb Fix file location for nova compute rbd secret
The rbd secret location was mixed between /etc/nova
and /etc/ceph. This patch changes the secret to
be in /etc/nova for both the file and exec
resources so that virsh secrets are set correctly

Change-Id: I50f0324d911f20d5a072c769edcf289ae59f817a
2014-02-28 22:35:35 +11:00
Emilien Macchi
076d415ba5 compute: RBD backend support
Since Havana, Nova is able to store VMs on RBD backend (ceph).

Change-Id: I17890a3e9e49572d989ad01383417b7256ef7e14
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2014-02-25 09:22:22 +01:00