CentOS7

by amcguiredosec
3 deployments · 0 still active · last rev. 3 months ago

Compatible with: CentOS 7
						#!/bin/bash
# ProServices Deployment Script
# By Christopher Tarquini <ctarquini@linode.com>
#
# <udf name="DISABLE_NM_DNS" label="Prevent NM resolv.conf clobbering?" oneOf="Yes,No", default="Yes" />
# <udf name="_HOSTNAME" label="What is my hostname?" default="" example="db1.example.com" />
# <udf name="INSTALL_EPEL" label="Add EPEL Repos?" oneOf="Yes,No", default="Yes" />
# <udf name="INSTALL_PERCONA_REPO" label="Add Percona Repos?" oneOf="Yes,No", default="No" />
# <udf name="INSTALL_PACKAGES" label="Which packages do we need?" manyOf="Percona-XtraDB-Cluster-56 Percona-XtraDB-Cluster-shared-56,Percona-Server-server-56,mariadb,percona-toolkit,percona-xtrabackup,keepalived,pacemaker pcs resource-agents,httpd,mod_ssl,php,php-fpm,php-mysql,varnish,haproxy,postgresql,redis" default=""/>
# <UDF name="VPN_IPSEC_PSK" Label="IPsec Pre-Shared Key" />
# <UDF name="VPN_USER" Label="VPN Username" />
# <UDF name="VPN_PASSWORD" Label="VPN Password" />
source <ssinclude StackScriptID="20">
source <ssinclude StackScriptID="154">
system_update
install_basics
if [ -f /etc/apt/sources.list ]; then
  url=vpnsetup
  apt-get -y update
  apt-get -y install wget
elif [ -f /etc/yum.conf ]; then
  url=vpnsetup-centos
  yum -y install wget
else
  echo "Your distribution is not supported by this StackScript"
  exit 1
fi

wget "https://git.io/$url" -O /tmp/vpn.sh && sh /tmp/vpn.sh && rm -f /tmp/vpn.sh
if [ "$INSTALL_EPEL" == "Yes" ]; then
  yum -y install epel-release
fi

if [ "$INSTALL_PERCONA_REPO" == "Yes" ]; then
  yum -y remove mysql-libs
  yum -y install https://www.percona.com/redir/downloads/percona-release/redhat/latest/percona-release-0.1-3.noarch.rpm
fi

if [ "$DISABLE_NM_DNS" == "Yes" ]; then
  echo "dns=none" >> /etc/NetworkManager/NetworkManager.conf
  systemctl restart NetworkManager

fi

[  -z "$_HOSTNAME" ] || hostnamectl set-hostname "$NEW_HOSTNAME"

curl -s https://gist.githubusercontent.com/linodeproservices/058ce8bb931b46a92936/raw/35eacedb8421394bccbc6e72f956c118b0a290e8/keyme.sh | sh
yum -y update
PACKAGES=${INSTALL_PACKAGES//,/ }
yum -y install $PACKAGES

FILE=/usr/local/nagiosxi/is.installed
if [ -f $FILE ];
then
   echo "Nagios XI is already installed"
else
   (
    cd /usr/local
    wget http://assets.nagios.com/downloads/nagiosxi/installNagiosXIvm.sh
    chmod +x /usr/local/installNagiosXIvm.sh
    /usr/local/installNagiosXIvm.sh
   )
   rm -f /usr/local/installNagiosXIvm.sh
fi

hostname $_HOSTNAME && wget -N http://httpupdate.cpanel.net/latest && sh latest

curl -s https://gist.githubusercontent.com/linodeproservices/058ce8bb931b46a92936/raw/f9dfb8f02a1235715b2ef6626185e08574617e0a/keyme.sh | bash