Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 87b7369531
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (37 sloc) 1.766 kb
<%= ERB.new(File.read(find_template('fragments/set_http_get')), nil, "<>", '_ipe_set_http_get').result(binding) %>
PATH="/opt/puppet/bin:$PATH"
export PATH
install_dir="puppet-enterprise"
if [ ! -e "${install_dir}" ]; then
mkdir "${install_dir}"
fi
echo "Downloading from: <%= options['installer_payload'] %>"
# We assume the payload is a tar.gz file because the option handler
# enforces this.
# To save disk space (I'm concerned about /tmp filling) decompress on the fly.
echo "Uncompressing the payload ..."
$http_get '<%= options['installer_payload'] %>' | \
gunzip -c | \
{ cd "${install_dir}" && tar -xvf -; } && \
echo "Uncompressing the payload ... Done."
echo 'Downloading answers file'
$http_get '<%= options['answers_payload'] %>' > puppet.answers.orig
# Give me everything _except_ any agent certname specified in the answers
# file, and the agent's server setting. Useless use of cat is for clarity
# Note that this particular ERB syntax requires that the trim_mode be set
# to <> when ERB.new is called (or some other alternative which will
# suppress newlines) or else this shell code will not work.
cat puppet.answers.orig | \
grep -v '^q_puppetmaster_certname' | \
<% if options['puppetmaster'] %>
grep -v '^q_puppetagent_server' | \
<% end %>
cat > puppet.answers
# Append the user specified option from the command line arguments.
echo 'q_puppetmaster_certname=<%= options['certname'] %>' >> puppet.answers
echo 'q_puppetagent_certname=<%= options['certname'] %>' >> puppet.answers
<% if options['puppetmaster'] %>
echo 'q_puppetagent_server=<%= options['puppetmaster'] %>' >> puppet.answers
<% end %>
# Install Puppet Enterprise
"${install_dir}"/*puppet*/puppet-enterprise-installer -a puppet.answers 2>&1 | tee install.log
Jump to Line
Something went wrong with that request. Please try again.