Permalink
Browse files

final version, hopefully

Signed-off-by: Luke Kanies <luke@madstop.com>
  • Loading branch information...
1 parent 29e70e8 commit 5adc3e375bee5c0bb68ee6992320bcb04b3a464d @lak lak committed Jun 22, 2009
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -27,3 +27,10 @@ Doing Something Useful
Facter
Other Language Functions
Relationships
+Definitions
+ Apache Virtual Hosts
+ Using Definitions
+ Complicated Virtual Host
+Things We Skipped
+Obligatory Pitch
+Conclusion
@@ -0,0 +1,9 @@
+class apache {
+ apache::vhost { 'reductivelabs.com':
+ docroot => "/var/www/reductivelabs.com"
+ }
+ apache::vhost { 'foo.com':
+ docroot => "/var/www/foo.com",
+ ensure => absent
+ }
+}
@@ -0,0 +1,6 @@
+define apache::vhost($docroot, $ensure = present) {
+ file { "/tmp/apache/sites/$name":
+ content => template("apache/vhost.erb"),
+ ensure => $ensure
+ }
+}
@@ -0,0 +1,12 @@
+define apache::vhost2($docroot, $ensure = present) {
+ $available => $ensure ? { enabled => present, default => $ensure }
+ $enabled => $ensure ? { enabled => symlink, default => absent }
+ file { "/tmp/apache/sites-available/$name":
+ content => template("apache/vhost.erb"),
+ ensure => $available
+ }
+ file { "/tmp/apache/sites-enabled/$name":
+ target => "/tmp/apache/sites-available/$name",
+ ensure => $enabled
+ }
+}
@@ -0,0 +1,4 @@
+<VirtualHost *>
+ ServerName <%= name %>
+ DocumentRoot <%= docroot %>
+</VirtualHost>
@@ -0,0 +1,7 @@
+class rels {
+ file { "/tmp/reltest": ensure => present }
+ exec { "/bin/echo got notified":
+ subscribe => File["/tmp/reltest"],
+ refreshonly => true
+ }
+}
@@ -0,0 +1,3 @@
+<%= code 'repo/modules/apache/manifests/vhost.pp', :lang => "puppet" %>
+
+Note the qualified definition name. This is required for correct autoloading.
@@ -0,0 +1 @@
+<%= code 'repo/modules/apache/manifests/vhost2.pp', :lang => "puppet" %>
@@ -0,0 +1,7 @@
+![The Villain](images/villain.jpg)
+
+>
+
+luke@reductivelabs.com
+
+
@@ -0,0 +1,2 @@
+* Can be considered a 'composite resource'
+* A simple way to model resources within Puppet's language
@@ -10,3 +10,5 @@ class sudo {
mode => 4111
}
}<% end %>
+
+Add `sudo` to the default node in `site.pp`.
@@ -1,3 +1,7 @@
-> by Luke Kanies Reductive Labs, Inc.
+> by Luke Kanies
+
+> Reductive Labs, Inc.
+
+> luke@reductivelabs.com
Presentation available at `git://github.com/reductivelabs/velocity_puppet_workshop_2009.git`
@@ -0,0 +1 @@
+Reductive Labs provides support contracts, training, and custom development, and we use all of the revenue to fund development, this kind of talk, and eating. Well, almost all.
@@ -0,0 +1,2 @@
+<%= code 'repo/modules/rels/manifests/init.pp', :lang => "puppet" %>
+Produces: <% code :lang => "shell-unix-generic" do %><%= %x{sudo rm -f /tmp/reltest; puppet --color=false --modulepath $PWD/repo/modules -e 'include rels'}.chomp %> <% end %>
@@ -1,3 +1,3 @@
<%= code 'examples/ralsh.sh', :lang => "shell-unix-generic" %>
-Try `ralsh package`.
+Try `ralsh package`, and remind me to tell you to play around here.
@@ -0,0 +1 @@
+<%= code 'repo/modules/apache/templates/vhost.erb', :lang => "ruby" %>
@@ -0,0 +1,6 @@
+* Reporting
+* Queueing
+* Inheritance
+* Storeconfigs
+* Export/Collect
+* Everything else we didn't cover
@@ -0,0 +1,2 @@
+<%= code 'repo/modules/apache/manifests/init.pp', :lang => "puppet" %>
+

0 comments on commit 5adc3e3

Please sign in to comment.