ProServices CentOS 7 Deployment

by professional
78 deployments · 86 still active · last rev. 3 months ago

** DO NOT USE **
Basic setup for a proservices deployed CentOS 7 instance and grants access to the proservices team

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="NEW_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,nginx,php,php-fpm,php-mysql,varnish,haproxy,postgresql,redis" default=""/>

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 "$NEW_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