Re: [Puppet Users] Puppet and FreeBSD

Darryl Wisneski
Mon, 23 Apr 2012 15:22:37 -0000

On Mon, Apr 23, 2012 at 10:42:53AM -0400, Christopher Wood
wrote:
> Breaking in late... I use some defaults to ensure I get binary packages out
of my local mirror. (I''m not terribly fussed about binary-only
packages, possibly because I come from a Linux background.)
>
> case $::operatingsystem {
>   freebsd: {
>     # For this we still have to specify freebsd''ish names. Instead
of
>     # ''ntp'', we have to use ''net/ntp''.
>     Package {
>       provider => ''freebsd'',
>       source =>
''http://repos/pub/FreeBSD/ports/amd64/packages-9.0-release/'',
>     }
>   }
> }


That repository source statement is pretty powerful stuff and will
help us out extremely here.  Have you tried to get puppet to do
make install?  The outcome is probably too variable anyhow.

That is pretty clear case syntax too.  I have seen that on the
puppetlabs site too.

Here is some background on the freebsd provider giving the error:
"not in required origin format:
.*/<port_category>/<port_name>"

http://www.mail-archive.com/puppet-dev@googlegroups.com/msg13765.html

>
> Then as mentioned above:
>
> package { ''net/ntp'': }
>
> I found that if I specified other styles of package names with the freebsd
package provider they would be reinstalled with every puppet run.
>

I have been OK specifying only the package and not half of the ports
directory tree so far.

> For some modules I use the ''include
"module::$operatingsystem"'' syntax, for others I use a case
statement. I''m still undecided which is better, but so far it depends
how much systems diverge from each other on a per-module basis.
>
>
> On Mon, Apr 23, 2012 at 07:08:48AM -0700, Jamie Scott wrote:
> >    dkw, that worked!
> >
> >    Now I only need to use: package { ''mytop'': ensure
=> installed }
> >
> >    I can''t tell you how happy I am!
> >
> >    Thank you!!!
> >    Jamie
> >
> >    On Monday, 23 April 2012 14:54:03 UTC+1, dkw wrote:
> >
> >      Howdy:
> >
> >      On Mon, Apr 23, 2012 at 06:29:38AM -0700, Jamie Scott wrote:
> >      > Hello all,
> >      >
> >      > Wondering if any of you could help me.
> >      >
> >      > We''ve been using puppet on our CentOS servers for a
while now with no
> >      > problems at all, very much out of the box.... but we do have
some
> >      MySQL
> >      > servers running FreeBSD (for the slightly better memory
utilisation).
> >      I''ve
> >      > taken up the challenge to get these FreeBSD servers talking
to our
> >      puppet
> >      > master but I''m having no ends of trouble with
trying to get the
> >      manifests
> >      > working. Forgetting the operating system variables and just
going for
> >      a
> >      > straight install of a package such as mytop this is what I
have tried
> >      in
> >      > our manifest:
> >      >
> >      > This didn''t seem to work at all:
> >      >
> >      > ? ? ?package { ''mytop'': ensure =>
installed } ? ?
> >      > >
> >      >
> >      > ?Gave me this message on the server: *puppet-agent[3232]:
> >      > (/Stage[main]/Node[###########]/Package[mytop]/ensure)
change from
> >      absent
> >      > to present failed: mytop: not in required origin format:
> >      > .*/<port_category>/<port_name>*
> >      >
> >
> >      To get rid of this error you have to build the puppet from ports
> >      on the freebsd client host and uncheck the PACKAGE_ORIGIN option.
> >      I don''t pretend to understand why.
> >
> >      cd /usr/ports/sysutils/puppet ; make install
> >
> >      # cat /var/db/ports/puppet/options
> >      # This file is auto-generated by ''make config''.
> >      # No user-servicable parts inside!
> >      # Options for puppet-2.7.12
> >      _OPTIONS_READ=puppet-2.7.12
> >      WITHOUT_MONGREL=true
> >      WITHOUT_PACKAGE_ORIGIN=true
> >      WITHOUT_PACKAGE_ROOT=true
> >
> >      The below package stanza looks correct.
> >
> >      -dkw
> >
> >      >
> >      > So instead I tried listing the full port name even with the
provider:
> >      >
> >      > ? ? package { ''.*/databases/mytop'':
> >      > > ? ? ? ? ? ? ensure => installed,
> >      > > ? ? ? ? ? ? provider => freebsd,
> >      > > ? ? ? ? ? ? } ? ?
> >      > >
> >      > ?
> >      > Now it is giving me this message: *puppet-agent[3232]:
> >      (/Stage[main]//Node[*
> >      > *###########**]/Package[.*/databases/mytop]/ensure) change
from absent
> >      to
> >      > present failed: Could not fetch ports INDEX: 500 Illegal
PORT range
> >      > rejected.*
> >      >
> >      > Even with specifiying a source:
> >      >
[1]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/
> >      ?I don''t
> >      > seem to be getting very far!
> >      >
> >      > Here is a print out of the debug log:
> >      >
> >      > debug: Puppet::Type::Package::ProviderFreebsd: Executing
> >      > > ''/usr/sbin/pkg_info -aoQ''
> >      > > debug: Package: .*/databases/mytop: origin =>
{:port_name=>"mytop",
> >      > > :port_category=>"databases"}
> >      > > debug: Package: .*/databases/mytop: source =>
#<URI::FTP:0x29869038
> >      > >
> >
URL:[2]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/>
> >      > > debug: Fetching INDEX: #<URI::FTP:0x298684e4
> >      > >
> >
URL:[3]ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/INDEX.bz2>
> >      > > err:
> >      > >
> >
/Stage[main]//Node[[4]boomer.sov.m-w.co.uk]/Package[.*/databases/mytop]/ensure:
> >      > > change from absent to present failed: Could not fetch
ports INDEX:
> >      500
> >      > > Illegal PORT range rejected.
> >      > >
> >      >
> >      > Some odd behaviour I''ve noticed as well, when
packages are already
> >      > installed it doesn''t seem to register as them being
there.
> >      >
> >      > Looking for information about puppet on FreeBSD is like
trying to find
> >      a
> >      > needle in a haystack. I hope someone can help, any input
would be
> >      > appreciated!
> >      >
> >      > --
> >      > You received this message because you are subscribed to the
Google
> >      Groups "Puppet Users" group.
> >      > To view this discussion on the web visit
> >      [5]https://groups.google.com/d/msg/puppet-users/-/Bzhfr9UMSNEJ.
> >      > To post to this group, send email to
[6]puppet-users@googlegroups.com.
> >      > To unsubscribe from this group, send email to
> >      [7]puppet-users+unsubscribe@googlegroups.com.
> >      > For more options, visit this group at
> >      [8]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 view this discussion on the web visit
> >    [9]https://groups.google.com/d/msg/puppet-users/-/IXZpcVO-beAJ.
> >    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/i386/packages-9.0-release/
> >    2.
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/
> >    3.
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/INDEX.bz2
> >    4. http://boomer.sov.m-w.co.uk/
> >    5. https://groups.google.com/d/msg/puppet-users/-/Bzhfr9UMSNEJ
> >    6. mailto:puppet-users@googlegroups.com
> >    7. mailto:puppet-users%2Bunsubscribe@googlegroups.com
> >    8. http://groups.google.com/group/puppet-users?hl=en
> >    9. https://groups.google.com/d/msg/puppet-users/-/IXZpcVO-beAJ
>
> --
> You received this message because you are subscribed to the Google Groups