provizioning 0.1.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/README.md +29 -0
  4. data/Rakefile +2 -0
  5. data/bootstrap/bootstrap.sh +71 -0
  6. data/{lib/templates/sources.list → bootstrap/lucid.sources.list} +2 -1
  7. data/bootstrap/natty.sources.list +14 -0
  8. data/lib/provizioning/puppet.rb +94 -0
  9. data/lib/provizioning/version.rb +3 -0
  10. data/lib/provizioning.rb +1 -3
  11. data/provizioning.gemspec +20 -0
  12. data/puppet/classes/apache/centos.conf +978 -0
  13. data/puppet/classes/apache/ssl.conf +75 -0
  14. data/puppet/classes/apache.pp +152 -0
  15. data/puppet/classes/apt.pp +5 -0
  16. data/puppet/classes/base/ntp/ntpd-sysconfig +13 -0
  17. data/puppet/classes/base.pp +79 -0
  18. data/puppet/classes/freerange.pp +53 -0
  19. data/puppet/classes/gemrc/gemrc +9 -0
  20. data/puppet/classes/gemrc.pp +10 -0
  21. data/puppet/classes/imagemagick.pp +19 -0
  22. data/puppet/classes/iptables/load-iptables +3 -0
  23. data/puppet/classes/iptables/post-iptables +2 -0
  24. data/puppet/classes/iptables/pre-iptables +2 -0
  25. data/puppet/classes/iptables.pp +59 -0
  26. data/puppet/classes/logrotate/logrotate.erb +15 -0
  27. data/puppet/classes/logrotate.pp +37 -0
  28. data/puppet/classes/mongo/mongodb.conf +89 -0
  29. data/puppet/classes/mongo.pp +86 -0
  30. data/puppet/classes/monit/monit.conf +242 -0
  31. data/puppet/classes/monit.pp +39 -0
  32. data/puppet/classes/munin/plugins/passenger_memory_stats +123 -0
  33. data/puppet/classes/munin/plugins/passenger_status +130 -0
  34. data/puppet/classes/munin/plugins/rails_database_time +174 -0
  35. data/puppet/classes/munin/plugins/rails_request_duration +173 -0
  36. data/puppet/classes/munin/plugins/rails_request_error +169 -0
  37. data/puppet/classes/munin/plugins/rails_requests +175 -0
  38. data/puppet/classes/munin/plugins/rails_view_render_time +173 -0
  39. data/puppet/classes/munin/rails-plugin-config +4 -0
  40. data/puppet/classes/munin.pp +60 -0
  41. data/puppet/classes/mysql/password.erb +1 -0
  42. data/puppet/classes/mysql.pp +71 -0
  43. data/puppet/classes/openswan/ipsec.conf +17 -0
  44. data/puppet/classes/openswan/ipsec.secrets +1 -0
  45. data/puppet/classes/openswan/patched_ipsec_initd_script +223 -0
  46. data/puppet/classes/openswan/secret.erb +1 -0
  47. data/puppet/classes/openswan.pp +71 -0
  48. data/puppet/classes/post-flight.pp +17 -0
  49. data/puppet/classes/postfix/main.cf +39 -0
  50. data/puppet/classes/postfix.pp +16 -0
  51. data/puppet/classes/rack/centos/passenger.load.erb +5 -0
  52. data/puppet/classes/rack/ubuntu/passenger.conf.erb +6 -0
  53. data/puppet/classes/rack.pp +66 -0
  54. data/puppet/classes/redis/redis.conf.erb +187 -0
  55. data/puppet/classes/redis.pp +20 -0
  56. data/puppet/classes/sudo/sudoers +6 -0
  57. data/puppet/classes/sudo.pp +24 -0
  58. data/puppet/classes/syslogng/CentOS.cnf +61 -0
  59. data/puppet/classes/syslogng/Ubuntu.cnf +347 -0
  60. data/puppet/classes/syslogng.pp +146 -0
  61. data/puppet/classes/xml.pp +23 -0
  62. data/puppet/classes/yum.pp +6 -0
  63. data/puppet/classes/zsh.pp +5 -0
  64. data/puppet/modules/README +74 -0
  65. data/puppet/modules/cron/README +4 -0
  66. data/puppet/modules/cron/manifests/base.pp +26 -0
  67. data/puppet/modules/cron/manifests/crontabs.pp +11 -0
  68. data/puppet/modules/cron/manifests/init.pp +18 -0
  69. data/puppet/modules/drupal/Modulefile +7 -0
  70. data/puppet/modules/drupal/README +110 -0
  71. data/puppet/modules/drupal/manifests/absent.pp +25 -0
  72. data/puppet/modules/drupal/manifests/backup/absent.pp +23 -0
  73. data/puppet/modules/drupal/manifests/backup.pp +49 -0
  74. data/puppet/modules/drupal/manifests/conf.pp +23 -0
  75. data/puppet/modules/drupal/manifests/debug.pp +26 -0
  76. data/puppet/modules/drupal/manifests/disable.pp +22 -0
  77. data/puppet/modules/drupal/manifests/disableboot.pp +13 -0
  78. data/puppet/modules/drupal/manifests/drush.pp +20 -0
  79. data/puppet/modules/drupal/manifests/example42/backup.pp +8 -0
  80. data/puppet/modules/drupal/manifests/example42/monitor.pp +8 -0
  81. data/puppet/modules/drupal/manifests/example42.pp +25 -0
  82. data/puppet/modules/drupal/manifests/extra.pp +30 -0
  83. data/puppet/modules/drupal/manifests/firewall/absent.pp +19 -0
  84. data/puppet/modules/drupal/manifests/firewall.pp +24 -0
  85. data/puppet/modules/drupal/manifests/init.pp +54 -0
  86. data/puppet/modules/drupal/manifests/install.pp +20 -0
  87. data/puppet/modules/drupal/manifests/module.pp +37 -0
  88. data/puppet/modules/drupal/manifests/monitor/absent.pp +42 -0
  89. data/puppet/modules/drupal/manifests/monitor.pp +77 -0
  90. data/puppet/modules/drupal/manifests/package.pp +20 -0
  91. data/puppet/modules/drupal/manifests/params.pp +277 -0
  92. data/puppet/modules/drupal/manifests/site.pp +63 -0
  93. data/puppet/modules/drupal/manifests/theme.pp +33 -0
  94. data/puppet/modules/drupal/templates/variables_drupal.erb +62 -0
  95. data/puppet/modules/drupal/tests/absent.pp +1 -0
  96. data/puppet/modules/drupal/tests/backup.pp +1 -0
  97. data/puppet/modules/drupal/tests/debug.pp +1 -0
  98. data/puppet/modules/drupal/tests/disable.pp +1 -0
  99. data/puppet/modules/drupal/tests/disableboot.pp +1 -0
  100. data/puppet/modules/drupal/tests/firewall.pp +1 -0
  101. data/puppet/modules/drupal/tests/init.pp +1 -0
  102. data/puppet/modules/drupal/tests/monitor.pp +1 -0
  103. data/puppet/modules/hosts/README +0 -0
  104. data/puppet/modules/hosts/manifests/example42.pp +5 -0
  105. data/puppet/modules/hosts/manifests/init.pp +16 -0
  106. data/puppet/modules/hosts/templates/hosts.erb +11 -0
  107. data/puppet/modules/iptables/README +4 -0
  108. data/puppet/modules/iptables/files/iptables +19 -0
  109. data/puppet/modules/iptables/manifests/disable.pp +15 -0
  110. data/puppet/modules/iptables/manifests/init.pp +9 -0
  111. data/puppet/modules/iptables/manifests/redhat.pp +24 -0
  112. data/puppet/modules/mysql/Modulefile +7 -0
  113. data/puppet/modules/mysql/README +56 -0
  114. data/puppet/modules/mysql/manifests/absent.pp +12 -0
  115. data/puppet/modules/mysql/manifests/backup/example42.pp +8 -0
  116. data/puppet/modules/mysql/manifests/backup.pp +49 -0
  117. data/puppet/modules/mysql/manifests/client.pp +18 -0
  118. data/puppet/modules/mysql/manifests/conf.pp +23 -0
  119. data/puppet/modules/mysql/manifests/debug.pp +25 -0
  120. data/puppet/modules/mysql/manifests/disable.pp +13 -0
  121. data/puppet/modules/mysql/manifests/disableboot.pp +13 -0
  122. data/puppet/modules/mysql/manifests/example42.pp +25 -0
  123. data/puppet/modules/mysql/manifests/firewall.pp +23 -0
  124. data/puppet/modules/mysql/manifests/grant.pp +29 -0
  125. data/puppet/modules/mysql/manifests/init.pp +67 -0
  126. data/puppet/modules/mysql/manifests/monitor/example42.pp +8 -0
  127. data/puppet/modules/mysql/manifests/monitor.pp +77 -0
  128. data/puppet/modules/mysql/manifests/params.pp +240 -0
  129. data/puppet/modules/mysql/manifests/query.pp +30 -0
  130. data/puppet/modules/mysql/templates/grant.erb +6 -0
  131. data/puppet/modules/mysql/templates/query.erb +5 -0
  132. data/puppet/modules/mysql/templates/variables_mysql.erb +42 -0
  133. data/puppet/modules/network/README +4 -0
  134. data/puppet/modules/network/manifests/init.pp +13 -0
  135. data/puppet/modules/nginx/manifests/fcgi.pp +87 -0
  136. data/puppet/modules/nginx/manifests/init.pp +205 -0
  137. data/puppet/modules/nginx/templates/fcgi_site.erb +38 -0
  138. data/puppet/modules/nginx/templates/includes/fastcgi_params.erb +23 -0
  139. data/puppet/modules/nginx/templates/nginx.conf.erb +31 -0
  140. data/puppet/modules/passenger/manifests/init.pp +12 -0
  141. data/puppet/modules/passenger/templates/myapp +39 -0
  142. data/puppet/modules/php/README +26 -0
  143. data/puppet/modules/php/manifests/init.pp +42 -0
  144. data/puppet/modules/php/manifests/module.pp +22 -0
  145. data/puppet/modules/php/manifests/pear/module.pp +21 -0
  146. data/puppet/modules/php/manifests/pear.pp +20 -0
  147. data/puppet/modules/php/manifests/pecl/config.pp +19 -0
  148. data/puppet/modules/php/manifests/pecl/module.pp +44 -0
  149. data/puppet/modules/php/manifests/pecl.pp +8 -0
  150. data/puppet/modules/php/manifests/soap.pp +20 -0
  151. data/puppet/modules/postgres/Copyright +13 -0
  152. data/puppet/modules/postgres/manifests/database.pp +40 -0
  153. data/puppet/modules/postgres/manifests/init.pp +25 -0
  154. data/puppet/modules/postgres/manifests/role.pp +40 -0
  155. data/puppet/modules/ruby/files/install-ruby-stow +43 -0
  156. data/puppet/modules/ruby/manifests/init.pp +18 -0
  157. data/puppet/modules/rvm/files/install-system-rvm +2 -0
  158. data/puppet/modules/rvm/manifests/classes/dependencies.pp +24 -0
  159. data/puppet/modules/rvm/manifests/classes/passenger.pp +166 -0
  160. data/puppet/modules/rvm/manifests/classes/system.pp +33 -0
  161. data/puppet/modules/rvm/manifests/definitions/system_user.pp +13 -0
  162. data/puppet/modules/rvm/manifests/init.pp +2 -0
  163. data/puppet/modules/rvm/templates/passenger-apache.conf.erb +9 -0
  164. data/puppet/modules/ssh/README +4 -0
  165. data/puppet/modules/ssh/manifests/auth.pp +39 -0
  166. data/puppet/modules/ssh/manifests/auth.pp.good +340 -0
  167. data/puppet/modules/ssh/manifests/eal4.pp +69 -0
  168. data/puppet/modules/ssh/manifests/init.pp +74 -0
  169. data/puppet/modules/stow/manifests/init.pp +5 -0
  170. data/puppet/modules/sudo/files/sudoers +25 -0
  171. data/puppet/modules/sudo/manifests/init.pp +1 -0
  172. data/puppet/modules/sudo/manifests/install.pp +5 -0
  173. data/puppet/modules/sudo/manifests/sudoers.pp +14 -0
  174. data/puppet/modules/ufw/manifests/init.pp +12 -0
  175. data/puppet/modules/users/README +28 -0
  176. data/puppet/modules/users/manifests/adduser.pp +16 -0
  177. data/puppet/modules/users/manifests/admin.pp +11 -0
  178. data/puppet/modules/users/manifests/automount.pp +34 -0
  179. data/puppet/modules/users/manifests/deluser.pp +8 -0
  180. data/puppet/modules/users/manifests/example42.pp +16 -0
  181. data/puppet/modules/users/manifests/init.pp +31 -0
  182. data/puppet/modules/users/manifests/ldap.pp +114 -0
  183. data/puppet/modules/users/manifests/params.pp +84 -0
  184. data/puppet/modules/users/templates/ldap/ldap.conf.erb +13 -0
  185. data/puppet/modules/users/templates/ldap/nsswitch.conf.erb +23 -0
  186. data/puppet/modules/users/templates/ldap/openldap-ldap.conf.erb +8 -0
  187. data/puppet/modules/webmin/manifests/init.pp +31 -0
  188. data/puppet/roles/blank.pp +1 -0
  189. data/puppet/site.pp +8 -0
  190. metadata +235 -81
  191. data/README +0 -3
  192. data/bin/provizion +0 -52
  193. data/lib/policies/chef-client.rb +0 -37
  194. data/lib/policies/lamp.rb +0 -42
  195. data/lib/policies/passenger.rb +0 -44
  196. data/lib/recipes/apache.rb +0 -70
  197. data/lib/recipes/apache_conf.rb +0 -3
  198. data/lib/recipes/bundler.rb +0 -4
  199. data/lib/recipes/chef_client.rb +0 -11
  200. data/lib/recipes/curl.rb +0 -8
  201. data/lib/recipes/essential.rb +0 -4
  202. data/lib/recipes/git.rb +0 -15
  203. data/lib/recipes/imagemagick.rb +0 -8
  204. data/lib/recipes/mailserver.rb +0 -9
  205. data/lib/recipes/memcached.rb +0 -16
  206. data/lib/recipes/mysql.rb +0 -21
  207. data/lib/recipes/nginx/init.d +0 -63
  208. data/lib/recipes/nginx.rb +0 -25
  209. data/lib/recipes/passenger.rb +0 -67
  210. data/lib/recipes/php.rb +0 -8
  211. data/lib/recipes/postgresql.rb +0 -21
  212. data/lib/recipes/ruby_enterprise.rb +0 -24
  213. data/lib/recipes/rvm.rb +0 -25
  214. data/lib/recipes/sources.rb +0 -5
  215. data/lib/recipes/subversion.rb +0 -8
  216. data/lib/recipes/syslog.rb +0 -7
  217. data/lib/recipes/ufw.rb +0 -12
  218. data/lib/recipes/vim.rb +0 -8
  219. data/lib/recipes/webmin.rb +0 -17
  220. data/lib/templates/apache.conf.erb +0 -12
  221. data/lib/templates/my.cnf +0 -132
  222. data/lib/templates/passenger.conf +0 -11
  223. data/lib/templates/passenger.load +0 -1
