GithubHelp home page GithubHelp logo

rpmbuilder-ansible's Introduction

Packaging Ansible as a single RPM for RHEL 6.4

Why?

Ansible is awesome. It'll make our deployments easier and consistent with each other. Unfortunately, the official Ansible RPM is in EPEL and depends on a bunch of other packages in EPEL and some features depend on other packages, etc. This is not ideal for environments where you want to minimize dependencies.

Installing

Pre-built RPMs for RHEL 6.4 x86_64 can be found on the releases page. Their only dependencies are python-devel and postgresql-devel, which should both be available in your local RHN mirror.

Building

vagrant up --provision --provider=virtualbox
vagrant ssh
/vagrant/build.sh  # creates ansible-1.3.4_<date>_x86_64.rpm in the repo directory

NOTE: by default, uses Virtualbox to build. If you want to use VMware, add the equivalent vagrant box:

vagrant box add centos-6.4-x86_64 https://s3.amazonaws.com/rj-public/centos-6.4-x86_64-vmware.box

Copy that RPM to your target machine, install it with sudo yum install <file> (depends on python-devel, postgresql-devel, and their dependencies) and you're good to go!

Verify that it worked by having ansible ping your machine:

echo localhost > hosts
ansible -i hosts all (-k) -m ping

Include the -k if you need a password to do SSH authentication against localhost. Assuming it worked, you should see something like this:

localhost | success >> {
    "changed": false,
    "ping": "pong"
}

This is probably repeatable on other versions of RHEL/Fedora as well, but the important part is that the version you build the RPM on is the same as the version you deploy to.

How?

fpm is a packaging tool that takes one format and transforms it into another (e.g. directory -> RPM, rubygem -> deb, etc.).

We install Ansible into a relocatable virtualenv, patch it so that it looks for its dependencies in the relocatable virtualenv (by default, Ansible will still attempt to use system packages), and build an RPM. The RPM installs the virtualenv to /opt/ansible with links in /usr/local/bin/ansible, /usr/local/bin/ansible-doc, and /usr/local/bin/ansible-playbook.

rpmbuilder-ansible's People

Watchers

Andy Freeland avatar James Cloos avatar  avatar

rpmbuilder-ansible's Issues

better versioning

Packages should have standard versioning suffixes, not the epoch at which they were built.

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.