File tree Expand file tree Collapse file tree 3 files changed +78
-47
lines changed Expand file tree Collapse file tree 3 files changed +78
-47
lines changed Original file line number Diff line number Diff line change 1
- name ' alkivi-motd'
2
- version ' 0.0.3'
3
- source ' https://github.com/alkivi-sas/puppet-motd'
4
- author ' alkivi'
5
- license ' LGPLv3'
6
- summary ' Controls motd file on unix system'
7
- description ' Setup motd and give hability to register module'
8
- project_page ' https://github.com/alkivi-sas/puppet-motd'
9
- dependency ' puppetlabs/concat' , ' 1.0.0'
1
+ name ' alkivi-motd'
2
+ version ' 0.0.3'
3
+ source ' https://github.com/alkivi-sas/puppet-motd'
4
+ author ' alkivi'
5
+ license ' LGPLv3'
6
+ summary ' Controls motd file on unix system'
7
+ description ' Setup motd and give hability to register module'
8
+ project_page ' https://github.com/alkivi-sas/puppet-motd'
9
+ dependency ' puppetlabs/concat' , ' 1.0.0'
Original file line number Diff line number Diff line change 1
- class motd (
2
- $motd = ' /etc/motd' ,
3
- $headers = false ,
4
- ) {
5
-
6
- concat { $motd:
7
- owner => root,
8
- group => root,
9
- mode => ' 0644' ,
10
- }
11
-
12
- # Add base info if necessary
13
- if ($headers )
14
- {
15
- concat::fragment {'motd_header' :
16
- target => $motd ,
17
- content => template (' motd/header.erb' ),
18
- order => 01,
19
- }
20
- }
21
-
22
- }
23
-
1
+ # == Class: motd
2
+ #
3
+ # configures concat target file with, optionally, a header.
4
+ #
5
+ # == parameters
6
+ #
7
+ # [*motd*]
8
+ # The path to our motd file
9
+ #
10
+ # [*headers*]
11
+ # If true, create a header file at the top of the concatted motd file.
12
+ # Defaults to false
13
+ #
14
+ # [*template*]
15
+ # Template to use to create headers.
16
+ # Defaults to a rather fetching graphic.
17
+ #
18
+ class motd (
19
+ $motd = ' /etc/motd' ,
20
+ $headers = false ,
21
+ $template = ' motd/header.erb' ,
22
+ ) {
23
+
24
+ concat { $motd:
25
+ owner => root,
26
+ group => root,
27
+ mode => ' 0644' ,
28
+ }
29
+
30
+ # Add base info if necessary
31
+ if ($headers )
32
+ {
33
+ concat::fragment {'motd_header' :
34
+ target => $motd ,
35
+ content => template ($template ),
36
+ order => 01,
37
+ }
38
+ }
39
+
40
+ }
41
+
Original file line number Diff line number Diff line change 1
- define motd::register ($content = ' ' , $order = 10) {
2
- if ($content == ' ' )
3
- {
4
- $body = " -- ${name} \n "
5
- }
6
- else
7
- {
8
- $body = $content
9
- }
10
-
11
- concat::fragment {"motd_fragment_${name}" :
12
- target => $motd::motd ,
13
- content => $body ,
14
- }
15
- }
1
+ # == Define: motd::register
2
+ #
3
+ # Can be used to add snippets to our motd file.
4
+ #
5
+ # == Parameters
6
+ #
7
+ # [*content*]
8
+ # The content of our fragment.
9
+ # Defaults to the name/title of the resource, prepended by '--'.
10
+ # Useful for listing things like applied classes.
11
+ #
12
+ # [*order*]
13
+ # The order in which our fragment should appear in the target file.
14
+ # Defaults to '10'.
15
+ #
16
+ define motd::register (
17
+ $content = " -- ${name} \n " ,
18
+ $order = ' 10' ,
19
+ ) {
20
+
21
+ include ::motd
22
+ concat::fragment {"motd_fragment_${name}" :
23
+ target => $motd::motd ,
24
+ content => $content ,
25
+ order => $order ,
26
+ }
27
+
28
+ }
You can’t perform that action at this time.
0 commit comments