Bug #2771

file function should use puppet://url/module/ nomenclature, not absolute paths

Added by eric sorenson 10 months ago. Updated 10 months ago.

Status:Duplicate Start:11/02/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Affected version:0.25.1 Branch:
Keywords:
Votes: 0

Description

I had figured something like this would work to set the value of $cryptstring to the contents of the file at the specified location under /etc/puppet/modules/users/files/xxx:

class users::root {
    if $layer {
        $cryptstring = file("puppet:///modules/users/root.$operatingsystem.$layer")
    }
    else {
        $cryptstring = file("puppet:///modules/users/root.$operatingsystem.server")
    }

    user { "root":
        password => $cryptstring
    }
}

But instead I got:

err: Files must be fully qualified at /Users/eric/Sandbox/puppet/etc/modules/users/manifests/root.pp:6 on node leterel.foo.com

It works if I specify a full filesystem path instead of the puppet:/// url, but I think this is less than optimal, because filesystem paths move around a lot (from sandbox to production for example) and the fileserver mechanism’s used pretty much everywhere else I can find for this sort of thing. I am working up a patch to add a Puppet::Parser::Files.find_file analogous to the existing Puppet::Parser::Files.find_template but wanted to file this redmine to (a) get a sanity check that this is worth changing (and if my proposal is moving in the right direction) and (b) have a ticket to name the branch after.


Related issues

duplicates Puppet - Feature #1946: let file() obtain file contents from fileserver and/or mo... Accepted 02/08/2009

History

Updated by Luke Kanies 10 months ago

  • Status changed from Unreviewed to Duplicate

Also available in: Atom PDF