From dad616343a9a8fcaec4b25a87c66a3ae725a11f1 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 4 Mar 2014 11:55:42 -0300 Subject: Hiera suport at config target --- Makefile | 4 ++-- hiera/common.yaml | 5 +++++ hiera/hiera.yaml | 2 +- manifests/classes/configurator.pp | 4 +++- templates/puppet/puppet.conf.erb | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4b491a7..b50f868 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,10 @@ remote: git remote add bootstrap $(REPO) config: - FACTER_BOOTSTRAP_PATH="$(CWD)" puppet apply --hiera-config=hiera.yaml --modulepath=modules manifests/classes/configurator.pp + FACTER_BOOTSTRAP_PATH="$(CWD)" puppet apply --confdir="$(CWD)" --modulepath=modules manifests/classes/configurator.pp apply: - FACTER_BOOTSTRAP_PATH="$(CWD)" puppet apply --hiera-config=hiera.yaml --modulepath=modules manifests/$(stage).pp + FACTER_BOOTSTRAP_PATH="$(CWD)" puppet apply --confdir="$(CWD)" --modulepath=modules manifests/$(stage).pp clean: rm -rf modules diff --git a/hiera/common.yaml b/hiera/common.yaml index 5db8905..e3fe862 100644 --- a/hiera/common.yaml +++ b/hiera/common.yaml @@ -1,4 +1,9 @@ --- +# +# Boostrap +# +bootstrap::base_domain: 'vagrantup.com' + # # General # diff --git a/hiera/hiera.yaml b/hiera/hiera.yaml index f5bc512..d22acc0 100644 --- a/hiera/hiera.yaml +++ b/hiera/hiera.yaml @@ -2,7 +2,7 @@ :backends: - yaml :yaml: - :datadir: /etc/puppet/hiera + :datadir: hiera :hierarchy: - '%{::environment}/domain/%{::domain}/node/%{::clientcert}' - '%{::environment}/domain/%{::domain}/role/%{::role}' diff --git a/manifests/classes/configurator.pp b/manifests/classes/configurator.pp index d0dd787..80c7ce3 100644 --- a/manifests/classes/configurator.pp +++ b/manifests/classes/configurator.pp @@ -10,7 +10,9 @@ # # Variables -$templates = "$bootstrap_path/templates" +$templates = "$bootstrap_path/templates" +$base_domain = hiera('bootstrap::base_domain', 'example.org') +$db_password = hiera('nodo::role::master::db_password', 'changeme') # Puppet configuration file { "$bootstrap_path/puppet.conf": diff --git a/templates/puppet/puppet.conf.erb b/templates/puppet/puppet.conf.erb index 2ebfc9e..d2b50d3 100644 --- a/templates/puppet/puppet.conf.erb +++ b/templates/puppet/puppet.conf.erb @@ -14,7 +14,7 @@ storeconfigs = true dbadapter = mysql dbserver = localhost dbuser = puppet -dbpassword = <%= storeconfigs_pw %> +dbpassword = <%= db_password %> dbconnections = 15 certname = puppet.<%= base_domain %> ssl_client_header = SSL_CLIENT_S_DN -- cgit v1.2.3