Add test for backup cookbook
authorTom Hughes <tom@compton.nu>
Sun, 23 Feb 2020 19:22:00 +0000 (19:22 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 23 Feb 2020 22:45:24 +0000 (22:45 +0000)
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/backup/attributes/default.rb
cookbooks/backup/metadata.rb
cookbooks/backup/recipes/default.rb
roles/backup.rb
test/data_bags/accounts/osmbackup.json [new file with mode: 0644]

index 2566c414c885c99adc62959f3c4ec056aa275f11..6646f28d09a0d2f8794f7af9d4da1dedd39a07b9 100644 (file)
@@ -12,6 +12,7 @@ jobs:
           - accounts
           - apache
           - apt
+          - backup
           - bind
           - blog
           - blogs
index df5f78b82588490406b506b843971f0c55a2e568..babf141079bbaa68715c2412549b935821162cc8 100644 (file)
@@ -33,6 +33,9 @@ suites:
   - name: apt
     run_list:
       - recipe[apt::default]
+  - name: backup
+    run_list:
+      - recipe[backup::default]
   - name: bind
     run_list:
       - recipe[bind::default]
index c0b8de57fac80d3d0e113116f78e07e7fc643d08..2773238abd6b254b931ad86345fafb1fda49502d 100644 (file)
@@ -1 +1,3 @@
 default[:stats][:sites] = []
+
+default[:accounts][:users][:osmbackup][:status] = :role
index c4f1bdabd113dd2fc0e7c9f346a8208e496a84ae..d5baa16641ad1dcb8a721fef4628ca37ac3b96b8 100644 (file)
@@ -6,3 +6,4 @@ description       "Installs and configures backup.openstreetmap.org"
 
 version           "1.0.0"
 supports          "ubuntu"
+depends           "accounts"
index 0204f56f294f6b558c22a26c59f2147687ccef85..794f8e51eb0494530df0bf23ba417e93c880dd78 100644 (file)
@@ -17,6 +17,8 @@
 # limitations under the License.
 #
 
+include_recipe "accounts"
+
 package %w[
   perl
   libdate-calc-perl
@@ -26,6 +28,7 @@ directory "/store/backup" do
   owner "osmbackup"
   group "osmbackup"
   mode 0o2755
+  recursive true
 end
 
 cookbook_file "/usr/local/bin/expire-backups" do
index b0c519bd8f3c3f1e0ac2c0cc893b55a967b5ee16..d08483d1c545b275e296f1411b2f73a90f0ebace 100644 (file)
@@ -2,11 +2,6 @@ name "backup"
 description "Role applied to backup.openstreetmap.org"
 
 default_attributes(
-  :accounts => {
-    :users => {
-      :osmbackup => { :status => :role }
-    }
-  },
   :rsyncd => {
     :modules => {
       :backup => {
diff --git a/test/data_bags/accounts/osmbackup.json b/test/data_bags/accounts/osmbackup.json
new file mode 100644 (file)
index 0000000..2fcfd71
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "id": "osmbackup",
+  "uid": 501,
+  "comment": "Backups",
+  "home": "/store/backup",
+  "manage_home": false
+}