1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'manifests/consumer.pp', line 1
class pulp::consumer($ensure = 'present', $server = $::fqdn, $conf_template = 'pulp/consumer.conf.erb') {
package { [ 'pulp-agent',
'pulp-consumer-client',
'pulp-puppet-consumer-extensions',
'pulp-puppet-handlers',
'pulp-rpm-consumer-extensions',
'pulp-rpm-handlers',
'pulp-rpm-yumplugins' ]:
ensure => $ensure
}
# For the template
$pulp_server = $server
if $ensure == 'absent' {
file { '/etc/pulp/consumer/consumer.conf':
ensure => 'absent',
}
service { 'pulp-agent':
ensure => 'stopped',
before => Package['pulp-agent']
}
} else {
file { '/etc/pulp/consumer/consumer.conf':
ensure => 'present',
owner => 'root',
group => 'root',
mode => '644',
content => template($conf_template),
require => Package['pulp-consumer-client']
}
service { 'pulp-agent':
ensure => 'running',
require => Package['pulp-agent']
}
}
}
|