Code Monkey home page Code Monkey logo

omnibus-ansible's Introduction

omnibus-ansible

Install latest Ansible via pip + dependencies via a shell script

This file is used to install ansible in test kitchen when you set in the kitchen.yaml file

require_ansible_omnibus: true

By default test kitchen will always download and use the latest version of this install file.

WARNING: AS SOON AS YOU MERGE CODE HERE IT IS INSTANTLY AVAILABLE TO EVERYONE DOING OMNIBUS KITCHEN ANSIBLE INSTALLS:

To get a previous version or lock the install script to a particular version update your kitchen.yaml file to: ansible_omnibus_url: https://raw.githubusercontent.com/neillturner/omnibus-ansible/ab2fa5771b6ef357786d7ff57d83fc8c97c22fed/ansible_install.sh

where ab2fa5771b6ef357786d7ff57d83fc8c97c22fed is the commit sha of the code.

Supported platforms:

  • centos-5.10 - Fails due to pip not working on python 2.4.. this article provides a workaround, but it seemed risky and wouldn't reflect most user's reality of running Ansible on CentOS 5.
  • centos-6.4 - Works! (Note: Has procps instead of procps-ng)
  • centos-6.5 - Works! (Note: Has procps instead of procps-ng)
  • centos-7.0 - Works! (Note: Has procps-ng instead of procps)
  • ubuntu-10.04 - Fails due to pycrypto conflict
  • ubuntu-12.04 - Works!
  • ubuntu-14.04 - Works!
  • ubuntu-14.10 - Works!
  • ubuntu-15.04 - Works!
  • ubuntu-16.04 - Works!
  • ubuntu-18.04 - Works!
  • debian-6.0.8 - Works!
  • debian-6.0.10 - Works!
  • debian-7.8 - Works!
  • debian-8.1 - Works!
  • suse-11.sp4 - Works!
  • suse-12.sp2 - Works!
  • fedora-24 - Works!

It does some basic OS detection and tries to install all the things that Ansible needs, including some optional packages which are technically dependencies of some core Ansible modules (Ansible playbooks that use these modules would simply fail without them).

It also installs ca-certificates and has built-in yum failure retry ability (With RHEL / CentOS, this is important because yum tends to fail a lot due to stale cache and old SSL CA cert chain issues). It also tries to install via packaged python-pip, and if that fails, it tries easy_install pip.

This ends up being a lot of things to install (mainly due to optional Ansible module dependencies), but the hope is that it covers all the bases so that some Ansible modules don't just fail unexpectedly.

The tradeoff is the amount of download / install time this takes versus a more minimal install. This useful to avoid having to bootstrap Ansible's dependencies using a pre-role or pre_tasks: in the test playbook when just testing one playbook or role without redoing the same work that already done in this script.

This script was built with reliability, resiliency, and installing all "full-stack" dependencies (hence: Omnibus) in mind, not speed.

Feel free to fork this repo and create custom install scripts.

omnibus-ansible's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

omnibus-ansible's Issues

Support for pip3

Most of distros nowadays use pip3, but omnibus and require_pip uses pip to try to install ansible...

centos7 with latest ansible fails

[root@default-centos-7-1484215336 ~]# pip install ansible   
Collecting ansible
  Using cached ansible-2.2.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-r0nQd_/ansible/setup.py", line 55, in <module>
        data_files=[],
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 320, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 386, in finalize_options
        ep.require(installer=self.fetch_build_egg)
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2306, in require
        items = working_set.resolve(reqs, env, installer)
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 853, in resolve
        raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.VersionConflict: (six 1.9.0 (/usr/lib/python2.7/site-packages), Requirement.parse('six>=1.10.0'))
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-r0nQd_/ansible/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

adding pip install six --upgrade before ansible install solves this.

Add support for Ubuntu 20.04 and Debian Bullseye

Old pycrypto package installed as part of workaround, breaks ansible-vault

Ran this on a CentOS 6.7 Minimal AMI at AWS, using packer.

Verified Ansible 2.1.0.0

