Giter VIP home page Giter VIP logo

ansible-dk's Introduction

Maintainer Needed

ansible-dk

An omnibus-based toolkit for working on Ansible-based infrastructure code.

That means, this project is a set of scripts to build OS packages that bundle together a bunch of tools to make developing with Ansible more robust, reliable, fast, and fun - in other words, a SDLC kit for ansible. Unless you are contributing to this project, you almost certainly don't need this source code; you're instead looking for the binary OS packages.

Using the Binaries

Downloading the OS Packages

Packages for Ubuntu 14.04 (.deb) and Mac OS X (.dmg) are available at https://github.com/omniti-labs/ansible-dk/releases/latest .

Using the binaries

Installation should be straightforward using your OS's normal package manager. We install to /opt/ansible-dk, and are careful to not interfere with any existing system Python or Ruby installations. Uninstalls and upgrades should be clean.

Once you have your package installed, to use the tools, run this magic command in your Bash shell:

eval "$(ansible-dk shell-init bash)"

This will alter various environment variables so that the Ansible DK's tools appear first in your path, along with all the Python and Ruby libraries they need.

(Currently only bash is supported; patches welcome.)

Tools Contained in the Kit

A Ruby 2.1.x Runtime

This allows us to manage our own gem universe without the user having to know about things like Bundler, rvm, or rbenv.

A Python 2.7.x Runtime

This allows us to manage our own module universe without the user having to know about things like virtualenv.

ansible-dk CLI tool

This gets symlinked into /usr/bin or /usr/local/bin, depending on your OS, and is the only change outside of /opt/ansible-dk.

ansible 2.0.x

The ansible tool itself.

ansible-lint

Ansible-lint is a linter for ansible.

ansible-toolkit

Ansible-toolkit provides several tools to improve visibility and predictability of roles and vault management.

test-kitchen, kitchen-vagrant, and kitchen-ansible

Test Kitchen is a very popular infrastructure testing harness.

Molecule

Molecule is a tool to ease (automated) testing for Ansible roles.

AWS Support: kitchen-ec2, AWS cli, boto library, and jq

Everything you need to have test machines in AWS, plus have dynamic inventory. jq is included for inventory diagnostics.

Project Roadmap

Tools we plan to include

The workflow that the authors use includes using test-kitchen to create and destroy test VMs, with serverspec being used to author the tests. That's not prescriptive, though - you can do whatever you like. Our goal is for the Ansible DK to provide enough variety of tools for you to implement a workflow that you prefer.

Long-term, we're open to contributions from the community - such as BATS support, or digitalocean support, for example. But those are not the current needs of OmniTI, so we will not be focusing on them at the moment.

Platforms we plan to target

Based on OmniTI's (perhaps idiosyncratic) needs, we initially plan to build packages for:

  • OS X Yosemite
  • OS X El Capitan (commiting to latest Mac OS, plus previous version)
  • Ubuntu 14.04 (commiting to LTS support on ubuntu)

We do not currently have a need for Debian, CentOS, RHEL, or FreeBSD packaging, but such contributions would be very welcome from the community.

At some point in the future, we will likely add OmniOS LTS packaging, which we would aim to also cover SmartOS and Oracle Solaris.

We will probably never have need for a Windows package, but if there are community members willing to implement, test, and maintain it, we'll accept it.

Bug and Limitations

Probably a great many! If you find one, open an issue at https://github.com/omniti-labs/ansible-dk/issues .

Feature Requests and Contributing

If you have something you wish to see added, but have no idea how to do that in Omnibus, please open an issue at https://github.com/omniti-labs/ansible-dk/issues .

If you have some experience doing Omnibus packaging, which is perhaps not for the faint of heart, or are simply exceptionally intrepid, have a read over the Omnibus instructions at https://github.com/chef/omnibus , then do the usual fork-PR workflow on this repo.

Acknowledgements

Contributors

This is a project sponsored by OmniTI Labs, the FOSS initiative of OmniTI (omniti.com). Community contributors are welcome, and maintainers may join after a vetting period.

  • Clinton Wolfe, DevOps Practice Lead at OmniTI
  • Rick Pufky, DevOps Generalist at OmniTI
  • Lyn Muldrow, Frontend Developer at OmniTI - Logo design
  • Josh Blancett, Automation Engineer at OmniTI
  • Your Name Could Be Here

