Defined Type: trafficserver::layout

Defined in:
modules/trafficserver/manifests/layout.pp

Overview

Parameters:

  • paths (Trafficserver::Paths)
  • bins (Array[Stdlib::Absolutepath]) (defaults to: [ '/usr/bin/traffic_crashlog', '/usr/bin/traffic_ctl', '/usr/bin/traffic_layout', '/usr/bin/traffic_logcat', '/usr/bin/traffic_logstats', '/usr/bin/traffic_manager','/usr/bin/traffic_server', '/usr/bin/traffic_top', '/usr/bin/traffic_via', '/usr/bin/tspush' ])
  • sbins (Array[Stdlib::Absolutepath]) (defaults to: [])


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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'modules/trafficserver/manifests/layout.pp', line 1

define trafficserver::layout(
    Trafficserver::Paths $paths,
    Array[Stdlib::Absolutepath] $bins = [
                                            '/usr/bin/traffic_crashlog', '/usr/bin/traffic_ctl', '/usr/bin/traffic_layout',
                                            '/usr/bin/traffic_logcat', '/usr/bin/traffic_logstats',
                                            '/usr/bin/traffic_manager','/usr/bin/traffic_server', '/usr/bin/traffic_top',
                                            '/usr/bin/traffic_via', '/usr/bin/tspush'
                                        ],
    Array[Stdlib::Absolutepath] $sbins = [],
) {
    if !defined(File[$paths['base_path']]) {
        file { $paths['base_path']:
            ensure => directory,
            owner  => $trafficserver::user,
            mode   => '0755',
        }
    }

    file { "/etc/trafficserver/${title}-layout.yaml":
        ensure  => file,
        owner   => $trafficserver::user,
        mode    => '0400',
        content => template('trafficserver/layout.yaml.erb'),
        require => Package['trafficserver'],
    }

    file { $paths['prefix']:
        ensure  => directory,
        owner   => 'trafficserver',
        mode    => '0555',
        require => File[$paths['base_path']],
    }

    file { "${paths['prefix']}/runroot.yaml":
        ensure  => file,
        owner   => $trafficserver::user,
        mode    => '0400',
        content => template('trafficserver/layout.yaml.erb'),
        require => File[$paths['prefix']],
    }

    file { $paths['bindir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0555',
        require => File[$paths['prefix']],
    }

    # populate bindir with symlinks to $bins
    $bins.each |Stdlib::Absolutepath $bin| {
        $filename = basename($bin)
        file { "${paths['bindir']}/${filename}":
            ensure  => link,
            target  => $bin,
            require => File[$paths['bindir']],
        }
    }

    file { $paths['sbindir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0555',
        require => File[$paths['prefix']],
    }

    # populate sbindir with symlinks to $sbins
    $sbins.each |Stdlib::Absolutepath $sbin| {
        $filename = basename($sbin)
        file { "${paths['sbindir']}/${filename}":
            ensure  => link,
            target  => $sbin,
            require => File[$paths['sbindir']],
        }
    }

    file { $paths['sysconfdir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0555',
        require => File[$paths['prefix']],
    }

    file { $paths['includedir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0555',
        require => File[$paths['prefix']],
    }

    file { $paths['runtimedir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0755',
        require => File[$paths['localstatedir']],
    }

    file { $paths['logdir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0755',
        require => File[$paths['localstatedir']],
    }

    file { $paths['localstatedir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0755',
        require => File[$paths['prefix']],
    }

    file { $paths['cachedir']:
        ensure  => directory,
        owner   => $trafficserver::user,
        mode    => '0755',
        require => File[$paths['localstatedir']],
    }
}