1_prep.sh
#!/bin/bash #Common Prep #--------------------- yum update -y yum install -y vim perl htop tree #RHEL -- nmcli general hostname puppet.frankencloud.net #AWSLinux -- perl -pi -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=puppet.frankencloud.net/g' /etc/sysconfig/network perl -pi -e 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config perl -pi -e 's/ - set_hostname/# - set_hostname/g' /etc/cloud/cloud.cfg perl -pi -e 's/ - update_hostname/# - update_hostname/g' /etc/cloud/cloud.cfg perl -pi -e 's/ - update_etc_hosts/# - update_etc_hosts/g' /etc/cloud/cloud.cfg perl -pi -e 's/127.0.0.1 /127.0.0.1 puppet puppet.frankencloud.net /g' /etc/hosts perl -pi -e 's/::1 /::1 puppet puppet.frankencloud.net /g' /etc/hosts reboot
2_prep.sh
#!/bin/bash #User Prep #--------------------- echo -e "syntax on\nhighlight comment ctermfg=cyan" > /home/ec2-user/.vimrc echo -e "LS_COLORS=\$LS_COLORS:'di=0;36:' ; export LS_COLORS" >> /home/ec2-user/.bashrc echo -e 'PS1='\''\['\\'\033[01;32m\][\u\['\\'\033[01;33m\]@\h:\['\\'\033[01;36m\]\W\['\\'\033[01;32m\]]\$\['\\'\033[00m\]'\' >> /home/ec2-user/.bashrc echo -e "set bell-style none" >> .inputrc #Master Prep #------------- rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install -y python34 unzip git echo -e "syntax on\nhighlight comment ctermfg=cyan" > /root/.vimrc echo -e "LS_COLORS=\$LS_COLORS:'di=0;36:' ; export LS_COLORS" >> /root/.bash_profile echo -e 'PS1='\''\['\\'\033[01;31m\][\u\['\\'\033[01;33m\]@\h:\['\\'\033[01;36m\]\W\['\\'\033[01;31m\]]\$\['\\'\033[00m\]'\' >> /root/.bash_profile echo -e "alias tree='tree -C'" >> /root/.bash_profile echo -e "alias telnets='openssl s_client -quiet -connect'" >> /root/.bash_profile curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip /usr/local/bin/python[V.v] awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws ln -s /usr/local/bin/aws /usr/local/sbin/aws curl -L -o /root/pe-latest.tgz 'https://pm.puppetlabs.com/cgi-bin/download.cgi?dist=el&rel=7&arch=x86_64&ver=latest' tar -xvzf pe-latest.tgz puppet master --mkusers --verbose puppet agent --test --server='puppet' halt
3_prep.sh
echo -e "100.0.1.121 puppet puppet.frankencloud.net" >> /etc/hosts perl -pi -e 's/HOSTNAME=localhost.localdomain/HOSTNAME=node01.frankencloud.net/g' /etc/sysconfig/network