manifests are accessing root level templates

Bug #1187583 reported by Dan Bode
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cisco Openstack
New
Undecided
Unassigned
Grizzly
Confirmed
Medium
Dan Bode

Bug Description

Currently, the cobbler-node.pp file is accessing a root level template:

    $interfaces_file=regsubst(template("interfaces.erb"), '$', "\\n\\", "G")

This is problematic for several reasons, it requires that an extra templates directory be managed, and it is no longer recommended:

    http://docs.puppetlabs.com/guides/templating.html

I am seeing specific issues

it looks like this is the only place where this template is used, this line should be replaces with a static string.

Revision history for this message
Mark T. Voelker (mvoelker) wrote :

That was added in Pull 31 which there has been some debate about anyway. That bit probably wants backing out.

https://github.com/CiscoSystems/grizzly-manifests/pull/31

Adding Daneyon, Michael, and Ian for input based on their comments in the review.

Revision history for this message
Mark T. Voelker (mvoelker) wrote :

Also, @bodepd, can you elaborate on the "specific issues" you're seeing?

Revision history for this message
Dan Bode (bodepd) wrote :

in my case, it's just a pain to have to copy this extra template around. I saw backwards compatibility issues between 2.7 and 3.2 (I have to set templatedir in 3.2 explicitly). Research showed that this practice is no longer recommended by PuppetLabs which means that we should not be doing it (b/c it may not be supported, or may lead to unexpected behavior). It would be really easy to not do it and replace the template call with a string.

Revision history for this message
Michael Chapman (michaeltchapman) wrote : Re: [Bug 1187583] Re: manifests are accessing root level templates

I think core.pp, cobbler_node.pp and any templates required by either
should be in a separate module, not in manifests.

I would prefer the only thing in manifests to be site.pp.

 - Michael

On 6/06/13 3:10 AM, "Dan Bode" <email address hidden> wrote:

>in my case, it's just a pain to have to copy this extra template around.
>I saw backwards compatibility issues between 2.7 and 3.2 (I have to set
>templatedir in 3.2 explicitly). Research showed that this practice is no
>longer recommended by PuppetLabs which means that we should not be doing
>it (b/c it may not be supported, or may lead to unexpected behavior). It
>would be really easy to not do it and replace the template call with a
>string.
>
>--
>You received this bug notification because you are subscribed to the bug
>report.
>https://bugs.launchpad.net/bugs/1187583
>
>Title:
> manifests are accessing root level templates
>
>Status in Openstack @ Cisco:
> New
>Status in Cisco Openstack grizzly series:
> Confirmed
>
>Bug description:
> Currently, the cobbler-node.pp file is accessing a root level
> template:
>
> $interfaces_file=regsubst(template("interfaces.erb"), '$',
> "\\n\\", "G")
>
> This is problematic for several reasons, it requires that an extra
> templates directory be managed, and it is no longer recommended:
>
> http://docs.puppetlabs.com/guides/templating.html
>
> I am seeing specific issues
>
> it looks like this is the only place where this template is used, this
> line should be replaces with a static string.
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/openstack-cisco/+bug/1187583/+subscriptions

Revision history for this message
Dan Bode (bodepd) wrote :

I agree that as much logic as possible should be represented as classes in modules.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.