file() function requires absolute paths?

1,900 views
Skip to first unread message

Dan Urist

unread,
Sep 9, 2010, 1:19:37 PM9/9/10
to puppet...@googlegroups.com
I have the following in my puppet.conf, to define an environment called
"dev":

> [dev]
> manifest=/usr/local/puppet/dev/site.pp
> modulepath=/usr/local/puppet/dev/modules/package:/usr/local/puppet/dev/modules/node

My rationale for this is that I'm splitting my modules into two
types-- a "package" type that handles configuration of individual
packages and is generic, and a "node" type that defines classes of
nodes and has site-specific configuration.

I have the following in one of my node classes:

> include monit
> monit::monitrc { "monitrc":
> content => file("puppet://$servername/modules/vserver/monitrc")
> }

The absolute path of the monitrc file is
"/usr/local/puppet/dev/modules/node/vserver/files/monitrc".

Unfortunately, this is giving me the error "Files must be fully
qualified". I've also tried a "puppet:///" URL and a relative path with
the same result. Does the file() function only support fully qualified
paths? This seems inconsistent, since the template() function
appears to support at least relative paths according to
http://docs.reductivelabs.com/guides/modules.html.
--
Dan Urist
dur...@ucar.edu
303-497-2459

Jeff McCune

unread,
Sep 9, 2010, 1:24:13 PM9/9/10
to puppet...@googlegroups.com
On Thu, Sep 9, 2010 at 10:19 AM, Dan Urist <dur...@ucar.edu> wrote:
[snip]

> Does the file() function only support fully qualified
> paths?

Yes. I recommend looking into copying the logic from the template()
function into the file() function and submitting a patch.
Alternatively, you could use the template() function and just not have
any erb in the template.

--
Jeff McCune
http://www.puppetlabs.com/

Dan Urist

unread,
Sep 9, 2010, 1:39:14 PM9/9/10
to puppet...@googlegroups.com, je...@puppetlabs.com
On Thu, 9 Sep 2010 10:24:13 -0700
Jeff McCune <je...@puppetlabs.com> wrote:

> On Thu, Sep 9, 2010 at 10:19 AM, Dan Urist <dur...@ucar.edu> wrote:
> [snip]
> > Does the file() function only support fully qualified
> > paths?
>
> Yes. I recommend looking into copying the logic from the template()
> function into the file() function and submitting a patch.
> Alternatively, you could use the template() function and just not have
> any erb in the template.
>

Thanks for the clarification; unfortunately I don't have time to work
up a patch, but I have submitted a feature request:
http://projects.reductivelabs.com/issues/4749

Eric Sorenson

unread,
Sep 9, 2010, 1:54:08 PM9/9/10
to puppet...@googlegroups.com, je...@puppetlabs.com
This was already covered under a couple of earlier bugs. The original was:

http://projects.puppetlabs.com/issues/1946

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>

Reply all
Reply to author
Forward
0 new messages