Hello All,
I have quick question for you; How can I pass a variable to a
static file that I''m distributing via puppet? i.g, :
class abc {
file { "/etc/abc.conf":
ensure => present
source => "puppet:///sys/abc.conf}
}
puppet:///sys/abc.conf contains :
rundir= /central/$hostname/
logdir= $hostname.log
Can this be done?
--
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.
On Fri, Jun 18, 2010 at 11:47 AM, CraftyTech <hmmedina@gmail.com> wrote:> Hello All, > > I have quick question for you; How can I pass a variable to a > static file that I''m distributing via puppet? i.g, : > class abc { > file { "/etc/abc.conf": > ensure => present > source => "puppet:///sys/abc.conf} > } > > > puppet:///sys/abc.conf contains : > > rundir= /central/$hostname/ > logdir= $hostname.log > > Can this be done?You should probably look at using templates instead. http://projects.reductivelabs.com/projects/puppet/wiki/Puppet_Templating> > -- > 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. > >-- nigel -- 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.
Yeah, that looks better. Thanks. On Jun 18, 2:49 pm, Nigel Kersten <nig...@google.com> wrote:> On Fri, Jun 18, 2010 at 11:47 AM, CraftyTech <hmmed...@gmail.com> wrote: > > Hello All, > > > I have quick question for you; How can I pass a variable to a > > static file that I''m distributing via puppet? i.g, : > > class abc { > > file { "/etc/abc.conf": > > ensure => present > > source => "puppet:///sys/abc.conf} > > } > > > puppet:///sys/abc.conf contains : > > > rundir= /central/$hostname/ > > logdir= $hostname.log > > > Can this be done? > > You should probably look at using templates instead. > > http://projects.reductivelabs.com/projects/puppet/wiki/Puppet_Templating > > > > > -- > > 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 athttp://groups.google.com/group/puppet-users?hl=en. > > -- > nigel-- 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.
spawn-puppet@adamsclan.org
2010-Jun-19 04:31 UTC
Re: [Puppet Users] passing variables to static files
As another option, I believe you can use:
file { "/etc/abc.conf":
ensure => present
content => "rundir= /central/$hostname/\nlogdir=
$hostname.log"
}
- Jeff
On 06/18/2010 01:49 PM, Nigel Kersten wrote:> On Fri, Jun 18, 2010 at 11:47 AM, CraftyTech<hmmedina@gmail.com>
wrote:
>> Hello All,
>>
>> I have quick question for you; How can I pass a variable to a
>> static file that I''m distributing via puppet? i.g, :
>> class abc {
>> file { "/etc/abc.conf":
>> ensure => present
>> source => "puppet:///sys/abc.conf}
>> }
>>
>>
>> puppet:///sys/abc.conf contains :
>>
>> rundir= /central/$hostname/
>> logdir= $hostname.log
>>
>> Can this be done?
>
> You should probably look at using templates instead.
>
> http://projects.reductivelabs.com/projects/puppet/wiki/Puppet_Templating
>
>
>
>>
>> --
>> 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.
Thanks for example. Cheers, On Jun 19, 12:31 am, spawn-pup...@adamsclan.org wrote:> As another option, I believe you can use: > > file { "/etc/abc.conf": > ensure => present > content => "rundir= /central/$hostname/\nlogdir> $hostname.log" > } > > - Jeff > > On 06/18/2010 01:49 PM, Nigel Kersten wrote: > > > > > On Fri, Jun 18, 2010 at 11:47 AM, CraftyTech<hmmed...@gmail.com> wrote: > >> Hello All, > > >> I have quick question for you; How can I pass a variable to a > >> static file that I''m distributing via puppet? i.g, : > >> class abc { > >> file { "/etc/abc.conf": > >> ensure => present > >> source => "puppet:///sys/abc.conf} > >> } > > >> puppet:///sys/abc.conf contains : > > >> rundir= /central/$hostname/ > >> logdir= $hostname.log > > >> Can this be done? > > > You should probably look at using templates instead. > > >http://projects.reductivelabs.com/projects/puppet/wiki/Puppet_Templating > > >> -- > >> 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 athttp://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.