Special Thanks

  • Robert Treat, CEO of OmnITI

He said, "You should totally do that." So, we did.

  • devops-toolchain Google Group

For the enthusiastic response

  • Bill Nottingham of Ansible / RedHat

For basically saying, sure, why not

  • Joseph Holsten

For giving us a clue for how to build and package python modules under omnibus

  • Chef, Inc.

For Omnibus, and the many build definitions we are using.

ansible-dk Omnibus project

This project creates full-stack platform-specific packages for ansible-dk!

Installation

You must have a sane Ruby 1.9+ environment with Bundler installed. Ensure all the required gems are installed:

$ bundle install --binstubs

Usage

Build

You create a platform-specific package using the build project command:

$ bin/omnibus build ansible-dk

The platform/architecture type of the package created will match the platform where the build project command is invoked. For example, running this command on a MacBook Pro will generate a Mac OS X package. After the build completes packages will be available in the pkg/ folder.

Clean

You can clean up all temporary files generated during the build process with the clean command:

$ bin/omnibus clean ansibledk

Adding the --purge purge option removes ALL files generated during the build including the project install directory (/opt/ansibledk) and the package cache directory (/var/cache/omnibus/pkg):

$ bin/omnibus clean ansibledk --purge

Publish

Omnibus has a built-in mechanism for releasing to a variety of "backends", such as Amazon S3. You must set the proper credentials in your omnibus.rb config file or specify them via the command line.

