puppetagent-install-trusty

by walterheck
27 deployments · 23 still active · last rev. 9 months ago

A stackscript to install puppet agent on ubuntu 14.04 LTS.

This script will set the hostname you supply, install the puppet agent from puppetlabs' PC1 repository and then do a puppet agent run against the specified puppetmaster

Compatible with: Ubuntu 14.04 LTS
						#!/bin/bash
# <UDF name="fqdn" Label="FQDN for the new host" />
# <UDF name="puppetmaster" Label="FQDN for the puppetmaster this node needs to listen to" />
# <UDF name="pingbackurl" Label="A URL that will receive a GET request once the stackscript is done" />

# Include the bash stack script library
source <ssinclude StackScriptID=1>

# disable IPv6
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf

# set the hostname
system_set_hostname $FQDN

# get the first ip address and create an /etc/hosts entry
IP=system_primary_ip
system_add_host_entry $IP $FQDN

# download the puppetlabs apt repo package
cd /tmp
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
dpkg -i /tmp/puppetlabs-release-pc1-trusty.deb

# run aptitude updates
system_update

# install puppet agent
aptitude install puppet-agent

# run puppet agent
/opt/puppetlabs/bin/puppet agent -t --server $PUPPETMASTER

#put a get http request into the pingback url
curl $PINGBACKURL