[openstack-dev] [puppet] including openstacklib::openstackclient

Matt Fischer matt at mattfischer.com
Wed Dec 9 00:19:09 UTC 2015


We decided in the meeting today to just to a naked include:

https://review.openstack.org/#/c/253311/
https://review.openstack.org/#/c/254824/

On Tue, Dec 8, 2015 at 11:29 AM, Cody Herriges <cody at herriges.org> wrote:

> Matt Fischer wrote:
> > I found this bug in the liberty branch [1] over the weekend in the
> > handling of openstack client between glance & keystone. As a part of
> > fixing that I've discussed with Clayton and Michael Chapman just what
> > the right way is to include the openstackclient.
> >
> > Keystone does it by conditionally including the class in client.pp [2].
> > Glance does it with an ensure_resources call in the main class [3].
> >
> > Michael Chapman was of the opinion we should just include the
> > openstacklib::openstackclient unconditionally and let hiera figure it
> > out (hope I'm paraphrasing his opinion). That is cleaner but perhaps
> > less flexible.
> >
> > Whatever solution we pick, I want to be consistent and back-portable.
> >
> > Thoughts?
> >
> >
> > [1] - https://bugs.launchpad.net/puppet-openstacklib/+bug/1523643
> > [2]-
> https://github.com/openstack/puppet-keystone/blob/master/manifests/client.pp#L20-L26
>
> This way is "ok."
>
> > [3]-
> https://github.com/openstack/puppet-glance/blob/master/manifests/init.pp#L33
>
> The glance way seems bad since it maintaining its own private
> implementation for a thing that intended to be shared.
>
>
> The best is probably to just unconditionally including
> Class[openstacklib::openstackclient] using the include function across
> all modules and removing the option for each module to override the
> package_ensure parameter for Class[openstacklib::openstackclient].
> This'll leave you open to resource conflicts based on manifest parse
> order though.  For example, if I want to set
> Class[openstacklib::openstackclient]'s package_ensure parameter to
> latest I need to declare a class resource;
>
> class { '::openstacklib::openstackclient':
>   package_ensure => $ensure,
> }
>
> This is all fine and good if I do this at the top of the manifest in my
> composite class then cross my fingers that all subsequent declarations
> of the class are using the include function.  If this happens the other
> way around Puppet will throw a duplicate resource definition error.
>
> To ease into the API and manifest change you could basically combine the
> glance and keystone example and use the ensure_resource function to
> ensure a class resource type with the name
> ::openstacklib::openstackclient exists.  That just puts you in the
> situation where the first puppet-* module class to declare it with a
> certain set of parameters will win.
>
>
> --
> Cody
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151208/25a855a6/attachment.html>


More information about the OpenStack-dev mailing list