Permalink
Browse files

Updated to Vagrant 1.X format, added Hiera support

The Vagrantfile now works Vagrant 1.X, and has a url for a VMWare
Fusion base box. hiera.yaml is put into the right place if you want use
Hiera.
  • Loading branch information...
grahamgilbert committed Apr 1, 2013
1 parent 44d1f18 commit ae7193c26451cfc0d5f67c9253eb5d187f7d7e70
Showing with 80 additions and 85 deletions.
  1. +2 −0 README.md
  2. +59 −67 VagrantConf/manifests/default.pp
  3. +9 −18 Vagrantfile
  4. +10 −0 puppet/hiera.yaml
View
@@ -19,6 +19,8 @@ I wanted a full Puppet test environment that I could create and destroy easily.
<tr><th>Dashboard URL</th><td>http://192.168.33.10:3000</td></tr>
<tr><th>Put your manifests in:</th><td>puppet/manifests</td></tr>
<tr><th>Put your modules in:</th><td>puppet/modules</td></tr>
+<tr><th>If you are using Hiera edit:</th><td>puppet/hiera.yaml</td></tr>
+<tr><th>Put your Hiera data in:</th><td>puppet/hieradata</td></tr>
</table>
##A bit more detail on what’s going on
@@ -5,13 +5,6 @@
##Need to install puppet dashboard and configure it
node default{
-
-
-
- #package { 'puppetdb-terminus':
- # ensure => latest,
- #}
-
package {'libapache2-mod-php5':
ensure => latest,
}
@@ -38,66 +31,65 @@
# Configure the puppet master to use puppetdb
class { 'puppetdb::master::config': }
- class {'dashboard':
- # dashboard_ensure => 'present',
- # dashboard_user => 'puppet-dbuser',
- # dashboard_group => 'puppet-dbgroup',
- # dashboard_password => 'changeme',
- # dashboard_db => 'dashboard_prod',
- # dashboard_charset => 'utf8',
- dashboard_site => $fqdn,
- dashboard_port => '3000',
- # mysql_root_pw => 'changemetoo',
- #passenger => true,
- require => Package["puppetmaster"],
- }
-
- #service{'puppetmaster':
- # ensure => running,
- # require => Package['puppetmaster'],
- # }
-
-
- ##we copy rather than symlinking as puppet will manage this
- file {'/etc/puppet/puppet.conf':
- ensure => present,
- owner => root,
- group => root,
- source => "/vagrant/puppet/puppet.conf",
- notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
- require => Package['puppetmaster'],
- }
-
- file {'/etc/puppet/autosign.conf':
- ensure => link,
- owner => root,
- group => root,
- source => "/vagrant/puppet/autosign.conf",
- notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
- require => Package['puppetmaster'],
- }
-
- file {'/etc/puppet/auth.conf':
- ensure => link,
- owner => root,
- group => root,
- source => "/vagrant/puppet/auth.conf",
- notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
- require => Package['puppetmaster'],
- }
-
- file {'/etc/puppet/fileserver.conf':
- ensure => link,
- owner => root,
- group => root,
- source => "/vagrant/puppet/fileserver.conf",
- notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
- require => Package['puppetmaster'],
- }
+ class {'dashboard':
+ dashboard_site => $fqdn,
+ dashboard_port => '3000',
+ require => Package["puppetmaster"],
+ }
+
+ ##we copy rather than symlinking as puppet will manage this
+ file {'/etc/puppet/puppet.conf':
+ ensure => present,
+ owner => root,
+ group => root,
+ source => "/vagrant/puppet/puppet.conf",
+ notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
+ require => Package['puppetmaster'],
+ }
- file {'/etc/puppet/modules':
- mode => '0644',
- recurse => true,
- }
+ file {'/etc/puppet/autosign.conf':
+ ensure => link,
+ owner => root,
+ group => root,
+ source => "/vagrant/puppet/autosign.conf",
+ notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
+ require => Package['puppetmaster'],
+ }
+
+ file {'/etc/puppet/auth.conf':
+ ensure => link,
+ owner => root,
+ group => root,
+ source => "/vagrant/puppet/auth.conf",
+ notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
+ require => Package['puppetmaster'],
+ }
+
+ file {'/etc/puppet/fileserver.conf':
+ ensure => link,
+ owner => root,
+ group => root,
+ source => "/vagrant/puppet/fileserver.conf",
+ notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
+ require => Package['puppetmaster'],
+ }
+
+ file {'/etc/puppet/modules':
+ mode => '0644',
+ recurse => true,
+ }
+
+ file { '/etc/puppet/hiera.yaml':
+ ensure => link,
+ owner => root,
+ group => root,
+ source => "/vagrant/puppet/hiera.yaml",
+ notify => [Service['puppetmaster'],Service['puppet-dashboard'],Service['puppet-dashboard-workers']],
+ }
+
+ file { '/etc/puppet/hieradata':
+ mode => '0644',
+ recurse => true,
+ }
}
View
@@ -1,38 +1,28 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
-Vagrant::Config.run do |config|
+Vagrant.configure("2") do |config|
config.vm.define :master do |master_config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
- master_config.vm.host_name = "puppet.pebbleit.dev"
+ master_config.vm.hostname = "puppet.pebbleit.dev"
# Every Vagrant virtual environment requires a box to build off of.
master_config.vm.box = "precise64"
# The url from where the 'master_config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
master_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
- # We need moar ramz
- master_config.vm.customize ["modifyvm", :id, "--memory", 1024]
- # Boot with a GUI so you can see the screen. (Default is headless)
- # config.vm.boot_mode = :gui
+
+ # If you're using VMWare Fusion rather than Virtualbox, you'll want to use this box_url instead
+ # master_config.vm.box_url = "http://files.vagrantup.com/precise64_vmware_fusion.box"
# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
- master_config.vm.network :hostonly, "192.168.33.10"
-
- # Assign this VM to a bridged network, allowing you to connect directly to a
- # network using the host's network device. This makes the VM appear as another
- # physical device on your network.
- # config.vm.network :bridged
-
- # Forward a port from the guest to the host, which allows for outside
- # computers to access the VM, whereas host only networking does not.
- #config.vm.forward_port 80, 80
+ master_config.vm.network :private_network, ip: "192.168.33.10"
# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
@@ -42,8 +32,9 @@ Vagrant::Config.run do |config|
# Enable the Puppet provisioner
master_config.vm.provision :puppet, :module_path => "VagrantConf/modules", :manifests_path => "VagrantConf/manifests", :manifest_file => "default.pp"
- master_config.vm.share_folder "puppet_manifests", "/etc/puppet/manifests", "puppet/manifests"
- master_config.vm.share_folder "puppet_modules", "/etc/puppet/modules", "puppet/modules"
+ master_config.vm.synced_folder "puppet/manifests", "/etc/puppet/manifests"
+ master_config.vm.synced_folder "puppet/modules", "/etc/puppet/modules"
+ master_config.vm.synced_folder "puppet/hieradata", "/etc/puppet/hieradata"
end
View
@@ -0,0 +1,10 @@
+---
+:hierarchy:
+ - %{::customer_name}/%{::customer_site}/%{::customer_build}
+ - %{::customer_name}/%{::customer_site}
+ - %{::customer_name}
+ - common
+:backends:
+ - yaml
+:yaml:
+ :datadir: '/etc/puppet/hieradata'

0 comments on commit ae7193c

Please sign in to comment.