FAQ
Is there a way to define a single file resource or even exec resource
like this:

file { "$module::params::base_dir" :
ensure => "directory"
owner => "root"
group => "root",
}

file { "$module::params::base_dir/$module::params::name":
ensure => "directory"
owner => "root",
group => "root",
}

I want to define module::params::name like:

class module::params {

$name = [ dir1, dir2, dir3 ]

}

Something like that so I don't have to make a full file definition for
each directory I want to create. Each directory will reside under the
$module::params::base which would be like /home/git and each dir1,
dir2 etc.. would be like /home/git/dir1, /home/git/dir2, /home/git/
dir3 etc...

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
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

  • Dan Bode at Apr 25, 2012 at 6:15 pm
    you could do something like this:

    define loopydir() {
    file { "$module::params::base_dir/${name}":
    ensure => "directory"
    owner => "root",
    group => "root",
    }
    }

    include module::params

    file { "$module::params::base_dir" :
    ensure => "directory"
    owner => "root"
    group => "root",
    }

    loopydir{ [1,2,3]: }
    On Wed, Apr 25, 2012 at 10:57 AM, Brian Carpio wrote:

    Is there a way to define a single file resource or even exec resource
    like this:

    file { "$module::params::base_dir" :
    ensure => "directory"
    owner => "root"
    group => "root",
    }

    file { "$module::params::base_dir/$module::params::name":
    ensure => "directory"
    owner => "root",
    group => "root",
    }

    I want to define module::params::name like:

    class module::params {

    $name = [ dir1, dir2, dir3 ]

    }

    Something like that so I don't have to make a full file definition for
    each directory I want to create. Each directory will reside under the
    $module::params::base which would be like /home/git and each dir1,
    dir2 etc.. would be like /home/git/dir1, /home/git/dir2, /home/git/
    dir3 etc...

    --
    You received this message because you are subscribed to the Google Groups
    "Puppet Users" group.
    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.
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    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
postedApr 25, '12 at 5:57p
activeApr 25, '12 at 6:15p
posts2
users2
websitepuppetlabs.com

2 users in discussion

Brian Carpio: 1 post Dan Bode: 1 post

People

Translate

site design / logo © 2022 Grokbase