AgiusCloud

by inboundme
1 deployments · 1 still active · last rev. 23 days ago

Compatible with: Ubuntu 16.04 LTS
						#!/bin/bash

# Linode

echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
apt-get -y install whois

VERSION=1.0.0
TIME_ZONE=America/Sao_Paulo
TOKEN=a7953948837f02ad91a436e7f8c0b782aff33ddfc74cdb4f35581a9f52dabf82
USER_HTTP=http_teste
USER_SSH=teste
PASS_HTTP=$(openssl passwd -crypt SnfHBptdYh)
PASS_SSH=$(mkpasswd -m sha-512 4igpoaapjB | tr -d '\n')
PASS_DB=u6ZN6DBoxp
EMAIL=claudiaferraz@inboundme.com.br
SERVER=za3QOoJA
HOSTNAME=ac00935.agiuscloud.net
HOST=ac00935.teste

echo "$TIME_ZONE" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
locale-gen --purge en_US.UTF-8

hostnamectl set-hostname $HOST
sed -i "s/localhost.localdomain/$HOST/" /etc/hosts
sed -i "s/localhost/$HOST/2" /etc/hosts

wget -4 -qO puppet-agent https://git.io/v9U6M
source puppet-agent

# Version
echo -e "ac_version=$VERSION" >> /etc/facter/facts.d/.version.txt

# Server
echo -e "ac_time_zone=$TIME_ZONE" >> /etc/facter/facts.d/.server.txt
echo -e "ac_token=$TOKEN" >> /etc/facter/facts.d/.server.txt
echo -e "ac_server=$SERVER" >> /etc/facter/facts.d/.server.txt

# User
echo -e "ac_user_http=$USER_HTTP" >> /etc/facter/facts.d/.users.txt
echo -e "ac_user_ssh=$USER_SSH" >> /etc/facter/facts.d/.users.txt
echo -e "ac_pass_http=$PASS_HTTP" >> /etc/facter/facts.d/.users.txt
echo -e "ac_pass_ssh=$PASS_SSH" >> /etc/facter/facts.d/.users.txt
echo -e "ac_email=$EMAIL" >> /etc/facter/facts.d/.users.txt

# Password root DB
echo -e "ac_pass_db=$PASS_DB" >> /etc/facter/facts.d/.db.txt

rm /etc/puppetlabs/puppet/puppet.conf

echo -e "[main]" >> /etc/puppetlabs/puppet/puppet.conf
echo -e "server = master.agiuscloud.com" >> /etc/puppetlabs/puppet/puppet.conf
echo -e "certname = $HOSTNAME" >> /etc/puppetlabs/puppet/puppet.conf
echo -e "runinterval = 30m" >> /etc/puppetlabs/puppet/puppet.conf
#echo - "splay = true" >> /etc/puppetlabs/puppet/puppet.conf
#echo -e "splaylimit = 30s" >> /etc/puppetlabs/puppet/puppet.conf
echo -e "[agent]" >> /etc/puppetlabs/puppet/puppet.conf
echo -e "report = true" >> /etc/puppetlabs/puppet/puppet.conf

curl -L "https://app.agiuscloud.com/api/server/create?api_token=$TOKEN&serverID=$SERVER"
curl -L "https://app.agiuscloud.com/api/server/agent?api_token=$TOKEN&serverID=$SERVER"