Quick Installation Method
  • Dark
    Light
  • PDF

Quick Installation Method

  • Dark
    Light
  • PDF

Requirements

  • 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 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.

#!/usr/bin/env bash

config_rhel_iag() {
  local username="$1"
  local username_default='itential'
  [ -z "$username" ] && username="$username_default"
   
    sudo dnf -y group install 'Development Tools'
    sudo dnf -y install  \
      python3  \
      python3-devel  \
      libffi-devel  \
      openssl-devel  \
      sqlite-devel  \
      libyaml  \
      libyaml-devel  \
      libselinux-python3  \
      bzip2-devel  \
      zlib-devel  \
      yaml-cpp  \
      yaml-cpp-devel  \
      haproxy20
    echo "# Adding user $username."
    sudo useradd -m itential
    echo "# Enter password for user $username."
    sudo passwd itential
    sudo mkdir -p /opt/automation-gateway/data
    sudo chown "$username:$username" /opt/automation-gateway/data
    sudo mkdir -p /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
    sudo chown -R "$username:$username" /usr/share/ansible \
      /usr/share/nornir \
      /usr/share/scripts \
      /usr/share/terraform
      
      # These firewall steps may not be needed in the full install guide. It may just mention the port number 8083.
    sudo firewall-cmd --zone=public --add-port=8083/tcp --permanent
    sudo firewall-cmd --reload
    
    sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    sudo dnf -y install terraform
}
config_rhel_iag_local() {
  local username="$1"
  local username_default='itential'
  local iag_version="$2"
  local iag_version_default='3.187.8'
  local registry_url="$3"
  local registry_url_default='registry.aws.itential.com/repository/automation-gateway/simple'
  local registry_username="$4"
  local registry_password="$5"
  if [ -z "$registry_username" ]; then
    echo '# Exiting. Registry username is required.'
    return 1
  fi
  if [ -z "$registry_password" ]; then
    echo '# Exiting. Registry password is required.'
    return 1
  fi
  [ -z "$username" ] && username="$username_default"
  [ -z "$iag_version" ] && iag_version="$iag_version_default"
  [ -z "$registry_url" ] && registry_url="$registry_url_default"
    python3 -m venv "$HOME/automation-gateway"
    source "$HOME/automation-gateway/bin/activate"
    python -m pip install --upgrade pip
    pip install --upgrade setuptools wheel ansible==2.10.7
    pip install nornir==3.2.0 netmiko==3.4.0 psutil pycrypto paramiko ncclient lxml nitrosdk-python jxmlease
    python -m pip install \
      automation-gateway=="$iag_version" \
      --extra-index-url "https://$registry_username:$registry_password@$registry_url"
}
config_rhel_iag_system() {
  local iag_version="$1"
  local iag_version_default='3.187.8'
  local registry_url="$2"
  local registry_url_default='registry.aws.itential.com/repository/automation-gateway/simple'
  local registry_username="$3"
  local registry_password="$4"
  if [ -z "$registry_username" ]; then
    echo '# Exiting. Registry username is required.'
    return 1
  fi
  if [ -z "$registry_password" ]; then
    echo '# Exiting. Registry password is required.'
    return 1
  fi
  [ -z "$iag_version" ] && iag_version="$iag_version_default"
  [ -z "$registry_url" ] && registry_url="$registry_url_default"
    sudo python3 -m pip install --upgrade pip
    sudo pip3 install --upgrade setuptools wheel ansible==2.10.7
    sudo pip3 install nornir==3.2.0 netmiko==3.4.0 psutil pycrypto paramiko ncclient lxml nitrosdk-python jxmlease
    sudo python3 -m pip install \
      automation-gateway=="$iag_version" \
      --extra-index-url "https://$registry_username:$registry_password@$registry_url"
}
start_iag_local() {
  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

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.