From 0aa8510b29568a7001e1f5257c245fb532760a61 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 28 Jan 2014 15:06:44 -0200 Subject: Adding hiera configuration --- hiera/hiera.yaml | 14 ++++++++++++++ manifests/vagrant.pp | 41 +++++++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 hiera/hiera.yaml diff --git a/hiera/hiera.yaml b/hiera/hiera.yaml new file mode 100644 index 0000000..f5bc512 --- /dev/null +++ b/hiera/hiera.yaml @@ -0,0 +1,14 @@ +--- +:backends: + - yaml +:yaml: + :datadir: /etc/puppet/hiera +:hierarchy: + - '%{::environment}/domain/%{::domain}/node/%{::clientcert}' + - '%{::environment}/domain/%{::domain}/role/%{::role}' + - '%{::environment}/domain/%{::domain}/location/%{::location}' + - '%{::environment}/domain/%{::domain}/%{::domain}' + - '%{::environment}/location/%{::location}' + - '%{::environment}/virtual/%{::virtual}' + - '%{::environment}/role/%{::role}' + - common diff --git a/manifests/vagrant.pp b/manifests/vagrant.pp index 619bc66..94d5896 100644 --- a/manifests/vagrant.pp +++ b/manifests/vagrant.pp @@ -1,11 +1,44 @@ # Import main module import "nodo" +# +# Stage definitions +# + +stage { 'first': + before => Stage['main'], +} + +stage { 'last': } +Stage['main'] -> Stage['last'] + +# +# Class definitions +# + # Vagrant classes include nodo::role::vagrant -# Symlink to the mounted module folder -file { '/etc/puppet/modules': - ensure => '/etc/puppet/modules-0', - force => true, +class vagrant_config { + # Symlink to the mounted module folder + file { '/etc/puppet/modules': + ensure => '/etc/puppet/modules-0', + force => true, + } + + # Ensure a custom hiera configuration + file { '/etc/puppet/hiera.yaml': + owner => root, + group => root, + mode => 0644, + force => true, + ensure => '/etc/puppet/hiera/hiera.yaml', + } +} + +# +# Class instantiations +# +class { 'vagrant_config': + stage => first, } -- cgit v1.2.3