Re: [Puppet Users] Re: How can i make a 'file' resource depend on package installation?

2012-04-23 Thread Ashley Penney
To make this work you need to have:

file { '/etc/foo':
  ensure => present,
  require => Package['SomePackage'],
}

as well as:

package { 'SomePackage':
  ensure => present,
}

The require always has to have something in Puppet to match to.  By saying
"ensure => present" you're just telling puppet "hey if this package is
installed then don't worry, otherwise install the latest version you can
find through the package manager".  As long as you have both pieces you
should be in good shape!

On Mon, Apr 23, 2012 at 5:27 AM, geog  wrote:

> thanks for clarifying that out! i'll give it a few more shots for some
> reason did not work for me.
>
> On Apr 23, 12:21 pm, "R.I.Pienaar"  wrote:
> > - Original Message -
> > > From: "geog" 
> > > To: "Puppet Users" 
> > > Sent: Monday, April 23, 2012 10:11:30 AM
> > > Subject: [Puppet Users] How can i make a 'file' resource depend on
> package installation?
> >
> > > basically i want to add to my file resource a requirements on a pre-
> > > installed package and if its not installed should be first installed.
> >
> > > file {
> > >require => Package["SomePackage"]
> > > }
> >
> > > I understand require is not supported in file resource is there any
> > > other solution to have this dependency?
> >
> > Require is whats called a meta paramater - it's supported on all
> resource types
> > including File.  Same for subscribe, notify and a few others
>
> --
> 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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: How can i make a 'file' resource depend on package installation?

2012-04-23 Thread geog
thanks for clarifying that out! i'll give it a few more shots for some
reason did not work for me.

On Apr 23, 12:21 pm, "R.I.Pienaar"  wrote:
> - Original Message -
> > From: "geog" 
> > To: "Puppet Users" 
> > Sent: Monday, April 23, 2012 10:11:30 AM
> > Subject: [Puppet Users] How can i make a 'file' resource depend on package 
> > installation?
>
> > basically i want to add to my file resource a requirements on a pre-
> > installed package and if its not installed should be first installed.
>
> > file {
> >    require => Package["SomePackage"]
> > }
>
> > I understand require is not supported in file resource is there any
> > other solution to have this dependency?
>
> Require is whats called a meta paramater - it's supported on all resource 
> types
> including File.  Same for subscribe, notify and a few others

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.