Christopher Wood
2012-Apr-06 14:58 UTC
[Puppet Users] freebsd provider keeps reinstalling packages?
Question: how do I get puppet 2.7.6 on FreeBSD 9.0-RELEASE to stop downloading
packages with every puppet run?
Obviously I''d be puppetizing the config files so this wouldn''t
be a huge big deal, but a daemon restart after every puppet run due to
notify/subscribe involving the config file isn''t optimal.
My simple manifest is this:
package { ''ntp-4.2.6p5/net/ntp'':
ensure => installed,
provider => ''freebsd'',
}
It does indeed install ntp:
[root@cwlab-01 /var/db/pkg]# /usr/sbin/pkg_info -aoQ | grep ntp
ntp-4.2.6p5:net/ntp
But every single time I run "puppet apply --debug --verbose
/tmp/ntp.pp", I get the following, indicating that the package is
reinstalled:
debug: Puppet::Type::Package::ProviderFreebsd: Executing
''/usr/sbin/pkg_info -aoQ''
debug: Package: ntp-4.2.6p5/net/ntp: origin =>
{:port_category=>"net", :port_name=>"ntp"}
debug: Package: ntp-4.2.6p5/net/ntp: source => #<URI::FTP:0x807f1f518
URL:ftp://ftp.freebsd.org/%2Fpub/FreeBSD/ports/amd64/packages-9-stable/>
debug: Fetching INDEX: #<URI::FTP:0x807f1abf8
URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/INDEX.bz2>
debug: Package: ntp-4.2.6p5/net/ntp: package_uri => #<URI::FTP:0x80b32c838
URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz>
debug: Puppet::Type::Package::ProviderFreebsd: Executing
''/usr/sbin/pkg_add -f
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz''
notice: /Stage[main]//Package[ntp-4.2.6p5/net/ntp]/ensure: created
I get the same behaviour with other package names:
ntp-4.2.6p5:/net/ntp
*/net/ntp
--
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.
Jo Rhett
2012-Apr-10 18:31 UTC
Re: [Puppet Users] freebsd provider keeps reinstalling packages?
Have you tried running that pkg_info command yourself and looking for the output? Also check the return status of the pkg_info command, make sure it returns 0. On Apr 6, 2012, at 7:58 AM, Christopher Wood wrote:> Question: how do I get puppet 2.7.6 on FreeBSD 9.0-RELEASE to stop downloading packages with every puppet run? > > Obviously I''d be puppetizing the config files so this wouldn''t be a huge big deal, but a daemon restart after every puppet run due to notify/subscribe involving the config file isn''t optimal. > > My simple manifest is this: > > package { ''ntp-4.2.6p5/net/ntp'': > ensure => installed, > provider => ''freebsd'', > } > > It does indeed install ntp: > > [root@cwlab-01 /var/db/pkg]# /usr/sbin/pkg_info -aoQ | grep ntp > ntp-4.2.6p5:net/ntp > > But every single time I run "puppet apply --debug --verbose /tmp/ntp.pp", I get the following, indicating that the package is reinstalled: > > debug: Puppet::Type::Package::ProviderFreebsd: Executing ''/usr/sbin/pkg_info -aoQ'' > debug: Package: ntp-4.2.6p5/net/ntp: origin => {:port_category=>"net", :port_name=>"ntp"} > debug: Package: ntp-4.2.6p5/net/ntp: source => #<URI::FTP:0x807f1f518 URL:ftp://ftp.freebsd.org/%2Fpub/FreeBSD/ports/amd64/packages-9-stable/> > debug: Fetching INDEX: #<URI::FTP:0x807f1abf8 URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/INDEX.bz2> > debug: Package: ntp-4.2.6p5/net/ntp: package_uri => #<URI::FTP:0x80b32c838 URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz> > debug: Puppet::Type::Package::ProviderFreebsd: Executing ''/usr/sbin/pkg_add -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz'' > notice: /Stage[main]//Package[ntp-4.2.6p5/net/ntp]/ensure: created > > > I get the same behaviour with other package names: > > ntp-4.2.6p5:/net/ntp > */net/ntp > > -- > 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. >-- Jo Rhett Net Consonance : consonant endings by net philanthropy, open source and other randomness -- 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.
Christopher Wood
2012-Apr-10 22:43 UTC
Re: [Puppet Users] freebsd provider keeps reinstalling packages?
I did, it returns all the lines installed by pkg_add, one of which is the ntp
line there.
[root@cwlab-01 /var/db/pkg]# /usr/sbin/pkg_info -aoQ | grep ntp
ntp-4.2.6p5:net/ntp
The pkg_info -aoQ definitely returns 0.
I think I''ve found the source of my confusion. I poked around inside
the provider, and while I''m not FreeBSD/ruby expert it gave me a hint.
In /usr/local/lib/ruby/site_ruby/1.8/puppet/provider/package/freebsd.rb there
are two indications of what my package should be named:
Line 51, the error I saw while working on this:
raise Puppet::Error.new "#{origin_path}: not in required origin format:
.*/<port_category>/<port_name>"
But line 8 has this note:
"The specific form of package management on FreeBSD. Resource names must be
specified as the port origin: <port_category>/<port_name>."
After reading that, I found that this manifest gives me the usual puppet
behaviour on FreeBSD 9.0-STABLE:
package { ''net/ntp'':
ensure => installed,
provider => ''freebsd'',
}
I couldn''t 100% tell you why, but it does.
On Tue, Apr 10, 2012 at 11:31:25AM -0700, Jo Rhett
wrote:> Have you tried running that pkg_info command yourself and looking for
the
> output?
> Also check the return status of the pkg_info command, make sure it
returns
> 0.
> On Apr 6, 2012, at 7:58 AM, Christopher Wood wrote:
>
> Question: how do I get puppet 2.7.6 on FreeBSD 9.0-RELEASE to stop
> downloading packages with every puppet run?
>
> Obviously I''d be puppetizing the config files so this
wouldn''t be a huge
> big deal, but a daemon restart after every puppet run due to
> notify/subscribe involving the config file isn''t optimal.
>
> My simple manifest is this:
>
> package { ''ntp-4.2.6p5/net/ntp'':
> ensure => installed,
> provider => ''freebsd'',
> }
>
> It does indeed install ntp:
>
> [root@cwlab-01 /var/db/pkg]# /usr/sbin/pkg_info -aoQ | grep ntp
> ntp-4.2.6p5:net/ntp
>
> But every single time I run "puppet apply --debug --verbose
> /tmp/ntp.pp", I get the following, indicating that the package is
> reinstalled:
>
> debug: Puppet::Type::Package::ProviderFreebsd: Executing
> ''/usr/sbin/pkg_info -aoQ''
> debug: Package: ntp-4.2.6p5/net/ntp: origin =>
{:port_category=>"net",
> :port_name=>"ntp"}
> debug: Package: ntp-4.2.6p5/net/ntp: source =>
#<URI::FTP:0x807f1f518
>
URL:ftp://ftp.freebsd.org/%2Fpub/FreeBSD/ports/amd64/packages-9-stable/>
> debug: Fetching INDEX: #<URI::FTP:0x807f1abf8
>
URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/INDEX.bz2>
> debug: Package: ntp-4.2.6p5/net/ntp: package_uri =>
> #<URI::FTP:0x80b32c838
>
URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz>
> debug: Puppet::Type::Package::ProviderFreebsd: Executing
> ''/usr/sbin/pkg_add -f
>
[1]ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz''
> notice: /Stage[main]//Package[ntp-4.2.6p5/net/ntp]/ensure: created
>
> I get the same behaviour with other package names:
>
> ntp-4.2.6p5:/net/ntp
> */net/ntp
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To post to this group, send email to [2]puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> [3]puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> [4]http://groups.google.com/group/puppet-users?hl=en.
>
> --
> Jo Rhett
> Net Consonance : consonant endings by net philanthropy, open source and
> other randomness
>
> --
> 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.
>
> References
>
> Visible links
> 1.
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/ntp-4.2.6p5.tbz''
> 2. mailto:puppet-users@googlegroups.com
> 3. mailto:puppet-users+unsubscribe@googlegroups.com
> 4. 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.