Created
November 3, 2016 00:24
-
-
Save GeoffWilliams/165a72fb3a9493d8e2cbeb026547b490 to your computer and use it in GitHub Desktop.
create symlinks for pe_kit to allow module development in /shared
This file contains hidden or 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 | |
| ENV_DIR=/etc/puppetlabs/code/environments/production | |
| MOD_DIR=$ENV_DIR/modules | |
| which r10k || gem install r10k | |
| # link system.yaml (lowmem settings + disable code manager) to where puppet | |
| # expects to be able to find them, otherwise code manager will be enabled after | |
| # and memory will spike after running this script | |
| if [ ! -s /system.yaml ] ; then | |
| ln -s /etc/puppetlabs/code/system.yaml /system.yaml | |
| fi | |
| cd r10k-control && r10k puppetfile install -v && cd .. | |
| if [ -d $ENV_DIR ] ; then | |
| rm -rf $ENV_DIR | |
| ln -s /shared/r10k-control $ENV_DIR | |
| fi | |
| if [ -d $MOD_DIR/r_profile ] ; then | |
| rm -rf $MOD_DIR/r_profile | |
| ln -s /shared/r_profile $MOD_DIR/r_profile | |
| fi | |
| if [ -d $MOD_DIR/nagios ] ; then | |
| rm -rf $MOD_DIR/nagios | |
| fi | |
| if [ ! -L $MOD_DIR/nagios ] ; then | |
| ln -s /shared/nagios $MOD_DIR/nagios | |
| fi | |
| if [ -d $MOD_DIR/tomcat ] ; then | |
| rm -rf $MOD_DIR/tomcat | |
| fi | |
| if [ ! -L $MOD_DIR/tomcat ] ; then | |
| ln -s /shared/puppetlabs-tomcat $MOD_DIR/tomcat | |
| fi | |
| if [ ! -L $MOD_DIR/psquared ] ; then | |
| ln -s /shared/psquared $MOD_DIR/psquared | |
| fi | |
| if [ ! -L $MOD_DIR/r_role ] ; then | |
| ln -s /shared/r_role $MOD_DIR/r_role | |
| fi | |
| if [ ! -L $MOD_DIR/network_address ] ; then | |
| ln -s /shared/network_address $MOD_DIR/network_address | |
| fi | |
| if [ ! -L $MOD_DIR/testcase ] ; then | |
| ln -s /shared/testcase $MOD_DIR/testcase | |
| fi | |
| # invalide cache | |
| curl -i --cert $(puppet config print hostcert) --key $(puppet config print hostprivkey) --cacert $(puppet config print cacert) -X DELETE https://$(facter fqdn):8140/puppet-admin-api/v1/environment-cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment