-
-
Save rkive/7773419 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd . | |
cd /tmp/ | |
hostname_component=$(hostname -f | sed -E 's/^\w+-(\w+).*/\1/') | |
case $hostname_component in | |
staging) | |
puppetmaster=chi-staging-puppetmaster-1.nr-ops.net | |
agent_environment=staging | |
;; | |
ops) | |
puppetmaster=chi-staging-puppetmaster-1.nr-ops.net | |
agent_environment=staging | |
;; | |
prod) | |
puppetmaster=chi-prod-puppetmaster-1.nr-ops.net | |
agent_environment=production | |
;; | |
*) | |
puppetmaster=chi-staging-puppetmaster-1.nr-ops.net | |
agent_environment=master | |
;; | |
esac | |
VERSION="3.1.0" | |
INSTALLER="puppet-enterprise-$VERSION-el-6-x86_64.tar.gz" | |
curl --output pe-$VERSION.tar.gz https://s3.amazonaws.com/pe-builds/released/$VERSION/$INSTALLER | |
tar -xzf pe-$VERSION.tar.gz | |
sudo /tmp/puppet-enterprise-$VERSION-el-6-x86_64/puppet-enterprise-uninstaller -p -y | |
cat > /tmp/stomp_server.txt << HERE | |
fact_stomp_server=${puppetmaster} | |
fact_is_puppetagent=true | |
HERE | |
sudo mkdir -p /etc/puppetlabs/facter/facts.d/ | |
sudo mv /tmp/stomp_server.txt /etc/puppetlabs/facter/facts.d/ | |
sudo chown root:root /etc/puppetlabs/facter/facts.d/stomp_server.txt | |
cat > /tmp/pe.upgrade.answers << HERE | |
q_all_in_one_install=n | |
q_database_install=n | |
q_fail_on_unsuccessful_master_lookup=y | |
q_agent_environment=${agent_environment} | |
q_install=y | |
q_puppet_cloud_install=n | |
q_puppet_enterpriseconsole_install=n | |
q_puppet_symlinks_install=y | |
q_puppetagent_certname=$(hostname -f) | |
q_puppetagent_install=y | |
q_puppetagent_server=${puppetmaster} | |
q_puppetca_install=n | |
q_puppetdb_install=n | |
q_puppetmaster_install=n | |
q_rubydevelopment_install=n | |
q_run_updtvpkg=n | |
q_upgrade_install_wrapper_modules=n | |
q_upgrade_installation=y | |
q_upgrade_remove_mco_homedir=n | |
q_vendor_packages_install=n | |
q_verify_packages=y | |
HERE | |
sudo yum clean all | |
sudo FACTER_fact_stomp_server=$puppetmaster /tmp/puppet-enterprise-$VERSION-el-6-x86_64/puppet-enterprise-installer -A /tmp/pe.upgrade.answers | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment