Page MenuHomeDevCentral

D2906.id.diff
No OneTemporary

D2906.id.diff

diff --git a/roles/core/init.sls b/roles/core/init.sls
--- a/roles/core/init.sls
+++ b/roles/core/init.sls
@@ -21,6 +21,7 @@
- .salt
- .sshd
- .sudo
+ - .storage
- .sysctl
- .timezone
- .userland-software
diff --git a/roles/core/storage/files/zfs.cron b/roles/core/storage/files/zfs.cron
new file mode 100644
--- /dev/null
+++ b/roles/core/storage/files/zfs.cron
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# ZFS snapshots
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/core/storage/files/zfs.cron
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+SHELL=/bin/sh
+PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
+
+# See crontab(5) for field format.
+*/5 * * * * root /usr/local/sbin/zfs-auto-snapshot frequent 24
+0 * * * * root /usr/local/sbin/zfs-auto-snapshot hourly 48
+7 0 * * * root /usr/local/sbin/zfs-auto-snapshot daily 31
+14 0 * * 7 root /usr/local/sbin/zfs-auto-snapshot weekly 7
+28 0 1 * * root /usr/local/sbin/zfs-auto-snapshot monthly 12
diff --git a/roles/core/init.sls b/roles/core/storage/init.sls
copy from roles/core/init.sls
copy to roles/core/storage/init.sls
--- a/roles/core/init.sls
+++ b/roles/core/storage/init.sls
@@ -1,27 +1,9 @@
# -------------------------------------------------------------
-# Salt — Core units
+# Salt — Storage
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- - .rc
- - .certificates
- - .hostname
- - .login
- - .network
- - .memory
- - .monitoring
- - .motd
- - .ntp
- - .src
- - .ports
- - .rsyslog
- - .salt
- - .sshd
- - .sudo
- - .sysctl
- - .timezone
- - .userland-software
- - .users
+ - .snapshots
diff --git a/roles/core/init.sls b/roles/core/storage/snapshots.sls
copy from roles/core/init.sls
copy to roles/core/storage/snapshots.sls
--- a/roles/core/init.sls
+++ b/roles/core/storage/snapshots.sls
@@ -1,27 +1,17 @@
# -------------------------------------------------------------
-# Salt — Core units
+# Salt — Storage
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-include:
- - .rc
- - .certificates
- - .hostname
- - .login
- - .network
- - .memory
- - .monitoring
- - .motd
- - .ntp
- - .src
- - .ports
- - .rsyslog
- - .salt
- - .sshd
- - .sudo
- - .sysctl
- - .timezone
- - .userland-software
- - .users
+{% set zfs_tank = salt['node.get']("zfs:pool") %}
+
+{% if zfs_tank %}
+zfstools:
+ pkg.installed
+
+/etc/cron.d/zfs:
+ file.managed:
+ - source: salt://roles/core/storage/files/zfs.cron
+{% endif %}
diff --git a/roles/core/users/init.sls b/roles/core/users/init.sls
--- a/roles/core/users/init.sls
+++ b/roles/core/users/init.sls
@@ -57,7 +57,9 @@
{% set home_directory = zfs_tank + dirs['home'] + '/' + username %}
{{ home_directory }}:
- zfs.filesystem_present
+ zfs.filesystem_present:
+ - properties:
+ "com.sun:auto-snapshot": "true"
zfs_permissions_home_local_{{ username }}:
cmd.run:

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 23:07 (7 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247464
Default Alt Text
D2906.id.diff (3 KB)

Event Timeline