Puppet Gentoo

Version 2 (Anonymous, 03/13/2010 08:01 pm)

1 1
# Running Puppet on Gentoo
2 1
3 1
This page is for the documentation of any caveats or solutions
4 1
related to running Puppet under Gentoo.
5 1
6 1
## Installation
7 1
8 1
Installation is simple, Puppet is in the portage tree and can be
9 1
installed with emerge. Puppet is still marked unstable so you will
10 1
need to add it to /etc/portage/package.keywords. As of June 2008,
11 1
Puppet 0.24 has been marked as stable in the tree.
12 1
13 1
The Puppet portage provider depends on information from a package
14 1
query tool:eix which needs to be initialized before it is usable.
15 1
The Puppet ebuild will warn you about this. I'd say provider
16 1
support is well rounded although lacking in the specific strengths
17 1
of Gentoo (slots and useflags).
18 1
19 1
    # eix puppet
20 1
    * app-admin/puppet
21 1
         Available versions: 0.24.4 ~0.24.7-r1 {emacs ldap rrdtool vim-syntax}
22 1
         Homepage:           http://reductivelabs.com/projects/puppet/index.html
23 1
         Description:        A system automation and configuration management software
24 1
25 1
AFAIK there is no support (yet) for any of the alternative package
26 1
managers.
27 1
28 1
## Caveats
29 1
30 1
There's a couple of things to look out for when running puppet on
31 1
gentoo
32 1
33 1
-   **Slots**:   
34 1
    Gentoo has the notion of slots, which allows you to install the
35 1
    same lib with different versions on a system. Puppet has problems
36 1
    with that because it uses the name of a package as an unique
37 1
    identifier. This doesn't work for obvious reasons
38 1
-   **USE-flags**:   
39 1
    Gentoo has USE-flags which enable or disable functionality in a
40 1
    package at compile aka install time. The package version does not
41 1
    change, but the package functionality might change drastically. The
42 1
    Puppet Gentoo provider has no support for use-flags and puppet thus
43 1
    cannot upgrade or reinstall on a use-flag change. I'm unaware of a
44 1
    elegant way of triggering a reinstall by puppet when change flags.
45 1
-   **revdep-rebuild**   
46 1
    In some cases you need to run revdep-rebuild after an upgrade of a
47 1
    package, you will need to script this, Puppet nor Gentoo can detect
48 1
    this for you Careless upgrading (with Puppet) can trigger huge
49 1
    problems. (for example do an incompatible upgrade of openssl and
50 1
    see what fails and whether or not you can still login). With the
51 1
    upcoming portage-2.2 this problem should be resolved, as it
52 1
    provides now the package-set *@preserved-rebuild*.
53 1
-   **eix-update**   
54 1
    The Puppet provider uses eix to query information about packages.
55 1
    eix uses a database for fast lookups. Keeping Puppet informed of
56 1
    possible upgrades and installed packages needs regular runs of
57 1
    eix-update.
58 1
59 1
## Bug Resolutions
60 1
61 1
-   "ensure => latest" seems to force recompile of packages, even
62 1
    when current
63 1
    -   This is caused by a bug in eix which, though passed --no-color
64 1
        as an option, renders ANSI color codes in the output. To resolve,
65 1
        upgrade eix to a version >= 0.9.4.
66 1
    -   AFAIK this still doesn't solve the entire problem, in some
67 1
        cases, particularly with slots involved eix will output multiple
68 1
        possible package versions confusing puppet into recompiling every
69 1
        run
70 1
    -   This could also be caused by resource clashing as discussed
71 1
        here ImprovedResourceIdentification?. Specifying packages like the
72 1
        following solved an issue I was facing with repeated upgrading of
73 1
        dev-db/mysql (v5.0.44) because puppet thought the currently
74 1
        installed MySQL was v5.0 (virtual/mysql 5.0):
75 1
            package { "dev-db/mysql":
76 1
                name => "mysql",
77 1
                category => "dev-db",
78 1
                ensure => latest
79 1
            }
80 1
81 1
82 1
83 1
## Helpful Links
84 1
85 1
There is an introductory discussion about running Puppet on Gentoo
86 1
[here](http://log.onthebrink.de/2008/05/using-puppet-on-gentoo.html).