summaryrefslogtreecommitdiff
path: root/README.markdown
blob: ac5ee562acf4dde432f6ccadda3ab03805826b57 (plain)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
What is it?
===========

A Puppet module that can construct files from fragments.

Please see the comments in the various .pp files for details
as well as posts on my blog at http://www.devco.net/

Released under the Apache 2.0 licence

Usage:
------

Before you can use any of the concat features you should include the class
concat::setup somewhere on your node first.

If you wanted a /etc/motd file that listed all the major modules
on the machine.  And that would be maintained automatically even
if you just remove the include lines for other modules you could
use code like below, a sample /etc/motd would be:

<pre>
Puppet modules on this server:

    -- Apache
    -- MySQL
</pre>

Local sysadmins can also append to the file by just editing /etc/motd.local
their changes will be incorporated into the puppet managed motd.

<pre>
# class to setup basic motd, include on all nodes
class motd {
   $motd = "/etc/motd"

   concat{$motd:
      owner => root,
      group => root,
      mode  => 644
   }

   concat::fragment{"motd_header":
      target => $motd,
      content => "\nPuppet modules on this server:\n\n",
      order   => 01,
   }

   # local users on the machine can append to motd by just creating
   # /etc/motd.local
   concat::fragment{"motd_local":
      target => $motd,
      ensure  => "/etc/motd.local",
      order   => 15
   }
}

# used by other modules to register themselves in the motd
define motd::register($content="", $order=10) {
   if $content == "" {
      $body = $name
   } else {
      $body = $content
   }

   concat::fragment{"motd_fragment_$name":
      target  => "/etc/motd",
      content => "    -- $body\n"
   }
}

# a sample apache module
class apache {
   include apache::install, apache::config, apache::service

   motd::register{"Apache": }
}
</pre>

Detailed documentation of the class options can be found in the
manifest files.

Known Issues:
-------------
* Since puppet-concat now relies on a fact for the concat directory,
  you will need to set up pluginsync = true for at least the first run.
  You have this issue if puppet fails to run on the client and you have
  a message similar to
  "err: Failed to apply catalog: Parameter path failed: File
  paths must be fully qualified, not 'undef' at [...]/concat/manifests/setup.pp:44".

Contributors:
-------------
**Paul Elliot**

 * Provided 0.24.8 support, shell warnings and empty file creation support.

**Chad Netzer**

 * Various patches to improve safety of file operations
 * Symlink support

**David Schmitt**

 * Patch to remove hard coded paths relying on OS path
 * Patch to use file{} to copy the resulting file to the final destination.  This means Puppet client will show diffs and that hopefully we can change file ownerships now

**Peter Meier**

 * Basedir as a fact
 * Unprivileged user support

**Sharif Nassar**

 * Solaris/Nexenta support
 * Better error reporting

**Christian G. Warden**

 * Style improvements

**Reid Vandewiele**

 * Support non GNU systems by default

**Erik Dalén**

 * Style improvements

**Gildas Le Nadan**

 * Documentation improvements

**Paul Belanger**

 * Testing improvements and Travis support

**Branan Purvine-Riley**

 * Support Puppet Module Tool better

**Dustin J. Mitchell**

 * Always include setup when using the concat define

**Andreas Jaggi**

 * Puppet Lint support

**Jan Vansteenkiste**

 * Configurable paths

Contact:
--------
R.I.Pienaar / rip@devco.net / @ripienaar / http://devco.net