Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Latest commit

 

History

History
79 lines (58 loc) · 2.41 KB

installing-ansible.md

File metadata and controls

79 lines (58 loc) · 2.41 KB

Installing Ansible

Installing Ansible

  • Target Ansible version ≥ 2.7
  • Official Documentation
  • Explore a couple approaches using:
    • OS package manager
    • Python package manager (pip)

Base Requirements

Python

  • Ansible < 2.5 require Python 2.7
    • support for Python 3 considered tech preview
  • Ansible ≥ 2.5 supports Python 2.7 and Python ≥ 3.5

Installing OS package

  • Ansible available with OS typically a bit out of date
  • Generally necessary to add source repo (apt, yum, etc.)

Installing as Python virtualenv

  • Other method is to set up a Python virtual environment
  • Advantage of this technique: multiple separate ansible environments
    • Different needs for different projects
  • Generally possible with both Python2 and Python3
    • We'll assume Python3

Ansible in a Python Virtual Environment

  • Install python requirements
    sudo apt-get install python3-pip virtualenv
    
  • Set up local Python environment
    virtualenv -p /usr/bin/python3 ~/venv
    

Install Ansible

  • Activate virtualenv as base of Python interpreter
    source ~/venv/bin/activate
    
  • Update Python package manager (pip)
    pip install -U pip
    
  • Use Python package manager to install Ansible
    pip install ansible
    

Extras

  • Install some tools that we'll need for the cloud
    pip install openstacksdk dnspython
    
    pip install python-{openstackclient,ceilometerclient,heatclient,neutronclient,swiftclient,octaviaclient,magnumclient}
    

Ansible release cycle

  • It is worth keeping up to date with Ansible releases
  • Use pip or a PPA to get a recent version
  • Ansible is developed and released on a flexible 4 months release cycle
  • Ansible supports the two most recent major stable releases