aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-04 11:55:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-04 11:55:42 -0300
commitdad616343a9a8fcaec4b25a87c66a3ae725a11f1 (patch)
treeb24d40a90107651bf91ee4cddf5526c79118b82d
parent71e2d679d6757b9f7b6680468c4c6d6e3c42dcc6 (diff)
downloadpuppet-bootstrap-dad616343a9a8fcaec4b25a87c66a3ae725a11f1.tar.gz
puppet-bootstrap-dad616343a9a8fcaec4b25a87c66a3ae725a11f1.tar.bz2
Hiera suport at config target
-rw-r--r--Makefile4
-rw-r--r--hiera/common.yaml5
-rw-r--r--hiera/hiera.yaml2
-rw-r--r--manifests/classes/configurator.pp4
-rw-r--r--templates/puppet/puppet.conf.erb2
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,5 +1,10 @@
---
#
+# Boostrap
+#
+bootstrap::base_domain: 'vagrantup.com'
+
+#
# General
#
nodo::subsystem::apt::include_src: false
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