From 1508e956adaa97b7a82c27537f4b124266dacdf0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 29 Aug 2017 23:58:30 +0200 Subject: [PATCH] Move classes to hiera --- environments/production/data/common.yaml | 3 +++ environments/production/data/types/vps-ovhssd-1.yaml | 4 ++++ manifests/install_ovh_from_scratch.pp | 8 -------- manifests/site.pp | 12 ++++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 manifests/install_ovh_from_scratch.pp create mode 100644 manifests/site.pp diff --git a/environments/production/data/common.yaml b/environments/production/data/common.yaml index e129d47..01bbcac 100644 --- a/environments/production/data/common.yaml +++ b/environments/production/data/common.yaml @@ -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" diff --git a/environments/production/data/types/vps-ovhssd-1.yaml b/environments/production/data/types/vps-ovhssd-1.yaml index 72f3820..eb4934b 100644 --- a/environments/production/data/types/vps-ovhssd-1.yaml +++ b/environments/production/data/types/vps-ovhssd-1.yaml @@ -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 index f5224fa..0000000 --- a/manifests/install_ovh_from_scratch.pp +++ /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 index 0000000..f922d2b --- /dev/null +++ b/manifests/site.pp @@ -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 + } + } + + } +} -- 2.41.0