aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-04 13:24:39 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-04 13:24:39 -0300
commit846876934b55e68554f935cb5101cb866d2f1cd6 (patch)
tree5ed23fd73b6601346120841028ddce858c74ac66
parent4c1bab861dba2f1d8bca76b5545729189a508f54 (diff)
downloadpuppet-bootstrap-846876934b55e68554f935cb5101cb866d2f1cd6.tar.gz
puppet-bootstrap-846876934b55e68554f935cb5101cb866d2f1cd6.tar.bz2
Move from config.pp to hiera
-rw-r--r--Makefile1
-rw-r--r--TODO.md1
-rw-r--r--hiera/bootstrap.yaml12
-rw-r--r--hiera/common.yaml14
-rw-r--r--hiera/hiera.yaml1
-rw-r--r--manifests/classes/configurator.pp16
-rw-r--r--manifests/config.pp21
-rw-r--r--manifests/host.pp5
8 files changed, 30 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index 9bf88d0..90404ca 100644
--- a/Makefile
+++ b/Makefile
@@ -35,6 +35,7 @@ remote:
git remote add bootstrap $(REPO)
config:
+ $(EDITOR) hiera/bootstrap.yaml
FACTER_BOOTSTRAP_PATH="$(CWD)" puppet apply --confdir="$(CWD)" --modulepath=modules manifests/classes/configurator.pp
apply:
diff --git a/TODO.md b/TODO.md
index 0b26d1a..165eb3d 100644
--- a/TODO.md
+++ b/TODO.md
@@ -3,5 +3,4 @@ TODO
* Make `config` target:
* Check if already ran.
- * Move from `config.pp` to hiera.
* Refactor `configurator.pp`.
diff --git a/hiera/bootstrap.yaml b/hiera/bootstrap.yaml
new file mode 100644
index 0000000..e189b51
--- /dev/null
+++ b/hiera/bootstrap.yaml
@@ -0,0 +1,12 @@
+---
+#
+# Boostrap
+#
+# Use "mkpasswd -m sha-512" to generate root and first user's passwords
+# Do not include "ssh-rsa " into the sshkey definition.
+bootstrap::base_domain: 'vagrantup.com'
+bootstrap::root::password: ''
+bootstrap::first_user: 'user'
+bootstrap::first_user::password: ''
+bootstrap::first_user::sshkey: ''
+bootstrap::first_user::email: ''
diff --git a/hiera/common.yaml b/hiera/common.yaml
index e3fe862..d7e35a1 100644
--- a/hiera/common.yaml
+++ b/hiera/common.yaml
@@ -1,10 +1,5 @@
---
#
-# Boostrap
-#
-bootstrap::base_domain: 'vagrantup.com'
-
-#
# General
#
nodo::subsystem::apt::include_src: false
@@ -49,8 +44,7 @@ ntp::servers:
#
# Nameservers
#
-# OpenDNS:
-#
-#nodo::subsystem::resolver::nameservers:
-# - '208.67.222.222'
-# - '208.67.220.220'
+# OpenDNS
+nodo::subsystem::resolver::nameservers:
+ - '208.67.222.222'
+ - '208.67.220.220'
diff --git a/hiera/hiera.yaml b/hiera/hiera.yaml
index d22acc0..c911f2e 100644
--- a/hiera/hiera.yaml
+++ b/hiera/hiera.yaml
@@ -12,3 +12,4 @@
- '%{::environment}/virtual/%{::virtual}'
- '%{::environment}/role/%{::role}'
- common
+ - bootstrap
diff --git a/manifests/classes/configurator.pp b/manifests/classes/configurator.pp
index 3391481..b9b7e9e 100644
--- a/manifests/classes/configurator.pp
+++ b/manifests/classes/configurator.pp
@@ -8,10 +8,18 @@
# and want to configure it to boostrap a whole puppetmaster infrastructure.
#
-# Variables
-$templates = "$bootstrap_path/templates"
-$base_domain = hiera('bootstrap::base_domain', 'example.org')
-$db_password = hiera('nodo::role::master::db_password', 'changeme')
+# Basic variables
+$templates = "$bootstrap_path/templates"
+$base_domain = hiera('bootstrap::base_domain', 'example.org')
+$db_password = hiera('nodo::role::master::db_password', 'changeme')
+$mysql_rootpw = hiera('mysql::server::rootpw', '')
+$root_password = hiera('bootstrap::root:password', 'rootpass')
+$first_user = hiera('bootstrap::first_user', 'user')
+$first_user_password = hiera('bootstrap::first_user::password', 'userpass')
+$first_user_sshkey = hiera('bootstrap::first_user::sshkey', 'usersshkey')
+$first_user_email = hiera('bootstrap::first_user::email', 'usermail')
+$resolvconf_nameservers = hiera('nodo::subsystem::resolver::nameservers', '201.6.2.152:201.6.2.32')
+$global_munin_allow = hiera('nodo::munin_node::allow', '192.168.0.[0-9]*')
# Puppet configuration
file { "$bootstrap_path/puppet.conf":
diff --git a/manifests/config.pp b/manifests/config.pp
deleted file mode 100644
index a4ea298..0000000
--- a/manifests/config.pp
+++ /dev/null
@@ -1,21 +0,0 @@
-# Use "mkpasswd -m sha-512" to generate root and first user's passwords
-$root_password = "rootpass"
-$first_user = "user"
-$first_user_password = "userpass"
-$first_user_sshkey = "usersshkey" # do not include "ssh-rsa " here.
-$first_user_email = "usermail"
-
-# Bootstrap dirs
-$puppet_bootstrap_tmpdir = "/var/tmp/puppet-bootstrap"
-$puppet_dir = "/usr/local/puppet"
-
-# Minimal config for puppet-nodo first run
-Exec { path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }
-
-# Nameserver and munin configuration
-$resolvconf_nameservers = '201.6.2.152:201.6.2.32'
-$global_munin_allow = '192.168.0.[0-9]*'
-
-# MySQL configuration
-$mysql_rootpw = "mysqlpass"
-$puppetmaster_db_password = "puppetpass"
diff --git a/manifests/host.pp b/manifests/host.pp
index eecb81e..6cb2927 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -5,12 +5,7 @@
#
# Import the needed config and modules
-import "config.pp"
import "nodo"
-import "classes/admin_node.pp"
-import "classes/firewall.pp"
-import "classes/users.pp"
-import "classes/default_conf.pp"
# The server role
include nodo::role::server