README.markdown 5.32 KB
Newer Older
Adrien Thebo's avatar
Adrien Thebo committed
1
2
Puppet Gentoo Portage Module
============================
3

Theo Chatzimichos's avatar
Theo Chatzimichos committed
4
Provides Gentoo Portage features for Puppet.
5

6
Travis Test status: [![Build
Theo Chatzimichos's avatar
Theo Chatzimichos committed
7
Status](https://travis-ci.org/gentoo/puppet-portage.png?branch=master)](https://travis-ci.org/gentoo/puppet-portage)
8

Theo Chatzimichos's avatar
Theo Chatzimichos committed
9
## /etc/portage/package.\*/\*
Adrien Thebo's avatar
Adrien Thebo committed
10

Robin H. Johnson's avatar
Robin H. Johnson committed
11
12
13
14
If `target` contains a `/`, then the value of `target` will used as-is.
Otherwise it will be prefixed with the relevant directory for that resource
type.

Theo Chatzimichos's avatar
Theo Chatzimichos committed
15
### package\_use
Adrien Thebo's avatar
Adrien Thebo committed
16

17
18
    package_use { 'app-admin/puppet':
      use     => ['flag1', 'flag2'],
Adrien Thebo's avatar
Adrien Thebo committed
19
      target  => 'puppet-flags',
20
21
      version => '>=3.0.1',
      ensure  => present,
Adrien Thebo's avatar
Adrien Thebo committed
22
23
    }

Theo Chatzimichos's avatar
Theo Chatzimichos committed
24
`use` can be either a string or an array of strings.
Adrien Thebo's avatar
Adrien Thebo committed
25

Theo Chatzimichos's avatar
Theo Chatzimichos committed
26
### package\_keywords
Adrien Thebo's avatar
Adrien Thebo committed
27
28

    package_keywords { 'app-admin/puppet':
29
30
31
32
33
      keywords => ['~x86', '-hppa'],
      target   => 'puppet',
      version  => '>=3.0.1',
      ensure   => present,
    }
Adrien Thebo's avatar
Adrien Thebo committed
34

Theo Chatzimichos's avatar
Theo Chatzimichos committed
35
`keywords` can be either a string or an array of strings.
Adrien Thebo's avatar
Adrien Thebo committed
36

Theo Chatzimichos's avatar
Theo Chatzimichos committed
37
### package\_unmask
Adrien Thebo's avatar
Adrien Thebo committed
38

39
    package_unmask { 'app-admin/puppet':
Adrien Thebo's avatar
Adrien Thebo committed
40
      target  => 'puppet',
41
42
43
      version => '>=3.0.1',
      ensure  => present,
    }
Adrien Thebo's avatar
Adrien Thebo committed
44

Theo Chatzimichos's avatar
Theo Chatzimichos committed
45
46
### package\_mask

47
    package_mask { 'app-admin/puppet':
Adrien Thebo's avatar
Adrien Thebo committed
48
      target  => 'tree',
49
50
51
52
      version => '>=3.0.1',
      ensure  => present,
    }

Vikraman's avatar
Vikraman committed
53
54
55
56
57
58
59
60
61
### package\_env

    package_env { 'www-client/firefox':
      env     => 'no-lto',
      target  => 'firefox',
      version => '>=20.0',
      ensure  => present,
    }

Theo Chatzimichos's avatar
Theo Chatzimichos committed
62
`env` can be either a string or an array of strings.
Vikraman's avatar
Vikraman committed
63

Theo Chatzimichos's avatar
Theo Chatzimichos committed
64
## make.conf
65

Theo Chatzimichos's avatar
Theo Chatzimichos committed
66
The default location of `make.conf` is `/etc/portage/make.conf`
67
68
69
70
71
If you want to change it, you should do the following:

    class { 'portage':
      make_conf = '/etc/make.conf',
    }
Adrien Thebo's avatar
Adrien Thebo committed
72

Theo Chatzimichos's avatar
Theo Chatzimichos committed
73
In order to add entries to `make.conf`:
74

Theo Chatzimichos's avatar
Theo Chatzimichos committed
75
    portage::makeconf { 'portdir_overlay':
76
77
78
      content => '/var/lib/layman',
      ensure  => present,
    }
79
80
81
82
    portage::makeconf { 'use':
      content => ['flag1', 'flag2'],
      ensure  => present,
    }
83

84
Changes in make.conf will also trigger re-emerge of the affected packages. You can disable this behaviour by setting `make_conf_remerge` to `false`.
85

86
87
88
89
You can also specify special content:

    portage::makeconf { 'source /var/lib/layman/make.conf': }

Theo Chatzimichos's avatar
Theo Chatzimichos committed
90
## portage::package
91
92
93
94
95
96
97
98

This module provides a wrapper to the native package type:

    portage::package { 'app-admin/puppet':
      use              => ['-minimal', 'augeas'],
      use_version      => '>=3.0.1',
      keywords         => ['~amd64', '~x86'],
      keywords_version => '>=3.0.1',
99
100
      mask_version     => '<=2.3.17',
      unmask_version   => '>=3.0.1',
101
      target           => 'puppet',
102
      keywords_target  => 'puppet-keywords',
103
      ensure           => '3.0.1',
104
      emerge_command   => '/usr/bin/emerge',
105
106
    }

Theo Chatzimichos's avatar
Theo Chatzimichos committed
107
If no `{keywords,use,mask,unmask}\_target` is specified, then the value of `target`
Adrien Thebo's avatar
Adrien Thebo committed
108
is being used.  The variables keywords, mask and unmask also accept the special
Theo Chatzimichos's avatar
Theo Chatzimichos committed
109
value `all`, that will create versionless entries. (This applies only to
Adrien Thebo's avatar
Adrien Thebo committed
110
portage::package, if you want versionless entries in any of the above
Theo Chatzimichos's avatar
Theo Chatzimichos committed
111
112
`package\_\*` types, you can just omit the version attribute.) Any change in
`portage::package` will also trigger the appropriate re-emerge to the affected
Adrien Thebo's avatar
Adrien Thebo committed
113
package.
114

115
116
117
118
`emerge_command` allows special behavior for install & rebuild. The package
atom will be appended automatically. This allows installing packages with
`--oneshot`, and/or other emerge arguments.

Theo Chatzimichos's avatar
Theo Chatzimichos committed
119
120
## facts

Theo Chatzimichos's avatar
Theo Chatzimichos committed
121
All `make.conf` variables and most of the `eselect` modules are shown by `facter`
Theo Chatzimichos's avatar
Theo Chatzimichos committed
122

123
124
## eselect

Theo Chatzimichos's avatar
Theo Chatzimichos committed
125
126
The `eselect` type/provider checks for the current state of an `eselect` module
(or `gcc-config`) by reading the currently selected value.
127
128
129
130
131

    eselect { 'ruby':
      set => 'ruby19',
    }

Vikraman's avatar
Vikraman committed
132
Some eselect modules have special options or submodules:
133

Vikraman's avatar
Vikraman committed
134
    eselect { 'python::python2':
Vikraman's avatar
Vikraman committed
135
136
137
138
      set => 'python2.7',
    }

    eselect { 'php::apache2':
139
140
141
      set => 'php5.3',
    }

142
143
## webapp

Theo Chatzimichos's avatar
Theo Chatzimichos committed
144
The `webapp` type/provider can be used to manage webapps via `webapp-config`.
145
146
147
148
149
150
151
152
153
154

    webapp { 'www.example.org::/app':
      appname    => 'django',
      appversion => '1.4.5',
      server     => 'nginx',
      user       => 'nginx',
      group      => 'nginx',
      secure     => 'yes',
    }

Vikraman's avatar
Vikraman committed
155
156
## layman

Theo Chatzimichos's avatar
Theo Chatzimichos committed
157
The `layman` type/provider can be used to manage overlays via `layman`.
Vikraman's avatar
Vikraman committed
158
159
160
161
162

    layman { 'x11':
      ensure => present,
    }

163
164
165
166
167
168
169
Custom overlay list can be used via `overlay_list` parameter.

    layman { 'custom-overlay':
      ensure => present,
      overlay_list => 'https://some.xml.file.somethere',
    }

Theo Chatzimichos's avatar
Theo Chatzimichos committed
170
171
172
173
174
175
176
177
178
179
180
181
182
## Installation of Gentoo tools

This module can also handle the installation of various Gentoo tools.

    class { 'portage':
      portage_ensure => '2.2.6',
      eix_ensure     => '0.29.4',
      eix_keywords   => ['~amd64', '~x86'],
    }

See `manifests/init.pp` for all the available tools that can be defined.
(It is recommended to use hiera in order to define the values)

183
184
185
186
187
188
See Also
--------

  * man 5 portage: http://www.linuxmanpages.com/man5/portage.5.php
  * man 5 ebuild: http://www.linuxmanpages.com/man5/ebuild.5.php

189
190
191
Contributors
============

192
193
194
195
196
  * [Lance Albertson](https://github.com/ramereth)
  * [Russell Haering](https://github.com/russellhaering)
  * [Adrien Thebo](https://github.com/adrienthebo)
  * [Theo Chatzimichos](https://github.com/tampakrap)
  * [John-John Tedro](https://github.com/udoprog)
197
  * [Vikraman Choudhury](https://github.com/vikraman)
Theo Chatzimichos's avatar
Theo Chatzimichos committed
198
  * [Matthias Saou](https://github.com/thias)
Garrett Honeycutt's avatar
Garrett Honeycutt committed
199
  * [Garrett Honeycutt](http://learnpuppet.com)