Report abuse

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
class master_concat_file {
        $content = ""
        file { "/tmp/arrayed": content => $content }
}

define entry_line() {
        include master_concat_file
        $master_concat_file::content += "$name\n"
        File <| title == "/tmp/arrayed" |> {
                content => $master_concat_file::content
        }
}

define special_line($env) {
        entry_line { "export $env special_$name": }
}

class test {
        entry_line { "cron": }
        special_line { "foo": env => "FOO=BAR", }
        entry_line { "huzzah": }
}

include test

> Produced file contents
cron
huzzah  
export FOO=BAR special_foo