- I don't have time to give a full tutorial of Puppet.
- But, here's a peek at a Puppet manifest I'm building for the Mozilla Developer Network
- Puppet's magic is that you declare the end state for a server and Puppet does what it takes to make it so
- Each line of this is something you're not asking someone to do
- That includes you and anyone you hope to come pitch in and help in the future
- MDN kind of accreted around requirements, rather than get explicitly designed
- So, there are a lot of weird tricks and tweaks.
- And, your project may be simpler than this.
- But, eventually, all projects tend toward this - so the sooner you start on something like this, the better
1
2
3
...
46 package {
47
48 [ "man", "man-pages", "vim-enhanced", "httpd-devel", "mysql-devel",
49 "openssl-devel", "nfs-utils", "nfs-utils-lib", "mysql-server", "php-mysql",
50 "vixie-cron"]:
51 ensure => installed;
52
53 [ "tidy", "git", "wv", "subversion-devel", "cabextract", "html2ps",
54 "html2text", "memcached-devel", "libxml2", "libxml2-devel", "libxslt",
55 "libxslt-devel", "libjpeg", "libjpeg-devel", "libpng", "libpng-devel",
56 "python26-devel", "python26-libs", "python26-distribute",
57 "python26-mod_wsgi", "python26-jinja2", "python26-imaging",
58 "python26-imaging-devel", "python-lxml" ]:
59 ensure => installed, require => Exec['repo_epel'];
60
61 }
...
276 exec {
...
298 "setup_mysql_wikidb":
299 command => "/usr/bin/mysql -u root wikidb < /tmp/wikidb.sql",
300 unless => "/usr/bin/mysql -uroot wikidb -B -e 'show tables' 2>&1 | grep -q 'pages'",
301 require => [
302 File["/tmp/wikidb.sql"],
303 Service["mysqld"],
304 Exec["setup_mysql_databases_and_users"]
305 ];
...
318 "kuma_sql_migrate":
319 cwd => "/vagrant", command => "/usr/bin/python2.6 ./vendor/src/schematic/schematic migrations/",
320 require => [
321 Service["mysqld"],
322 Package["python26-devel", "python26-mod_wsgi", "python26-jinja2",
323 "python26-imaging"],
324 Exec["mysql-python-install", "lxml-install",
325 "setup_mysql_databases_and_users",
326 "vendor_lib_git_submodule_update"]
327 ];
328 "kuma_south_migrate":
329 cwd => "/vagrant", command => "/usr/bin/python2.6 manage.py migrate",
330 require => [
331 Exec["kuma_sql_migrate"]
332 ];
333
...
338 "kuma_update_product_details":
339 cwd => "/vagrant", command => "/usr/bin/python2.6 ./manage.py update_product_details",
340 creates => "/home/vagrant/product_details_json/firefox_versions.json",
341 require => [
342 Exec["kuma_south_migrate"],
343 File["/home/vagrant/product_details_json"]
344 ];
345 "kuma_update_feeds":
346 cwd => "/vagrant", command => "/usr/bin/python2.6 ./manage.py update_feeds",
347 onlyif => "/usr/bin/mysql -B -uroot kuma -e'select count(*) from feeder_entry' | grep '0'",
348 require => [
349 Exec["kuma_south_migrate"]
350 ];