@@ -0,0 +1,347 @@
1
+ #
2
+ # Configuration file for syslog-ng under Debian
3
+ #
4
+ # attempts at reproducing default syslog behavior
5
+
6
+ # the standard syslog levels are (in descending order of priority):
7
+ # emerg alert crit err warning notice info debug
8
+ # the aliases "error", "panic", and "warn" are deprecated
9
+ # the "none" priority found in the original syslogd configuration is
10
+ # only used in internal messages created by syslogd
11
+
12
+
13
+ ######
14
+ # options
15
+
16
+ options {
17
+ # disable the chained hostname format in logs
18
+ # (default is enabled)
19
+ chain_hostnames(0);
20
+
21
+ # the time to wait before a died connection is re-established
22
+ # (default is 60)
23
+ time_reopen(10);
24
+
25
+ # the time to wait before an idle destination file is closed
26
+ # (default is 60)
27
+ time_reap(360);
28
+
29
+ # the number of lines buffered before written to file
30
+ # you might want to increase this if your disk isn't catching with
31
+ # all the log messages you get or if you want less disk activity
32
+ # (say on a laptop)
33
+ # (default is 0)
34
+ #sync(0);
35
+
36
+ # the number of lines fitting in the output queue
37
+ log_fifo_size(2048);
38
+
39
+ # enable or disable directory creation for destination files
40
+ create_dirs(yes);
41
+
42
+ # default owner, group, and permissions for log files
43
+ # (defaults are 0, 0, 0600)
44
+ #owner(root);
45
+ group(adm);
46
+ perm(0640);
47
+
48
+ # default owner, group, and permissions for created directories
49
+ # (defaults are 0, 0, 0700)
50
+ #dir_owner(root);
51
+ #dir_group(root);
52
+ dir_perm(0755);
53
+
54
+ # enable or disable DNS usage
55
+ # syslog-ng blocks on DNS queries, so enabling DNS may lead to
56
+ # a Denial of Service attack
57
+ # (default is yes)
58
+ use_dns(no);
59
+
60
+ # maximum length of message in bytes
61
+ # this is only limited by the program listening on the /dev/log Unix
62
+ # socket, glibc can handle arbitrary length log messages, but -- for
63
+ # example -- syslogd accepts only 1024 bytes
64
+ # (default is 2048)
65
+ #log_msg_size(2048);
66
+
67
+ #Disable statistic log messages.
68
+ stats_freq(0);
69
+
70
+ # Some program send log messages through a private implementation.
71
+ # and sometimes that implementation is bad. If this happen syslog-ng
72
+ # may recognise the program name as hostname. Whit this option
73
+ # we tell the syslog-ng that if a hostname match this regexp than that
74
+ # is not a real hostname.
75
+ bad_hostname("^gconfd$");
76
+ };
77
+
78
+
79
+ ######
80
+ # sources
81
+
82
+ # all known message sources
83
+ source s_all {
84
+ # message generated by Syslog-NG
85
+ internal();
86
+ # standard Linux log source (this is the default place for the syslog()
87
+ # function to send logs to)
88
+ unix-stream("/dev/log");
89
+ # messages from the kernel
90
+ file("/proc/kmsg" log_prefix("kernel: "));
91
+ # use the following line if you want to receive remote UDP logging messages
92
+ # (this is equivalent to the "-r" syslogd flag)
93
+ # udp();
94
+ };
95
+
96
+
97
+ ######
98
+ # destinations
99
+
100
+ # some standard log files
101
+ destination df_auth { file("/var/log/auth.log"); };
102
+ destination df_syslog { file("/var/log/syslog"); };
103
+ destination df_cron { file("/var/log/cron.log"); };
104
+ destination df_daemon { file("/var/log/daemon.log"); };
105
+ destination df_kern { file("/var/log/kern.log"); };
106
+ destination df_lpr { file("/var/log/lpr.log"); };
107
+ destination df_mail { file("/var/log/mail.log"); };
108
+ destination df_user { file("/var/log/user.log"); };
109
+ destination df_uucp { file("/var/log/uucp.log"); };
110
+
111
+ # these files are meant for the mail system log files
112
+ # and provide re-usable destinations for {mail,cron,...}.info,
113
+ # {mail,cron,...}.notice, etc.
114
+ destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
115
+ destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
116
+ destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
117
+ destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
118
+ destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
119
+
120
+ # these files are meant for the news system, and are kept separated
121
+ # because they should be owned by "news" instead of "root"
122
+ destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); };
123
+ destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); };
124
+ destination df_news_dot_crit { file("/var/log/news/news.crit" owner("news")); };
125
+
126
+ # some more classical and useful files found in standard syslog configurations
127
+ destination df_debug { file("/var/log/debug"); };
128
+ destination df_messages { file("/var/log/messages"); };
129
+
130
+ # pipes
131
+ # a console to view log messages under X
132
+ destination dp_xconsole { pipe("/dev/xconsole"); };
133
+
134
+ # consoles
135
+ # this will send messages to everyone logged in
136
+ destination du_all { usertty("*"); };
137
+
138
+
139
+ ######
140
+ # filters
141
+
142
+ # all messages from the auth and authpriv facilities
143
+ filter f_auth { facility(auth, authpriv); };
144
+
145
+ # all messages except from the auth and authpriv facilities
146
+ filter f_syslog { not facility(auth, authpriv); };
147
+
148
+ # respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
149
+ # and uucp facilities
150
+ filter f_cron { facility(cron); };
151
+ filter f_daemon { facility(daemon); };
152
+ filter f_kern { facility(kern); };
153
+ filter f_lpr { facility(lpr); };
154
+ filter f_mail { facility(mail); };
155
+ filter f_news { facility(news); };
156
+ filter f_user { facility(user); };
157
+ filter f_uucp { facility(uucp); };
158
+
159
+ # some filters to select messages of priority greater or equal to info, warn,
160
+ # and err
161
+ # (equivalents of syslogd's *.info, *.warn, and *.err)
162
+ filter f_at_least_info { level(info..emerg); };
163
+ filter f_at_least_notice { level(notice..emerg); };
164
+ filter f_at_least_warn { level(warn..emerg); };
165
+ filter f_at_least_err { level(err..emerg); };
166
+ filter f_at_least_crit { level(crit..emerg); };
167
+
168
+ # all messages of priority debug not coming from the auth, authpriv, news, and
169
+ # mail facilities
170
+ filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
171
+
172
+ # all messages of info, notice, or warn priority not coming form the auth,
173
+ # authpriv, cron, daemon, mail, and news facilities
174
+ filter f_messages {
175
+ level(info,notice,warn)
176
+ and not facility(auth,authpriv,cron,daemon,mail,news);
177
+ };
178
+
179
+ # messages with priority emerg
180
+ filter f_emerg { level(emerg); };
181
+
182
+ # complex filter for messages usually sent to the xconsole
183
+ filter f_xconsole {
184
+ facility(daemon,mail)
185
+ or level(debug,info,notice,warn)
186
+ or (facility(news)
187
+ and level(crit,err,notice));
188
+ };
189
+
190
+
191
+ ######
192
+ # logs
193
+ # order matters if you use "flags(final);" to mark the end of processing in a
194
+ # "log" statement
195
+
196
+ # these rules provide the same behavior as the commented original syslogd rules
197
+
198
+ # auth,authpriv.* /var/log/auth.log
199
+ log {
200
+ source(s_all);
201
+ filter(f_auth);
202
+ destination(df_auth);
203
+ };
204
+
205
+ # *.*;auth,authpriv.none -/var/log/syslog
206
+ log {
207
+ source(s_all);
208
+ filter(f_syslog);
209
+ destination(df_syslog);
210
+ };
211
+
212
+ # this is commented out in the default syslog.conf
213
+ # cron.* /var/log/cron.log
214
+ #log {
215
+ # source(s_all);
216
+ # filter(f_cron);
217
+ # destination(df_cron);
218
+ #};
219
+
220
+ # daemon.* -/var/log/daemon.log
221
+ log {
222
+ source(s_all);
223
+ filter(f_daemon);
224
+ destination(df_daemon);
225
+ };
226
+
227
+ # kern.* -/var/log/kern.log
228
+ log {
229
+ source(s_all);
230
+ filter(f_kern);
231
+ destination(df_kern);
232
+ };
233
+
234
+ # lpr.* -/var/log/lpr.log
235
+ log {
236
+ source(s_all);
237
+ filter(f_lpr);
238
+ destination(df_lpr);
239
+ };
240
+
241
+ # mail.* -/var/log/mail.log
242
+ log {
243
+ source(s_all);
244
+ filter(f_mail);
245
+ destination(df_mail);
246
+ };
247
+
248
+ # user.* -/var/log/user.log
249
+ log {
250
+ source(s_all);
251
+ filter(f_user);
252
+ destination(df_user);
253
+ };
254
+
255
+ # uucp.* /var/log/uucp.log
256
+ log {
257
+ source(s_all);
258
+ filter(f_uucp);
259
+ destination(df_uucp);
260
+ };
261
+
262
+ # mail.info -/var/log/mail.info
263
+ log {
264
+ source(s_all);
265
+ filter(f_mail);
266
+ filter(f_at_least_info);
267
+ destination(df_facility_dot_info);
268
+ };
269
+
270
+ # mail.warn -/var/log/mail.warn
271
+ log {
272
+ source(s_all);
273
+ filter(f_mail);
274
+ filter(f_at_least_warn);
275
+ destination(df_facility_dot_warn);
276
+ };
277
+
278
+ # mail.err /var/log/mail.err
279
+ log {
280
+ source(s_all);
281
+ filter(f_mail);
282
+ filter(f_at_least_err);
283
+ destination(df_facility_dot_err);
284
+ };
285
+
286
+ # news.crit /var/log/news/news.crit
287
+ log {
288
+ source(s_all);
289
+ filter(f_news);
290
+ filter(f_at_least_crit);
291
+ destination(df_news_dot_crit);
292
+ };
293
+
294
+ # news.err /var/log/news/news.err
295
+ log {
296
+ source(s_all);
297
+ filter(f_news);
298
+ filter(f_at_least_err);
299
+ destination(df_news_dot_err);
300
+ };
301
+
302
+ # news.notice /var/log/news/news.notice
303
+ log {
304
+ source(s_all);
305
+ filter(f_news);
306
+ filter(f_at_least_notice);
307
+ destination(df_news_dot_notice);
308
+ };
309
+
310
+
311
+ # *.=debug;\
312
+ # auth,authpriv.none;\
313
+ # news.none;mail.none -/var/log/debug
314
+ log {
315
+ source(s_all);
316
+ filter(f_debug);
317
+ destination(df_debug);
318
+ };
319
+
320
+
321
+ # *.=info;*.=notice;*.=warn;\
322
+ # auth,authpriv.none;\
323
+ # cron,daemon.none;\
324
+ # mail,news.none -/var/log/messages
325
+ log {
326
+ source(s_all);
327
+ filter(f_messages);
328
+ destination(df_messages);
329
+ };
330
+
331
+ # *.emerg *
332
+ log {
333
+ source(s_all);
334
+ filter(f_emerg);
335
+ destination(du_all);
336
+ };
337
+
338
+
339
+ # daemon.*;mail.*;\
340
+ # news.crit;news.err;news.notice;\
341
+ # *.=debug;*.=info;\
342
+ # *.=notice;*.=warn |/dev/xconsole
343
+ log {
344
+ source(s_all);
345
+ filter(f_xconsole);
346
+ destination(dp_xconsole);
347
+ };
@@ -0,0 +1,146 @@
1
+ # # common/manifests/defines/concatenated_file.pp -- create a file from snippets
2
+ # # stored in a directory
3
+ # #
4
+ # # Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
5
+ # # See LICENSE for the full license granted to you.
6
+ #
7
+ # module_dir { "common/cf": }
8
+ #
9
+ # # TODO:
10
+ # # * create the directory in _part too
11
+ #
12
+ # # This resource collects file snippets from a directory ($dir) and concatenates
13
+ # # them in lexical order of their names into a new file ($name). This can be
14
+ # # used to collect information from disparate sources, when the target file
15
+ # # format doesn't allow includes.
16
+ # #
17
+ # # concatenated_file_part can be used to easily configure content for this.
18
+ # #
19
+ # # If no $dir is specified, the target name with '.d' appended will be used.
20
+ # #
21
+ # # The $dir is purged by puppet and will only contain explicitely configured
22
+ # # files. This can be overridden by defining the directory before the
23
+ # # concatenated_file.
24
+ # #
25
+ # # Depend on File[$name] to change if and only if its contents change. Notify
26
+ # # Exec["concat_${name}"] if you want to force an update.
27
+ # #
28
+ # # Usage:
29
+ # # concatenated_file { "/etc/some.conf":
30
+ # # dir => "/etc/some.conf.d",
31
+ # # }
32
+ define concatenated_file (
33
+ # where the snippets are located
34
+ $dir = '',
35
+ # a file with content to prepend
36
+ $header = '',
37
+ # a file with content to append
38
+ $footer = '',
39
+ # default permissions for the target file
40
+ $mode = 0644, $owner = root, $group = 0
41
+ )
42
+ {
43
+
44
+ $dir_real = $dir ? { '' => "${name}.d", default => $dir }
45
+
46
+ $tmp_file_name = regsubst($dir_real, '/', '_', 'G')
47
+ $tmp_file = "${module_dir_path}/${tmp_file_name}"
48
+
49
+ if defined(File[$dir_real]) {
50
+ debug("${dir_real} already defined")
51
+ } else {
52
+ file {
53
+ $dir_real:
54
+ #source => "puppet:///modules/common/empty",
55
+ checksum => mtime,
56
+ ignore => '.ignore',
57
+ recurse => true, purge => true, force => true,
58
+ mode => $mode, owner => $owner, group => $group,
59
+ notify => Exec["concat_${name}"];
60
+ }
61
+ }
62
+
63
+ file {
64
+ $tmp_file:
65
+ ensure => present, checksum => md5,
66
+ mode => $mode, owner => $owner, group => $group;
67
+ # decouple the actual file from the generation process by using a
68
+ # temporary file and puppet's source mechanism. This ensures that events
69
+ # for notify/subscribe will only be generated when there is an actual
70
+ # change.
71
+ $name:
72
+ ensure => present, checksum => md5,
73
+ source => $tmp_file,
74
+ mode => $mode, owner => $owner, group => $group,
75
+ require => File[$tmp_file];
76
+ }
77
+
78
+ # if there is a header or footer file, add it
79
+ $additional_cmd = $header ? {
80
+ '' => $footer ? {
81
+ '' => '',
82
+ default => "| cat - '${footer}' "
83
+ },
84
+ default => $footer ? {
85
+ '' => "| cat '${header}' - ",
86
+ default => "| cat '${header}' - '${footer}' "
87
+ }
88
+ }
89
+
90
+ # use >| to force clobbering the target file
91
+ exec { "concat_${name}":
92
+ command => "/usr/bin/find ${dir_real} -maxdepth 1 -type f ! -name '*puppettmp' -print0 | sort -z | xargs -0 cat ${additional_cmd} >| ${tmp_file}",
93
+ subscribe => [ File[$dir_real] ],
94
+ before => File[$tmp_file],
95
+ alias => [ "concat_${dir_real}"],
96
+ loglevel => info
97
+ }
98
+
99
+ }
100
+
101
+ # Add a snippet called $name to the concatenated_file at $dir.
102
+ # The file can be referenced as File["cf_part_${name}"]
103
+ define concatenated_file_part (
104
+ $dir, $content = '', $ensure = present,
105
+ $mode = 0644, $owner = root, $group = 0
106
+ )
107
+ {
108
+
109
+ file { "${dir}/${name}":
110
+ ensure => $ensure, content => $content,
111
+ mode => $mode, owner => $owner, group => $group,
112
+ alias => "cf_part_${name}",
113
+ notify => Exec["concat_${dir}"],
114
+ }
115
+ }
116
+
117
+ class syslogng {
118
+ package {"syslog-ng":
119
+ ensure => present
120
+ }
121
+
122
+ file {"/etc/syslog-ng/puppet-conf.d":
123
+ ensure => directory
124
+ }
125
+
126
+ file {"/etc/syslog-ng/puppet-conf.d/00base.cnf":
127
+ content => template("syslogng/$operatingsystem.cnf")
128
+ }
129
+
130
+ define config($content) {
131
+ include syslogng
132
+
133
+ file {"/etc/syslog-ng/puppet-conf.d/$name.cnf":
134
+ content => $content
135
+ }
136
+ }
137
+
138
+ concatenated_file {"/etc/syslog-ng/syslog-ng.conf":
139
+ dir => "/etc/syslog-ng/puppet-conf.d"
140
+ }
141
+
142
+ service {"syslog-ng":
143
+ ensure => running,
144
+ subscribe => File["/etc/syslog-ng/syslog-ng.conf"]
145
+ }
146
+ }
@@ -0,0 +1,23 @@
1
+ class xml {
2
+ include "xml::$operatingsystem"
3
+
4
+ class ubuntu {
5
+ package { "libxml2-dev":
6
+ ensure => present
7
+ }
8
+
9
+ package { "libxslt1-dev":
10
+ ensure => present
11
+ }
12
+ }
13
+
14
+ class centos {
15
+ package { "libxml2-devel":
16
+ ensure => present
17
+ }
18
+
19
+ package { "libxslt-devel":
20
+ ensure => present
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,6 @@
1
+ class yum {
2
+ exec {"yum update":
3
+ command => "/usr/bin/yum -y update",
4
+ refreshonly => true
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ class zsh {
2
+ package {"zsh":
3
+ ensure => present
4
+ }
5
+ }
@@ -0,0 +1,74 @@
1
+ EXAMPLE42 PUPPET MODULES
2
+ Released under the terms of GPL 3
3
+
4
+ Official website:
5
+ http://www.example42.com
6
+
7
+ A collection of modules for Puppet with the following targets:
8
+ - Multi OS support and easy integration of new OS
9
+ - Sysadmin oriented approach (for easier integration and customization)
10
+ - Support for a growing number of applications
11
+ - Adherence to Puppet modules standards
12
+ - No enforcing of a specific logic for files management.
13
+ - Separation of project's custom settings from application general management
14
+ - Plug & Play approach: define variables (defaults are provided) and include the main class
15
+
16
+ Some research and experimentation is done on:
17
+ - Definition and use of enhanced abstraction classes such as backup, monitor, firewall
18
+ - Definition of a standard and pluggable define for inline modifications
19
+ - Setup of Puppet toasters and baselines
20
+
21
+ NOTE: The whole project is a work in progress, the modules have been made in different
22
+ times and have different levels of coherency and integration.
23
+
24
+
25
+ MODULES STANDARD STRUCTURE
26
+ Newer modules are based on the standard template defined in the "foo" module.
27
+ Use the script "example42_module_clone.sh" to clone a new module based on the foo template.
28
+ Use the script "example42_project_rename.sh" in a module to change all the references
29
+ to example42 to your custom project
30
+
31
+ This template provides the following files:
32
+ # Documentation and metadata
33
+ foo/README - The module's general documentation
34
+ foo/Modulefile - Metadata for the Puppet Forge
35
+ # Main classes
36
+ foo/manifests/init.pp - Contains the base module class
37
+ foo/manifests/params.pp - Contains all the module variables
38
+ # Additional classes
39
+ foo/manifests/absent.pp - foo::absent class that removes foo package
40
+ foo/manifests/disable.pp - foo::disable class that disables foo service (boot and runtime)
41
+ foo/manifests/disableboot.pp - foo::disableboot class that disables foo service at boot
42
+ # Extended classes (experimental)
43
+ foo/manifests/monitor.pp - Extended class to abstract monitoring logic
44
+ foo/manifests/backup.pp - Extended class to abstract backup logic
45
+ foo/manifests/firewall.pp - Extended class to abstract firewalling logic
46
+ # Custom project related classes
47
+ foo/manifest/example42.pp - Sample project related class for general customizations
48
+ foo/manifest/monitor/example42.pp - Sample project related class for monitor customizations
49
+ foo/manifest/backup/example42.pp - Sample project related class for backup customizations
50
+ # Generic configuration inline define (experimental)
51
+ foo/manifests/conf.pp - Define for inline replacements in foo's main config file
52
+ # Debug
53
+ foo/manifests/debug.pp - Debug class. Activated if ($debug == yes)
54
+ foo/templates/variables_foo.erb - Debug template with all the modules parameters
55
+
56
+
57
+ # GENERAL VARIABLES
58
+ Example42 modules can be used with whatever nodes infrastructure you may define: you can use
59
+ nodes definitions in Puppet manifests or an external node tool such as the Dashboard or Foreman.
60
+ To use the modules you just have to include them and provide the eventual variables they need
61
+ (defaults are set if none is provided).
62
+ There are some general site-wide variables that can be used to fully use these modules:
63
+ $my_project - Defines the name of your project and cab be used to automatically load custom
64
+ project related classes
65
+ $debug - If set to "yes" it enables some useful (not resource intensive) stuff for debugging
66
+ (check in /var/lib/puppet/debug/).
67
+ $monitor - If set to "yes" you enable autoloading of monitor extended classes.
68
+ Check Example42 monitor module for more info
69
+ $monitor_tool - An array that defines the monitor tools to use (ie: monit, munin, nagios...)
70
+ $backup - If set to "yes" you enable autoloading of backup extended classes.
71
+ Check Example42 backup module for more info
72
+ $firewall - If set to "yes" you enable autoloading of firewall extended classes.
73
+ Check Example42 firewall module for more info
74
+ Please note that currently the monitor, backup and firewall functions are experimental.
@@ -0,0 +1,4 @@
1
+ # Lab42 Puppet Infrastructure #
2
+ # PROVIDED 'AS IS'
3
+
4
+
@@ -0,0 +1,26 @@
1
+ class cron::base {
2
+
3
+ package { cron:
4
+ name => $operatingsystem ? {
5
+ ubuntu => "cron",
6
+ debian => "cron",
7
+ redhat => "vixie-cron",
8
+ centos => "vixie-cron",
9
+ },
10
+ ensure => present,
11
+ }
12
+
13
+ service { crond:
14
+ name => $operatingsystem ? {
15
+ ubuntu => "cron",
16
+ debian => "cron",
17
+ redhat => "crond",
18
+ centos => "crond",
19
+ },
20
+ ensure => running,
21
+ enable => true,
22
+ pattern => cron,
23
+ require => Package["cron"],
24
+ }
25
+
26
+ }
@@ -0,0 +1,11 @@
1
+ class cron::crontabs {
2
+
3
+ package { crontabs:
4
+ name => $operatingsystem ? {
5
+ redhat => "crontabs",
6
+ centos => "crontabs",
7
+ },
8
+ ensure => present,
9
+ }
10
+
11
+ }
@@ -0,0 +1,18 @@
1
+ class cron {
2
+
3
+ case $operatingsystem {
4
+ centos: {
5
+ include cron::base
6
+ include cron::crontabs
7
+ }
8
+ redhat: {
9
+ include cron::base
10
+ include cron::crontabs
11
+ }
12
+
13
+ debian: { include cron::base }
14
+ ubuntu: { include cron::base }
15
+ freebsd: { }
16
+ }
17
+
18
+ }
@@ -0,0 +1,7 @@
1
+ name 'lab42-drupal'
2
+ version '0.1.5'
3
+
4
+ # dependency 'lab42/common', '>= 0.1.0'
5
+ # dependency 'lab42/monitor', '>= 0.1.0'
6
+ # dependency 'lab42/backup', '>= 0.1.0'
7
+ # dependency 'lab42/firewall', '>= 0.1.0'