$ bin/omnibus publish path/to/*.deb --backend s3

Help

Full help for the Omnibus command line interface can be accessed with the help command:

$ bin/omnibus help

Version Manifest

Git-based software definitions may specify branches as their default_version. In this case, the exact git revision to use will be determined at build-time unless a project override (see below) or external version manifest is used. To generate a version manifest use the omnibus manifest command:

omnibus manifest PROJECT -l warn

This will output a JSON-formatted manifest containing the resolved version of every software definition.

Note

When building new versions, clear local build cache. Stale or broken builds could get built in.

$ rm -rf local/build local/cache /opt/ansible-dk/*

Kitchen-based Build Environment

Every Omnibus project ships will a project-specific Berksfile that will allow you to build your omnibus projects on all of the projects listed in the .kitchen.yml. You can add/remove additional platforms as needed by changing the list found in the .kitchen.yml platforms YAML stanza.

This build environment is designed to get you up-and-running quickly. However, there is nothing that restricts you to building on other platforms. Simply use the omnibus cookbook to setup your desired platform and execute the build steps listed above.

The default build environment requires Test Kitchen and VirtualBox for local development. Test Kitchen also exposes the ability to provision instances using various cloud providers like AWS, DigitalOcean, or OpenStack. For more information, please see the Test Kitchen documentation.

Once you have tweaked your .kitchen.yml (or .kitchen.local.yml) to your liking, you can bring up an individual build environment using the kitchen command.

$ bin/kitchen converge ubuntu-1204

Then login to the instance and build the project as described in the Usage section:

$ bundle exec kitchen login ubuntu-1204
[vagrant@ubuntu...] $ cd ansibledk
[vagrant@ubuntu...] $ bundle install
[vagrant@ubuntu...] $ ...
[vagrant@ubuntu...] $ bin/omnibus build ansibledk

For a complete list of all commands and platforms, run kitchen list or kitchen help.

ansible-dk's People

Contributors

bborysenko avatar clintoncwolfe avatar jblancett avatar josephholsten avatar jsime avatar mbrannigan avatar michaelbaydoun avatar rpufky avatar xzilla avatar

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  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  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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-dk's Issues

Include https://github.com/metacloud/molecule?

Would you be interested in including support for Molecule as an additional alternative to test-kitchen? Molecule, unlike kitchen, is specifically aimed at testing Ansible roles and is therefore able to be free of some baggage coming from the Chef history.

Add ansible

Create a software definition for ansible-1.9.4 and its deps.

Clean up bin dirs

/opt/ansible-dk/embedded/bin ends up with a lot of unwanted files (binaries from ncurses, etc). Make a config/software entry to clean it up.

Error when system pip packages don't match Ansible-DK pip packages

Ran into this error when running some ansible code that uses the ansible elasticache module (http://docs.ansible.com/ansible/elasticache_module.html)
fatal: [elc-m]: FAILED! => {"changed": false, "failed": true, "msg": "boto required for this module"}

Ansible-DK comes with boto 2.36.0 pre-installed at /opt/ansible-dk/embedded/lib/python2.7/site-packages/boto/, and is seen via Ansible-DK's pip:

(ADK) smee:applications rpufky$ pip list
ansible (2.0.0.2)
ansible-lint (2.3.3)
awscli (1.10.1)
boto (2.36.0)
botocore (1.3.23)
click (5.1)
colorama (0.3.3)
docopt (0.6.2)
docutils (0.12)
ecdsa (0.13)
Jinja2 (2.8)
jmespath (0.9.0)
MarkupSafe (0.23)
molecule (1.3.0)
paramiko (1.16.0)
pbr (1.8.1)
pexpect (4.0.1)
pip (8.0.3)
prettytable (0.7.2)
ptyprocess (0.5.1)
py (1.4.31)
pyasn1 (0.1.9)
pycrypto (2.6.1)
pytest (2.9.0)
python-dateutil (2.5.1)
python-vagrant (0.5.10)
PyYAML (3.11)
rsa (3.3)
setuptools (18.5)
sh (1.11)
six (1.10.0)
testinfra (1.0.2)
You are using pip version 8.0.3, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I have not installed pip modules to system python, trying to leave that as clean as possible, system python does not have boto installed:

smee:~ rpufky$ pip list
altgraph (0.10.2)
awscli (1.10.8)
bdist-mpkg (0.5.0)
bonjour-py (0.3)
botocore (1.3.30)
colorama (0.3.3)
docutils (0.12)
futures (3.0.5)
jmespath (0.9.0)
macholib (1.5.1)
matplotlib (1.3.1)
modulegraph (0.10.4)
numpy (1.8.0rc1)
pip (8.0.3)
py2app (0.7.3)
pyasn1 (0.1.9)
pyobjc-core (2.5.1)
pyobjc-framework-Accounts (2.5.1)
pyobjc-framework-AddressBook (2.5.1)
pyobjc-framework-AppleScriptKit (2.5.1)
pyobjc-framework-AppleScriptObjC (2.5.1)
pyobjc-framework-Automator (2.5.1)
pyobjc-framework-CFNetwork (2.5.1)
pyobjc-framework-Cocoa (2.5.1)
pyobjc-framework-Collaboration (2.5.1)
pyobjc-framework-CoreData (2.5.1)
pyobjc-framework-CoreLocation (2.5.1)
pyobjc-framework-CoreText (2.5.1)
pyobjc-framework-DictionaryServices (2.5.1)
pyobjc-framework-EventKit (2.5.1)
pyobjc-framework-ExceptionHandling (2.5.1)
pyobjc-framework-FSEvents (2.5.1)
pyobjc-framework-InputMethodKit (2.5.1)
pyobjc-framework-InstallerPlugins (2.5.1)
pyobjc-framework-InstantMessage (2.5.1)
pyobjc-framework-LatentSemanticMapping (2.5.1)
pyobjc-framework-LaunchServices (2.5.1)
pyobjc-framework-Message (2.5.1)
pyobjc-framework-OpenDirectory (2.5.1)
pyobjc-framework-PreferencePanes (2.5.1)
pyobjc-framework-PubSub (2.5.1)
pyobjc-framework-QTKit (2.5.1)
pyobjc-framework-Quartz (2.5.1)
pyobjc-framework-ScreenSaver (2.5.1)
pyobjc-framework-ScriptingBridge (2.5.1)
pyobjc-framework-SearchKit (2.5.1)
pyobjc-framework-ServiceManagement (2.5.1)
pyobjc-framework-Social (2.5.1)
pyobjc-framework-SyncServices (2.5.1)
pyobjc-framework-SystemConfiguration (2.5.1)
pyobjc-framework-WebKit (2.5.1)
pyOpenSSL (0.13.1)
pyparsing (2.0.1)
python-dateutil (1.5)
pytz (2013.7)
rsa (3.3)
s3transfer (0.0.1)
scipy (0.13.0b1)
setuptools (1.1.6)
six (1.4.1)
vboxapi (1.0)
xattr (0.6.4)
zope.interface (4.1.1)
You are using pip version 8.0.3, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

To work around this, I added an environment variable to the set returned by eval "$(ansible-dk shell-init bash)":

export PYTHONPATH="/opt/ansible-dk/embedded/lib/python2.7/site-packages"

This let my Ansible-DK installation find the boto installation included with the embedded python.

AppBundle Kitchen

We need a executable in /opt/ansible-dk/bin for kitchen, but we need to ensure it gets exactly the right kit of dependent gems, without relying on shell-init having been done. Appbundler is one way of doing that.

Top-level Readme

We need a top-level readme explaining where to get the binaries, project description, roadmap, and for the intrepid, how to develop on the omnibus stuff.

Clean up ansible-dk naming

We already having both ansibledk and ansible-dk showing up in various places. Lets standardize on ansible-dk.

Ability to uninstall ansible-dk on OS X?

Hello ansible-dk!

Sorry if this is obvious, but is there no way to uninstall ansible-dk? I ran into this when trying to write a brew-cask formula for ansible-dk.

Let me know. And thanks so much for all you do on this! ๐Ÿ’–

Document why bintray is better than packagecloud

I'm a huge fan of packagecloud, but we're currently using bintray. But looking at our use case, I can't justify us switching because:

  • we want to host mac (& maybe someday windows) packages
  • we want a landing page for installing, and bintray lets us point back to the project

Are there any other benefits to bintray over packagecloud or github releases?

Mac packaging issues

I cut a test DMG and had a co-worker try it.

  • Our custom welcome and licensing files are not being used.
  • There was confusion about what to do with the PKG icon in the finder window that opens. Modify the background image to include instructions to double-click the icon
  • Security warning - unsigned package, and it wouldn't be trusted anyway. That's a future issue.

Add pip

We now have a python 2.7 runtime, but we don't have pip or setuptools, which makes installing modules hard. Make a software definition for it, and make sure that if you install a package, it goes to either /opt/ansible-dk, or ~/.ansible-dk/python - NOT the system python.

ansible-dk executable missing in release 1.1.0

On at least Mac OS, a fresh install of 1.1.0 results in a broken install, because /opt/ansible-dk/bin does not contain the ansible-dk executable.

The /usr/local/bin/ansible-dk symlink appears to still get created, but it points to /opt/ansible-dk/bin/ansible-dk , which does not exist.

Make a real CLI tool

Lay the groundwork for a real CLI tool, which could eventually have several subcommands:

ansible-dk shell-init ...
ansible-dk generate ...
ansible-dk test ...
ansible-dk verify ...

Then remove the bash script that does shell-init now.

Make a Logo

It would be great to have some kind of logo, which is needed at least for the Mac OS package.

Be careful not to violate Ansible/RedHat tradedress; if we were to integrate the official ansible logo, we must have explicit permission to do so.

Mac OS Packaging breaks

Probably missing some files.

                  [Compressor::DMG] I | Setting dmg icon
The following shell command exited with status 2:

    $ # Convert the png to an icon
sips -i "/Users/clinton/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/omnibus-4.1.0/resources/dmg/icon.png"

# Extract the icon into its own resource
DeRez -only icns "/Users/clinton/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/omnibus-4.1.0/resources/dmg/icon.png" > tmp.rsrc

# Append the icon reosurce to the DMG
Rez -append tmp.rsrc -o "/private/var/folders/vg/xth613h14lvgsx2795y02s700000gn/T/ansibledk20151106-14201-2c2uxb/local/pkg/ansibledk-0.0.0+20151106172743-1.dmg"

# Source the icon
SetFile -a C "/private/var/folders/vg/xth613h14lvgsx2795y02s700000gn/T/ansibledk20151106-14201-2c2uxb/local/pkg/ansibledk-0.0.0+20151106172743-1.dmg"


Output:

    /Users/clinton/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/omnibus-4.1.0/resources/dmg/icon.png
  /Users/clinton/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/omnibus-4.1.0/resources/dmg/icon.png
ERROR: File Not Found. (-43)  on file: /private/var/folders/vg/xth613h14lvgsx2795y02s700000gn/T/ansibledk20151106-14201-2c2uxb/local/pkg/ansibledk-0.0.0+20151106172743-1.dmg

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.