summaryrefslogtreecommitdiffstats
path: root/modules/mail2
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-07-05 19:01:01 -0400
committerJesse Luehrs <doy@tozt.net>2021-07-05 19:01:01 -0400
commit0c7b84faf05e510dfc38f8f69b8a107d1ada8c80 (patch)
tree438f704e6b043d1bcf251900f5a426af87f025c8 /modules/mail2
parent573a37010fac2c1ff893257be19a1f2842ce11e1 (diff)
downloadpuppet-tozt-0c7b84faf05e510dfc38f8f69b8a107d1ada8c80.tar.gz
puppet-tozt-0c7b84faf05e510dfc38f8f69b8a107d1ada8c80.zip
start building a new mail server
Diffstat (limited to 'modules/mail2')
-rw-r--r--modules/mail2/files/mirrorlist5
-rw-r--r--modules/mail2/manifests/backups.pp5
-rw-r--r--modules/mail2/manifests/monitoring.pp3
-rw-r--r--modules/mail2/manifests/operatingsystem.pp5
-rw-r--r--modules/mail2/manifests/persistent.pp27
5 files changed, 45 insertions, 0 deletions
diff --git a/modules/mail2/files/mirrorlist b/modules/mail2/files/mirrorlist
new file mode 100644
index 0000000..d1c515d
--- /dev/null
+++ b/modules/mail2/files/mirrorlist
@@ -0,0 +1,5 @@
+Server = https://arch.mirror.constant.com/$repo/os/$arch
+Server = https://mirrors.sorengard.com/archlinux/$repo/os/$arch
+Server = https://mirror.stephen304.com/archlinux/$repo/os/$arch
+Server = https://mirror.wdc1.us.leaseweb.net/archlinux/$repo/os/$arch
+Server = https://mirrors.rit.edu/archlinux/$repo/os/$arch
diff --git a/modules/mail2/manifests/backups.pp b/modules/mail2/manifests/backups.pp
new file mode 100644
index 0000000..5efe064
--- /dev/null
+++ b/modules/mail2/manifests/backups.pp
@@ -0,0 +1,5 @@
+class mail2::backups {
+ class { 'borgmatic':
+ extra_paths => ['/media/persistent'];
+ }
+}
diff --git a/modules/mail2/manifests/monitoring.pp b/modules/mail2/manifests/monitoring.pp
new file mode 100644
index 0000000..c7c9a32
--- /dev/null
+++ b/modules/mail2/manifests/monitoring.pp
@@ -0,0 +1,3 @@
+class mail2::monitoring {
+ include tick::client::base_plugins
+}
diff --git a/modules/mail2/manifests/operatingsystem.pp b/modules/mail2/manifests/operatingsystem.pp
new file mode 100644
index 0000000..3dad94f
--- /dev/null
+++ b/modules/mail2/manifests/operatingsystem.pp
@@ -0,0 +1,5 @@
+class mail2::operatingsystem {
+ file { '/etc/pacman.d/mirrorlist':
+ source => 'puppet:///modules/mail2/mirrorlist';
+ }
+}
diff --git a/modules/mail2/manifests/persistent.pp b/modules/mail2/manifests/persistent.pp
new file mode 100644
index 0000000..6f5f3e7
--- /dev/null
+++ b/modules/mail2/manifests/persistent.pp
@@ -0,0 +1,27 @@
+class mail2::persistent {
+ file {
+ "/media":
+ ensure => directory;
+ "/media/persistent":
+ ensure => directory,
+ require => File["/media"];
+ }
+
+ $fstab_line = "/dev/disk/by-id/scsi-0DO_Volume_mail2-persistent /media/persistent ext4 rw,relatime 0 2"
+ exec { "populate fstab":
+ provider => shell,
+ command => "echo '${fstab_line}' >> /etc/fstab",
+ unless => "/usr/bin/grep -qF '${fstab_line}' /etc/fstab",
+ require => File["/media/persistent"];
+ }
+
+ exec { "mount /media/persistent":
+ provider => shell,
+ command => "/usr/bin/mount /media/persistent",
+ unless => "grep ' /media/persistent ' /proc/mounts",
+ require => [
+ File["/media/persistent"],
+ Exec["populate fstab"],
+ ];
+ }
+}