Added support for deploying puppetmaster using webrick
This commit is contained in:
parent
5aded5e39f
commit
105978c2d5
4 changed files with 103 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
Installing the required gems on CentOS 6:
|
||||
|
||||
yum install ruby ruby-devel rubygems sqlite sqlite-devel
|
||||
yum install gcc make ruby ruby-devel rubygems sqlite sqlite-devel
|
||||
gem install --no-rdoc --no-ri rubygems-update && update_rubygems
|
||||
gem install --no-rdoc --no-ri mongrel sqlite3
|
||||
gem install --no-rdoc --no-ri mongrel
|
||||
gem install --no-rdoc --no-ri sqlite3
|
||||
gem install --no-rdoc --no-ri rails -v 2.3.14
|
||||
|
|
45
puppet/bootstrap-standalone.sh
Executable file
45
puppet/bootstrap-standalone.sh
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
|
||||
hostname -f | fgrep "." > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "error, command 'hostname -f' does not return domainname" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
which ruby > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "error, ruby binary not in path" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
which puppet > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "error, puppet binary not in path" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -s /etc/puppet/puppet.conf ]; then
|
||||
mv /etc/puppet/puppet.conf /etc/puppet/puppet.conf.orig
|
||||
fi
|
||||
|
||||
FQDN="$(hostname -f)"
|
||||
|
||||
mkdir -p /etc/puppet/manifests/node
|
||||
|
||||
cat > /etc/puppet/manifests/site.pp << EOF
|
||||
import "node/*.pp"
|
||||
|
||||
\$puppet_server = "${FQDN}"
|
||||
EOF
|
||||
|
||||
cat > /etc/puppet/manifests/node/${FQDN}.pp << EOF
|
||||
node "${FQDN}" {
|
||||
|
||||
include puppet::server::webrick
|
||||
include puppet::manual
|
||||
|
||||
}
|
||||
EOF
|
||||
|
||||
puppet cert --keylength 4096 --list
|
||||
puppet apply --no-report /etc/puppet/manifests/site.pp
|
|
@ -421,6 +421,57 @@ class puppet::server::common inherits puppet::client {
|
|||
}
|
||||
|
||||
|
||||
# Install and configure Puppet server using webrick.
|
||||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $puppet_listenports:
|
||||
# Array containing ports that puppetmaster should listen to. Defaults to
|
||||
# [ "8140" ].
|
||||
#
|
||||
class puppet::server::webrick {
|
||||
|
||||
require puppet::server::common
|
||||
|
||||
if ! $puppet_listenports {
|
||||
$puppet_listenports = [ "8140" ]
|
||||
}
|
||||
|
||||
service { "puppetmaster":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasstatus => true,
|
||||
subscribe => File["/etc/puppet/fileserver.conf",
|
||||
"/etc/puppet/puppet.conf"],
|
||||
require => Package["puppetmaster"],
|
||||
}
|
||||
|
||||
case $operatingsystem {
|
||||
debian,ubuntu: {
|
||||
file { "/etc/default/puppetmaster":
|
||||
ensure => present,
|
||||
content => template("puppet/puppetmaster.default.erb"),
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["puppetmaster"],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
file { "/etc/sysconfig/puppetmaster":
|
||||
ensure => present,
|
||||
content => template("puppet/puppetmaster.sysconfig.erb"),
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
notify => Service["puppetmaster"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install and configure Puppet server using mongrel.
|
||||
#
|
||||
# === Global variables
|
||||
|
|
|
@ -15,7 +15,11 @@ DAEMON_OPTS=""
|
|||
# mongrel. Requires front-end web-proxy such as
|
||||
# apache, nginx, or pound)
|
||||
# See: http://reductivelabs.com/trac/puppet/wiki/UsingMongrel
|
||||
<% if puppet_listenports.length > 1 -%>
|
||||
SERVERTYPE=mongrel
|
||||
<% else -%>
|
||||
SERVERTYPE=webrick
|
||||
<% end -%>
|
||||
|
||||
# How many puppetmaster instances to start? Its pointless to set this
|
||||
# higher than 1 if you are not using mongrel.
|
||||
|
|
Loading…
Add table
Reference in a new issue