Skip to content

Instantly share code, notes, and snippets.

@Ichimonji10
Forked from omaciel/install_foretello.sh
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ichimonji10/a96c2f771bbe0b8afd17 to your computer and use it in GitHub Desktop.
Save Ichimonji10/a96c2f771bbe0b8afd17 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# Install fortello on to an Amazon EC2 instance. Make sure to set the variables
# in the head of this script.
set -o errexit -o nounset
# By default the EC2 instance's hostname matches its internal hostname. The
# fields ${private_ips} and ${public_dns} can be found in the EC2 Dashboard page
# when you select your instance.
readonly private_ips=
readonly public_dns=
# Red hat username, pool ID and password.
readonly rh_username=
readonly rh_poolid=
readonly rh_password=
#-------------------------------------------------------------------------------
# Default user for EC2 images is "ec2-user", so switch to "root"
sudo su -
echo "${private_ips} ${public_dns}" >> /etc/hosts
hostname "${public_dns}"
# We need to install a few packages, so let's configure our Red Hat
# subscription and enable a repo.
subscription-manager register --force --username=${rh_username} --password=${rh_password}
subscription-manager subscribe --pool=${rh_poolid}
subscription-manager repos --enable rhel-6-server-rpms
yum install -y ntp
service ntpd start
# Update the iptables rules
iptables -I INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport 5671 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport 8140 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport 9090 -j ACCEPT
iptables -I INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT
iptables-save > /etc/sysconfig/iptables
# We need these in order to run the installer
yum install -y git ruby
# Clone the installer code
git clone https://github.com/Katello/katello-deploy.git
# SElinux ON
setenforce 1
# Enable repositories and install packages for RHEL 6; If you want to
# use RHEL 7 instead, pass --os rhel7 to the script
cd katello-deploy && ./setup.rb --skip-installer --os rhel6
# Initial configuration with some defaults
katello-installer -v -d \
--foreman-admin-password='changeme' \
--foreman-initial-organization='Default_Organization' \
--foreman-initial-location='Default_Location'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment