]> gitweb.fluxo.info Git - puppet-bootstrap.git/commitdiff
Move from config.pp to hiera
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 4 Mar 2014 16:24:39 +0000 (13:24 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 4 Mar 2014 16:24:39 +0000 (13:24 -0300)
Makefile
TODO.md
hiera/bootstrap.yaml [new file with mode: 0644]
hiera/common.yaml
hiera/hiera.yaml
manifests/classes/configurator.pp
manifests/config.pp [deleted file]
manifests/host.pp

index 9bf88d0231b12a3f5e24ba9b06f0495eca5771a3..90404caaf82dd6f8859c35b42ec2a8f9f5cb8cce 100644 (file)
--- 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 0b26d1af8c3cb6a0c1e465c9951d39ce94e3fde9..165eb3d087543c2ae884da36c2b490f8a1aa36bd 100644 (file)
--- 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 (file)
index 0000000..e189b51
--- /dev/null
@@ -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:    ''
index e3fe862a7aabbe27f273d1065a2b55dfeb3d13c3..d7e35a1102102c779d427f7a67b290e93cba55df 100644 (file)
@@ -1,9 +1,4 @@
 ---
-#
-# Boostrap
-#
-bootstrap::base_domain: 'vagrantup.com'
-
 #
 # General
 #
@@ -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'
index d22acc069444236c3568d560f3032a74eded34e9..c911f2e6a305744f5dc9d251ac7ea4cd055cb052 100644 (file)
@@ -12,3 +12,4 @@
   - '%{::environment}/virtual/%{::virtual}'
   - '%{::environment}/role/%{::role}'
   - common
+  - bootstrap
index 339148186c321f69097315b37783a89c2c151ef1..b9b7e9e69db8e11b26e58cdbbdad0fdbb32a837d 100644 (file)
@@ -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 (file)
index a4ea298..0000000
+++ /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"
index eecb81ebef63e0cf43c5e89a07febdbf0d5a7952..6cb29275eeb5443795de7ddc8d320533f3d078ff 100644 (file)
@@ -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