FAQ
Hi,
I use puppet 2.7.16
i try to use hiera to store file data
yaml file :
apt:
'/etc/apt/preferences.d':
ensure: directory
recurse: true
source: "puppet:///$environment/$module_name/preferences.d"

When i try to use it with create_resource , it fail because $environment
and $module_name are not replace.
$instance_apt = hiera("apt")
$defauts = hiera("apt.defauts")
create_resources(file,$instance_apt,$defauts)

->
err: /Stage[main]/Apt/File[/etc/apt/preferences.d]: Failed to generate
additional resources using 'eval_generate: Error 400 on SERVER: Cannot find
file: Invalid path '$environment'


When i do the same with a hash, it work :
$defauts = hiera("apt.defauts")
$instance_apt = {
"/etc/apt/preferences.d" => {
ensure => directory,
recurse => true,
source => "puppet:///$environment/$module_name/preferences.d",
}
}
create_resources(file,$instance_apt,$defauts)

Is it a bug or a* *lack of functionality ?

Regards
Fred.




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

Search Discussions

  • Jcbollinger at Nov 26, 2012 at 2:53 pm

    On Sunday, November 25, 2012 4:45:27 AM UTC-6, Craig Dunn wrote:
    On 23/11/2012 23:03, fpommier wrote:

    Hi,
    I use puppet 2.7.16
    i try to use hiera to store file data
    yaml file :
    apt:
    '/etc/apt/preferences.d':
    ensure: directory
    recurse: true
    source: "puppet:///$environment/$module_name/preferences.d"


    Try this with;

    source: "puppet:///%{environment}/%{module_name}/preferenced.d

    Your source path confuses me a bit anyway, surely your environment
    dictates your modulepath and this should just be
    puppet:///modules/%{module_name}/preferences.d ?
    And, therefore, it's probably not useful to interpolate even the
    %{module_name}. The datum is probably used only by one module, almost
    certainly having the same name in every environment, and that module knows
    its own name. In fact, the whole thing probably ought to be written into
    the relevant class instead of being loaded indirectly via hiera.


    John

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/JbC629B-_qcJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fpommier at Nov 28, 2012 at 9:28 pm
    Hi Craig,
    Your solution solve my problem.
    Thank a lot.
    I use this path because i want to seperate statics files and data hiera
    from puppet module (for versionning and test).
    And i want also have different data with each environment.
    My fileserver.conf :
    [developpement]
    path /etc/puppet/puppetData/developpement/fichiers
    allow *

    [production]
    path /etc/puppet/puppetData/production/fichiers
    allow *

    When i try this, it don't work
    [fichiers]
    path /etc/puppet/puppetData/%{environment}/fichiers (or
    $environment)
    allow *

    May be not the best solution but it work now.

    Thank again.
    Fred

    Le dimanche 25 novembre 2012 00:45:27 UTC-10, Craig Dunn a écrit :
    On 23/11/2012 23:03, fpommier wrote:

    Hi,
    I use puppet 2.7.16
    i try to use hiera to store file data
    yaml file :
    apt:
    '/etc/apt/preferences.d':
    ensure: directory
    recurse: true
    source: "puppet:///$environment/$module_name/preferences.d"


    Try this with;

    source: "puppet:///%{environment}/%{module_name}/preferenced.d

    Your source path confuses me a bit anyway, surely your environment
    dictates your modulepath and this should just be
    puppet:///modules/%{module_name}/preferences.d ?

    Regards
    Craig

    --
    Craig Dunn
    Professional Services
    Puppet Labs Inc.http://www.puppetlabs.com
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/SwJNXsz318IJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedNov 23, '12 at 11:03p
activeNov 28, '12 at 9:28p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Fpommier: 2 posts Jcbollinger: 1 post

People

Translate

site design / logo © 2022 Grokbase