Quick Installation Method
  • Dark
    Light
  • PDF

Quick Installation Method

  • Dark
    Light
  • PDF

Quick Install (RHEL 7)

The RHEL 7 installation guide exactly matches the CentOS 7 installation guide with the following important exceptions:

  • Each RHEL instance must be fully registered before many features (e.g., yum) can be utilized.
    • For registration information see RedHat Registration Information.
    • To enable automatic registration via CLI use: subscription-manager register --auto-attach.
    • If issues arise with automatic registration you can try to use the register, auto-attach and attach functions of subscription-manager.
    • Additional RHEL registration information or troubleshooting is beyond the scope of this installation guide.
  • The epel-release command should not be run as it will fail: yum -y install epel-release.

Quick Install (CentOS 7)

Notes:

  • This quick install script is tested against a fresh installation of CentOS 7 Minimal. Users must fill-in the below variables, review the script, and then run it as root.

  • Do not forget to edit the first set of exported variables before running!


The following method is great for quickly booting Automation Gateway for testing purposes. Due to its use of the python virtualenv module, it is very easy to retry a fresh installation if you make any mistakes. However, it should be understood that you can run Automation Gateway via global, user, or venv installations as you see fit for your environment. Therefore, we recommend the quick install for testing and the Full Installation Method for a production environment.

With regard to integrations and versioning, the script assumes you do not have an existing Ansible, Nornir, Terraform installation and no preference on the versioning of them.

echo "## CUSTOMIZE THESE VARIABLES BEFORE RUNNING THIS SCRIPT: ##" && \
export AUTOMATION_GATEWAY_VERSION="" && \
export REGISTRY_USERNAME="" && \
export REGISTRY_PASSWORD="" && \
export REGISTRY_URL="registry.aws.itential.com/repository/automation-gateway-release/simple" && \

echo "## ENABLE REPOSITORIES ##" && \
yum -y install epel-release && \
yum -y install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

echo "## UPDATE SYSTEM PACKAGES ##" && \
yum -y update

echo "## INSTALL SYSTEM DEPENDENCIES ##" && \
yum -y install gcc-c++ make yaml-cpp yaml-cpp-devel libyaml libyaml-devel libselinux-python

echo "## INSTALL PYTHON ##" && \
yum -y install python3-devel python3-pip

echo "## EXPOSE PORT(S) ##" && \
firewall-cmd --zone=public --add-port=8083/tcp --permanent && \
firewall-cmd --reload

echo "## CREATE NON ROOT USER ##" && \
useradd itential && \
usermod -aG wheel itential && \
echo "itential ALL = NOPASSWD: /home/itential/automation-gateway/bin/automation-gateway-setup.sh" >> /etc/sudoers && \

echo "## CREATE AND ASSIGN DIRECTORIES ##" && \
mkdir -p /opt/automation-gateway/data \
         /usr/share/ansible/inventory \
         /usr/share/ansible/modules \
         /usr/share/ansible/roles \
         /usr/share/ansible/collections \
         /usr/share/ansible/playbooks \
         /usr/share/nornir/modules \
         /usr/share/scripts \
         /usr/share/terraform && \
chown -R itential:itential \
         /opt/automation-gateway/data \
         /usr/share/ansible \
         /usr/share/nornir \
         /usr/share/scripts \
         /usr/share/terraform

echo "## SWITCH USER ##" && \
su itential
cd

echo "## CREATE PYTHON VIRTUAL ENVIRONMENT ##" && \
python3.6 -m venv $HOME/automation-gateway && \
source $HOME/automation-gateway/bin/activate

echo "## INSTALL PYTHON DEPENDENCIES ##" && \
python3.6 -m pip install --upgrade pip==20.2.4 setuptools==58.0.1 wheel

echo "## INSTALL AUTOMATION GATEWAY AND INTEGRATIONS (Ansible/Nornir/Netmiko/Terraform/etc) ##" && \
python3.6 -m pip install \
  automation-gateway[integrations]==$AUTOMATION_GATEWAY_VERSION \
  --extra-index-url https://$REGISTRY_USERNAME:$REGISTRY_PASSWORD@$REGISTRY_URL

echo "## INSTALLATION COMPLETE ##"

At this point, your system, python, and Automation Gateway installations are all complete. The final decision will be how you would like to start the server.

Quick Start (On Demand)

The Quick Start is most appropriate for temporary testing of properties.yml settings, firewalls, etc. As the server will stop as soon as the user inputs CTRL-C or the terminal session is closed, this method is not suitable for anything other than testing.

echo "## START AUTOMATION GATEWAY ##" && \
echo "## REMEMBER TO SOURCE $HOME/automation-gateway/bin/activate ON SUBSEQUENT RUNS ##" && \
source $HOME/automation-gateway/bin/activate && \
automation-gateway

Service Start (Systemd Script)

Installing Automation Gateway as a service allows the server to persist beyond a single terminal session and even through system failures or reboots. Systemd Services require elevated permissions. Either run the setup script as root with the absolute path to automation-gateway-setup.sh or via the sudo command with the $HOME shortcut as in the example below. The sudo method assumes the /etc/sudoers modification from the quick install above. The modification allows the itential user to run the setup via sudo without a password.

The Systemd Service Start is most appropriate for production installations, but can also be used to test all aspects of the server as long as you have access to rebooting the process via systemctl:

systemctl restart automation-gateway

To begin the interactive installation process, simply use:

echo "## START AUTOMATION GATEWAY ##" && \
sudo $HOME/automation-gateway/bin/automation-gateway-setup.sh --setup

To run the non-interactive installation process, simply copy/paste the following after changing any default parameters to your liking:

echo "## START AUTOMATION GATEWAY ##" && \
sudo $HOME/automation-gateway/bin/automation-gateway-setup.sh \
  --setup \
  --user=itential \
  --custom-content-dir=/usr/share \
  --install-dir=/opt/automation-gateway \
  --systemd \
  --start-on-boot