]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Move classes to hiera
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 29 Aug 2017 21:58:30 +0000 (23:58 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 30 Aug 2017 22:44:49 +0000 (00:44 +0200)
environments/production/data/common.yaml
environments/production/data/types/vps-ovhssd-1.yaml
manifests/install_ovh_from_scratch.pp [deleted file]
manifests/site.pp [new file with mode: 0644]

index e129d47986ca28816670ca8367e324859a37a968..01bbcac6d26ace5281347e8de7d662c12d503885 100644 (file)
@@ -1,4 +1,7 @@
 ---
+classes:
+  stdlib: ~
+
 base_installation::puppet_code_path: "/etc/puppetlabs/code"
 base_installation::system_locales: ["fr_FR.UTF-8", "en_US.UTF-8"]
 base_installation::system_timezone: "Europe/Paris"
index 72f3820c6ebca6a310d97e9d2fcd33c094680530..eb4934b81c49b1aa56876ba15d223432e09706d7 100644 (file)
@@ -1,3 +1,7 @@
 ---
+classes:
+  base_installation:
+    stage: "setup"
+
 base_installation::system_hostname: "new.immae.eu"
 base_installation::grub_device: "/dev/sdb"
diff --git a/manifests/install_ovh_from_scratch.pp b/manifests/install_ovh_from_scratch.pp
deleted file mode 100644 (file)
index f5224fa..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-node default {
-    include stdlib
-
-    class { 'base_installation':
-      stage       => "setup",
-      grub_device => "/dev/sdb",
-    }
-}
diff --git a/manifests/site.pp b/manifests/site.pp
new file mode 100644 (file)
index 0000000..f922d2b
--- /dev/null
@@ -0,0 +1,12 @@
+node default {
+  lookup('classes', Hash, 'deep').each |$class_name, $class_hash| {
+    if empty($class_hash) {
+      include $class_name
+    } else {
+      class { $class_name:
+        * => $class_hash
+      }
+    }
+
+  }
+}