Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

WIP

  • Loading branch information...
commit a1d04b98698d7f9a40c6ea7fd28a9363f258707f 1 parent 1205750
Brendon Rapp authored
Showing with 59 additions and 10 deletions.
  1. +22 −1 puppet-client.sh
  2. +30 −2 puppet-server.sh
  3. +7 −7 rbenv.sh
23 puppet-client.sh
View
@@ -1,5 +1,26 @@
#!/bin/bash
#
+# <UDF name="server" Label="Puppetmaster host" />
+#
# Install Puppet client
-apt-get install -y puppet
+## Install puppet from Rubygems if gem is present, otherwise use Debian package
+# TODO: Make configurable
+if which gem >/dev/null; then
+ gem install puppet
+else
+ apt-get install -y puppet
+fi
+
+## Configure puppetd.conf
+echo '[server]' >> /etc/puppetd.conf
+echo "server = $SERVER" >> /etc/puppetd.conf
+echo "logdir = /var/log/puppet" >> /etc/puppetd.conf
+echo "vardir = /var/lib/puppet" >> /etc/puppetd.conf
+echo "rundir = /var/run"
+
+## Rehash if using rbenv
+rbenv rehash
+
+## Start/restart Puppet
+puppet restart
32 puppet-server.sh
View
@@ -1,6 +1,34 @@
#!/bin/bash
#
+# <UDF name="gitrepo" default="" Label="Path to Git repo for Puppet config" />
+#
# Install Puppet server
+#
+
+## Install git
+apt-get install -y git
+
+## Install puppet from Rubygems if gem is present, otherwise use Debian package
+# TODO: Make configurable
+if which gem >/dev/null; then
+ gem install puppet
+else
+ apt-get install -y puppetmaster
+fi
+
+## Add Puppet configuration
+if [ -z $GITREPO ]
+then
+ # No Git repo - create default configuration in /etc/puppet
+ #
+ # Generate config file
+ puppetmasterd --genconfig --no-daemonize > /etc/puppet/reference-puppetmasterd.conf
-apt-get install -y puppetmaster
-touch /etc/puppet/manifests/site.pp
+ # Create folders and default manifest
+ mkdir -p /etc/puppet/manifests/classes
+ mkdir -p /etc/puppet/modules
+ mkdir -p /etc/puppet/files
+ touch /etc/puppet/manifests/site.dd
+else
+ git clone $GITREPO /etc/puppet
+fi
14 rbenv.sh
View
@@ -1,5 +1,7 @@
#!/bin/bash
#
+# <UDF name="ruby" oneof="1.9.3=p0,1.9.2-p290,1.8.7-p357", label="Ruby to install as default">
+#
# System-wide Ruby with rbenv and ruby-build
## Update apt
@@ -12,10 +14,8 @@ apt-get install -y build-essential zlib1g-dev libssl-dev libreadline5-dev curl
apt-get install -y git
## Install ruby-build
-cd /tmp
-git clone git://github.com/sstephenson/ruby-build.git
-cd ruby-build
-./install.sh
+git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
+/tmp/ruby-build/install.sh
## Install rbenv
RBENV_ROOT="/usr/local/rbenv"
@@ -28,9 +28,9 @@ echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
-## Install Ruby 1.9.3-p0 and set as global Ruby
-rbenv install 1.9.3-p0
-rbenv global 1.9.3-p0
+## Install Ruby and set as global Ruby
+rbenv install $RUBY
+rbenv global $RUBY
rbenv rehash
## Install Bundler
Please sign in to comment.
Something went wrong with that request. Please try again.