Initial commit of 'Hackers Gmail Replacement' manifests
authorJude N <jude@pwan.org>
Sun, 28 Jul 2013 17:16:45 +0000 (17:16 +0000)
committerJude N <jude@pwan.org>
Sun, 28 Jul 2013 17:16:45 +0000 (17:16 +0000)
manifests/init.pp [new file with mode: 0644]

diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644 (file)
index 0000000..64a0e71
--- /dev/null
@@ -0,0 +1,82 @@
+# Puppet manifests for a 'hackers GMAIL replacement' based on 
+# http://dbpmail.net/essays/2013-06-29-hackers-replacement-for-gmail.html
+
+class hgr {
+
+    package {
+       "postfix" :
+           ensure => installed;
+        "dovecot" :
+           ensure => installed;
+        "sasl2-bin":
+           ensure => installed;
+
+        "spamassassin":
+          ensure => installed;
+       "pyzor":
+          ensure => installed;
+
+        "incron" :
+           ensure => installed;        
+
+       "notmuch" :
+          ensure => installeD;
+    }
+
+    service {
+        "postfix":
+            ensure => running,
+            enable => true,
+            require => Package["postfix"];
+        "dovecot":
+            ensure => running,
+            enable => true,
+            require => Package["dovecot"];
+        "saslauthd"
+           ensure => running,
+            enable => true,
+            require => Package["sasl2-bin"]
+    }
+
+# Beter support for pulling a github repo ? 
+# support for running 'sudo python setup.py install' to build afew
+
+    package {
+         "python-dev":
+             ensure => installed;
+         "gcc" :
+              ensure => installed;
+         "git":
+             ensure => installed;
+    }
+
+    file {
+       "/var/tmp/git":
+           ensure => directory;
+    }
+
+    exec {
+       "clone-afew-repo":
+               cwd => "/var/tmp/git"
+               command => "git clone https://github.com/teythoon/afew /var/tmp/git/afew"
+                creates => "/var/tmp/git/afew/setup.py";
+               requires => [File["/var/tmp/git"],Package["git"]]
+       "install-afew":
+                cwd => "/var/tmp/git/afew";
+               command => "/usr/bin/python /var/tmp/git/afew/setup.py install",
+               creates => "/usr/local/bin/afew",
+               requires => [Exec["clone-afew-repo"],Package["python-dev"],Package["gcc"]];
+    }
+
+    file {
+        "/usr/local/bin/afew":
+             ensure => present,
+            require => Exec["install-afew"];
+       "/usr/local/bin/my-notmuch-new.sh":
+            ensure => present,
+            mode => "0755",
+            source => "puppet:///module/hgr/my-notmuch-new.sh",
+            require => [Package["notmuch"], File["/usr/local/bin/afew"]];
+    }
+
+}