Setup

Supported distros

Currently supported distros are:

  • Fedora 25, 26, 27
  • RHEL 7.3, 7.4, 7.5

Warning

Python 2.7 and virtualenv are required.

Prerequisites

Warning

sudo or root access is needed to install prerequisites!

General requirements:

sudo yum install git gcc libffi-devel openssl-devel

Note

Dependencies explained:

  • git - version control of this project
  • gcc - used for compilation of C backends for various libraries
  • libffi-devel - required by cffi
  • openssl-devel - required by cryptography

Closed Virtualenv is required to create clean python environment separated from system:

sudo yum install python-virtualenv

Ansible requires python binding for SELinux:

sudo yum install libselinux-python

otherwise it won’t be able to run modules with copy/file/template functions!

Note

libselinux-python is in Prerequisites but doesn’t have a pip package. It must be installed on system level.

Note

Ansible requires also libselinux-python installed on all nodes using copy/file/template functions. Without this step all such tasks will fail!

Virtualenv

infrared shares dependencies with other OpenStack products and projects. Therefore there’s a high probability of conflicts with python dependencies, which would result either with infrared failure, or worse, with breaking dependencies for other OpenStack products. When working from source, virtualenv usage is recommended for avoiding corrupting of system packages:

virtualenv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools

Warning

Use of latest ``pip`` is mandatory, especially on RHEL platform!

Note

On Fedora 23 with EPEL repository enabled, RHBZ#1103566 also requires

dnf install redhat-rpm-config

Installation

Clone stable branch from Github repository:

git clone https://github.com/redhat-openstack/infrared.git

Install infrared from source:

cd infrared
pip install .

Note

For development work it’s better to install in editable mode and work with master branch:

pip install -e .

Ansible Configuration

Config file(ansible.cfg) could be provided to get custom behavior for Ansible. For more details about Ansible config file options: `http://docs.ansible.com/ansible/latest/intro_configuration.html`_

Infrared try to locate the Ansible config file(ansible.cfg) in several locations, in the following order:

  • ANSIBLE_CONFIG (an environment variable)
  • ansible.cfg (in the current directory)
  • ansible.cfg (in the Infrared home directory)
  • .ansible.cfg (in the home directory)

If none of this location contains Ansible config, InfraRed will create a default one in Infrared’s home directory

1
2
3
4
5
6
7
8
9
[defaults]
host_key_checking = False
forks = 500
timeout = 30
force_color = 1

[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=60s

Note

Values for forks, host_key_checking and timeout have to be the same or greater.

Bash completion

Bash completion script is in etc/bash_completion.d directory of git repository. To enable global completion copy this script to proper path in the system (/etc/bash_completion.d):

cp etc/bash_completion.d/infrared /etc/bash_completion.d/

Alternatively, just source it to enable completion temporarily:

source etc/bash_completion.d/infrared

When working in virtualenv, might be a good idea to add import of this script to the virtualenv activation one:

echo ". $(pwd)/etc/bash_completion/infrared" >> ${VIRTUAL_ENV}/bin/activate