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
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'manifests/init.pp', line 9
class snap (
String[1] $package_ensure = 'installed',
Enum['stopped', 'running'] $service_ensure = 'running',
Boolean $service_enable = true,
String[1] $core_snap_ensure = 'installed',
Boolean $manage_repo = false,
Enum['present', 'installed', 'absent'] $net_http_unix_ensure = 'installed',
) {
if $manage_repo {
include epel
Yumrepo['epel'] -> Package['snapd']
}
package { 'snapd':
ensure => $package_ensure,
}
if $facts['os']['family'] == 'RedHat' {
file { '/snap':
ensure => link,
target => '/var/lib/snapd/snap',
require => Package['snapd'],
}
}
service { 'snapd':
ensure => $service_ensure,
enable => $service_enable,
require => Package['snapd'],
}
-> package { 'net_http_unix':
ensure => $net_http_unix_ensure,
provider => 'puppet_gem',
}
if $service_ensure == 'running' {
package { 'core':
ensure => $core_snap_ensure,
provider => 'snap',
require => [Package['net_http_unix'], Service['snapd']],
}
}
}
|