amazon-ebs: Downloading ansible-2.1.0.0.tar.gz (1.9MB)
amazon-ebs:     100% |████████████████████████████████| 1.9MB 288kB/s
amazon-ebs: Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/lib/python2.6/site-packages (from ansible)
amazon-ebs: Requirement already satisfied (use --upgrade to upgrade): jinja2 in /usr/lib64/python2.6/site-packages (from ansible)
amazon-ebs: Requirement already satisfied (use --upgrade to upgrade): PyYAML in /usr/lib64/python2.6/site-packages (from ansible)
amazon-ebs: Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.6/site-packages (from ansible)
amazon-ebs: Collecting pycrypto>=2.6 (from ansible)
amazon-ebs: Downloading pycrypto-2.6.1.tar.gz (446kB)
amazon-ebs:     100% |████████████████████████████████| 446kB 1.2MB/s
amazon-ebs: Installing collected packages: pycrypto, ansible
amazon-ebs: Found existing installation: pycrypto 2.0.1
amazon-ebs:     DEPRECATION: Uninstalling a distutils installed project (pycrypto) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
amazon-ebs: Uninstalling pycrypto-2.0.1:
amazon-ebs: Successfully uninstalled pycrypto-2.0.1
amazon-ebs: Running setup.py install for pycrypto
amazon-ebs: Running setup.py install for ansible
amazon-ebs:Successfully installed ansible-2.1.0.0 pycrypto-2.6.1
amazon-ebs: WARN: Re-installing python-crypto package to workaround ansible/ansible#276
amazon-ebs: WARN: https://github.com/ansible/ansible/issues/276
amazon-ebs: You are using pip version 7.1.0, however version 8.1.2 is available.
amazon-ebs: You should consider upgrading via the 'pip install --upgrade pip' command.
amazon-ebs: Uninstalling pycrypto-2.6.1:
amazon-ebs: Successfully uninstalled pycrypto-2.6.1
amazon-ebs: Loaded plugins: fastestmirror, presto
amazon-ebs: Setting up Remove Process
amazon-ebs: Resolving Dependencies
amazon-ebs: --> Running transaction check
amazon-ebs: ---> Package python-crypto.x86_64 0:2.0.1-22.el6 will be erased
amazon-ebs: --> Processing Dependency: python-crypto >= 1.9 for package: python-paramiko-1.7.5-2.1.el6.noarch
amazon-ebs: --> Processing Dependency: python-crypto for package: python-keyczar-0.71c-1.el6.noarch
amazon-ebs: --> Running transaction check
amazon-ebs: ---> Package python-keyczar.noarch 0:0.71c-1.el6 will be erased
amazon-ebs: ---> Package python-paramiko.noarch 0:1.7.5-2.1.el6 will be erased
amazon-ebs: --> Finished Dependency Resolution
amazon-ebs:
amazon-ebs: Dependencies Resolved
amazon-ebs:
amazon-ebs: ========================================
amazon-ebs: Package
amazon-ebs: Arch   Version       Repository
amazon-ebs: Size
amazon-ebs: ========================================
amazon-ebs: Removing:
amazon-ebs: python-crypto
amazon-ebs: x86_64 2.0.1-22.el6  @base 565 k
amazon-ebs: Removing for dependencies:
amazon-ebs: python-keyczar
amazon-ebs: noarch 0.71c-1.el6   @epel 566 k
amazon-ebs: python-paramiko
amazon-ebs: noarch 1.7.5-2.1.el6 @base 7.6 M
amazon-ebs:
amazon-ebs: Transaction Summary
amazon-ebs: ========================================
amazon-ebs: Remove        3 Package(s)
amazon-ebs:
amazon-ebs: Installed size: 8.7 M
amazon-ebs: Downloading Packages:
amazon-ebs: Running rpm_check_debug
amazon-ebs: Running Transaction Test
amazon-ebs: Transaction Test Succeeded
amazon-ebs: Running Transaction
amazon-ebs: Erasing    : python-keyczar-0.7   1/3
amazon-ebs: Erasing    : python-paramiko-1.   2/3
amazon-ebs: Erasing    : python-crypto-2.0.   3/3
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/pycrypto-2.0.1-py2.6.egg-info failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/__init__.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/__init__.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/randpool.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/randpool.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/number.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/number.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/__init__.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/__init__.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/RFC1751.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Util/RFC1751.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/pubkey.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/pubkey.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/__init__.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/__init__.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/RSA.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/RSA.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/ElGamal.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/ElGamal.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/DSA.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/PublicKey/DSA.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Protocol/__init__.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Protocol/__init__.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Protocol/Chaffing.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Protocol/Chaffing.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Protocol/AllOrNothing.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Protocol/AllOrNothing.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/__init__.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/__init__.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/SHA.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/SHA.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/MD5.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/MD5.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Hash/HMAC.py failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Cipher/__init__.pyc failed: No such file or directory
amazon-ebs: warning:    erase unlink of /usr/lib64/python2.6/site-packages/Crypto/Cipher/__init__.py failed: No such file or directory
amazon-ebs: Verifying  : python-paramiko-1.   1/3
amazon-ebs: Verifying  : python-crypto-2.0.   2/3
amazon-ebs: Verifying  : python-keyczar-0.7   3/3
amazon-ebs:
amazon-ebs: Removed:
amazon-ebs: python-crypto.x86_64 0:2.0.1-22.el6
amazon-ebs:
amazon-ebs: Dependency Removed:
amazon-ebs: python-keyczar.noarch 0:0.71c-1.el6
amazon-ebs: python-paramiko.noarch 0:1.7.5-2.1.el6
amazon-ebs:
amazon-ebs: Complete!
amazon-ebs: Loaded plugins: fastestmirror, presto
amazon-ebs: Setting up Install Process
amazon-ebs: Loading mirror speeds from cached hostfile
amazon-ebs: * base: mirror.es.its.nyu.edu
amazon-ebs: * epel: mirror.symnds.com
amazon-ebs: * extras: mirror.cogentco.com
amazon-ebs: * updates: mirror.cogentco.com
amazon-ebs: Resolving Dependencies
amazon-ebs: --> Running transaction check
amazon-ebs: ---> Package python-crypto.x86_64 0:2.0.1-22.el6 will be installed
amazon-ebs: ---> Package python-paramiko.noarch 0:1.7.5-2.1.el6 will be installed
amazon-ebs: --> Finished Dependency Resolution
amazon-ebs:
amazon-ebs: Dependencies Resolved
amazon-ebs:
amazon-ebs: ========================================
amazon-ebs: Package
amazon-ebs: Arch   Version       Repository
amazon-ebs: Size
amazon-ebs: ========================================
amazon-ebs: Installing:
amazon-ebs: python-crypto
amazon-ebs: x86_64 2.0.1-22.el6  base 159 k
amazon-ebs: python-paramiko
amazon-ebs: noarch 1.7.5-2.1.el6 base 728 k
amazon-ebs:
amazon-ebs: Transaction Summary
amazon-ebs: ========================================
amazon-ebs: Install       2 Package(s)
amazon-ebs:
amazon-ebs: Total download size: 887 k
amazon-ebs: Installed size: 8.2 M
amazon-ebs: Downloading Packages:
amazon-ebs: Setting up and reading Presto delta metadata
amazon-ebs: Processing delta metadata
amazon-ebs: Package(s) data still to download: 887 k
amazon-ebs: (1/2): python-cr | 159 kB     00:00
amazon-ebs: (2/2): python-pa | 728 kB     00:00
amazon-ebs: ----------------------------------------
amazon-ebs: Total            | 887 kB     00:00
amazon-ebs: Running rpm_check_debug
amazon-ebs: Running Transaction Test
amazon-ebs: Transaction Test Succeeded
amazon-ebs: Running Transaction
amazon-ebs:   Installing : python-crypto-2.0.   1/2
amazon-ebs:   Installing : python-paramiko-1.   2/2
amazon-ebs: Verifying  : python-paramiko-1.   1/2
amazon-ebs: Verifying  : python-crypto-2.0.   2/2
amazon-ebs:
amazon-ebs: Installed:
amazon-ebs: python-crypto.x86_64 0:2.0.1-22.el6
amazon-ebs: python-paramiko.noarch 0:1.7.5-2.1.el6
amazon-ebs:
amazon-ebs: Complete!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.