rekjed wrote:
| This kind of works, but it means that I'd have to add source to all
| my classes, at which point they break on the few Linux hosts that I've
| got (I don't need to build packages for those at the moment). I'm
| also not sure whenever it will know where to fetch the dependencies
| form. So it can be done this way, but it's much more work I'd expect
| from something simple as changing the package server. If I could
| somehow set PKGROOT globally across the entire site it would kick some
| serious ass. Any help is greatly appreciated.
How about something like:
class pkgroot {
~ case $kernel {
~ linux: {}
~ default: { exec { "export PKGROOT='blah'": } }
~ }
}
Then include the class where required.
Or:
node "blah" {
~ case $kernel {
~ linux: {}
~ default: { include pkgroot }
~ }
}
and
class pkgroot {
~ exec { "export PKGROOT='blah'": }
}
Lots of different ways to skin that cat.
Regards
James Turnbull
P.S. Not tested and no coffee yet YMMV... :)
- --
James Turnbull (ja...@lovedthanlost.net)
- --
Author of:
- - Pulling Strings with Puppet
(http://www.amazon.com/gp/product/1590599780/)
- - Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)
- - Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH+qXA9hTGvAxC30ARAoSnAKCWYFP1bJheTcvtG3Oi+s462mJXxwCfWj0U
9s7Lrz2XZq+ULNiDWhdobeQ=
=zSJS
-----END PGP SIGNATURE-----
> If I could
> somehow set PKGROOT globally across the entire site it would kick some
> serious ass. Any help is greatly appreciated.
case $operatingsystem {
freebsd: {
Package { source => "/your/package/source" }
}
}
Done.
--
I cannot and will not cut my conscience to fit this year's fashions.
-- Lillian Hellman
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
On Tuesday 08 April 2008, James Turnbull wrote:
> ~ exec { "export PKGROOT='blah'": }
Wouldn't that just set the variable in the subshell?
> P.S. Not tested and no coffee yet YMMV... :)
Regards, DavidS
- --
The primary freedom of open source is not the freedom from cost, but the free-
dom to shape software to do what you want. This freedom is /never/ exercised
without cost, but is available /at all/ only by accepting the very different
costs associated with open source, costs not in money, but in time and effort.
- -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH+xCG/Pp1N6Uzh0URAjQvAJ4s3Y5/hMUSVHxPTU235+6ZQodpXACggqnY
AXxOXnrrpwTchl88mjwZoeM=
=cHjr
-----END PGP SIGNATURE-----
David Schmitt wrote:
> On Tuesday 08 April 2008, James Turnbull wrote:
>> ~ exec { "export PKGROOT='blah'": }
>
> Wouldn't that just set the variable in the subshell?
>
Yes quite correct David - it would not work - had entirely ignored the
subshell execution. Luke provided a better and working example using
resource defaults:
case $operatingsystem {
freebsd: {
Package { source => "/your/package/source" }
}
}
Apologies for misleading anyone.
Regards
James Turnbull
- --
James Turnbull (ja...@lovedthanlost.net)
- --
Author of:
- - Pulling Strings with Puppet
(http://www.amazon.com/gp/product/1590599780/)
- - Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)
- - Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iD8DBQFH+x2a9hTGvAxC30ARAkJHAKCo7eeDJow26MNVUKzMmKnVEGR2XQCfe25S
5+HUmN/AJJp3MKOmN8tOtK4=
=0YzA
-----END PGP SIGNATURE-----
I don't know how this works with BSD - with linux one has to point to
the package itself:
source => "/local/path/to/apache2-common_1.3.8.deb",
for instance.
rekjed schrieb:
- --
Phillip Scholz
Junior Linux System-Administrator
IT Shared Hosting Linux - SaaS, Karlsruhe
1&1 Internet AG
Brauerstraße 48
D-76135 Karlsruhe
Tel. +49-721-91374-4818
phillip...@1und1.de
http://www.1und1.de/
Amtsgericht Montabaur HRB 6484
Vorstand: Henning Ahlert, Ralph Dommermuth,
Matthias Ehrlich, Andreas Gauger,
Thomas Gottschlich, Matthias Greve,
Robert Hoffmann, Markus Huhn,
Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFH+4Fw1MyrzuZeshoRAm0gAJ9eJAMNP8tYWPHBAts67ozo+OY7gACdHATI
xa6L+JFVzj3InMl/HYiy/+8=
=8Fwn
-----END PGP SIGNATURE-----
> Normally, If I don't set the source, puppet will install packages with
> pkg_add -r. By default this will fetch packages from ftp.freebsd.org
> unless a different server has been set in PACKAGEROOT. The handy
> thing about PACKAGEROOT is that all I need to give it is the root of
> the package server and, as long as the package repository is layout
> properly, freebsd will take care of fetching the right package for the
> right release/architecture. If I could somehow set PACKAGEROOT in the
> environment before pupet runs I would be sorted. Otherwise there
> seems to be no easy way to change the package server across the entire
> site on freebsd. Would it be possible to add this functionality to
> puppet in the future?
Isn't there just a file on disk you can edit (using an exec, I assume)?
I think that's how people have solved it in the future.
--
It is odd, but on the infrequent occasions when I have been called upon
in a formal place to play the bongo drums, the introducer never seems
to find it necessary to mention that I also do theoretical physics.
-- Richard Feynman
Awesome solution. Please feel free to update the wiki!
--Paul