GithubHelp home page GithubHelp logo

patrickwangj / ansible-playbook-bundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ansibleplaybookbundle/ansible-playbook-bundle

0.0 1.0 0.0 2.36 MB

Ansible Playbook Bundle is a lightweight application definition (meta-containers).

License: GNU General Public License v2.0

Shell 1.03% Python 98.97%

ansible-playbook-bundle's Introduction

Ansible Playbook Bundle (APB)

An Ansible Playbook Bundle (APB) is a lightweight application definition (meta-container). They are used to define and deploy complex groups of applications, deployment configs, deployments, and services to an OpenShift Origin cluster running the Ansible Service Broker. APBs offer more power and simple configuration by leveraging the power of Ansible. APBs have the following features:

  • Metadata contains list of required/optional parameters for use during deployment.
  • Leverages existing investment in Ansible Roles / Playbooks.
  • Actions under a directory with named playbooks and metadata defined in apb.yml.
  • Developer tooling to drive a guided approach.
  • Easily modified or extended.

Installing the apb tool

Prerequisites

Docker must be correctly installed and running on the system.

Running from a container

Create an alias in your .bashrc or somewhere else sane for your shell: alias apb='docker run --rm --privileged -v $PWD:/mnt -v $HOME/.kube:/.kube -v /var/run/docker.sock:/var/run/docker.sock -u $UID docker.io/ansibleplaybookbundle/apb'

You should be able to start working by running apb init my_apb. The first run in particular may take awhile to return while the image is pulled.

If you would prefer to use atomic rather than an alias this is also possible: atomic run docker.io/ansibleplaybookbundle/apb init my_apb

There are three tags to choose from:

  • latest: more stable, less frequent releases
  • nightly: following upstream commits, installed from RPM
  • canary: following upstream commits, installed from source build
RPM Installation

For RHEL or CentOS 7:

su -c 'wget https://copr.fedorainfracloud.org/coprs/g/ansible-service-broker/ansible-service-broker/repo/epel-7/group_ansible-service-broker-ansible-service-broker-epel-7.repo -O /etc/yum.repos.d/ansible-service-broker.repo'

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install apb

For Fedora 25 or Fedora 26:

sudo dnf -y install dnf-plugins-core
sudo dnf -y copr enable @ansible-service-broker/ansible-service-broker
sudo dnf -y install apb
Installing from source
Installing from source - Python/VirtualEnv

Clone this repo

git clone https://github.com/fusor/ansible-playbook-bundle.git

Install python-virtualenv, create a virtualenv, and activate it.

sudo dnf install -y python-virtualenv
virtualenv /tmp/apb
source /tmp/apb/bin/activate

Install requirements and run the setup script (requires python)

cd ansible-playbook-bundle && pip install -U setuptools && pip install -r src/requirements.txt && python setup.py install

Optionally, if actively developing on the project, install the testing requirements:

pip install -r src/test-requirements.txt

Reactivate the apb virtualenv in other shell sessions using source /tmp/apb/bin/activate if needed.

Installing from source - Tito

Alternatively you can use tito to install.

tito build --test --rpm -i
Test APB tooling

Run apb help to make sure the tool is installed correctly

$ apb help
usage: apb [-h] [--debug] [--project BASE_PATH]
           {init,help,prepare,push,bootstrap,list,remove,build} ...

APB tooling for assisting in building and packaging APBs.

optional arguments:
  -h, --help            show this help message and exit
  --debug               Enable debug output
  --project BASE_PATH, -p BASE_PATH
                        Specify a path to your project. Defaults to CWD.

subcommand:
  {init,help,prepare,push,bootstrap,list,remove,build}
    init                Initialize the directory for APB development
    help                Display this help message
    prepare             Prepare an ansible-container project for APB packaging
    push                Push local APB spec to an Ansible Service Broker
    bootstrap           Tell Ansible Service Broker to reload APBs from the
                        container repository
    list                List APBs from the target Ansible Service Broker
    remove              Remove APBs from the target Ansible Service Broker
    build               Build and package APB container

Documentation

  • Getting Started - step by step tutorial to create an Ansible Playbook Bundle
  • Design - overall design of Ansible Playbook Bundles
  • Developers - in depth explanation of Ansible Playbook Bundles

Links

Initialize skeleton APB application example

apb init my_apb --async=optional --bindable

This gives us the following example apb.yaml

version: 1.0
name: my-apb
description: "my-apb description"
bindable: True
async: optional
metadata: {}
plans:
  - name: my-plan
    description: "my-plan description"
    free: True
    metadata: {}
    parameters: []

ansible-playbook-bundle's People

Contributors

dymurray avatar jmontleon avatar cfchase avatar fabianvf avatar jmrodri avatar shawn-hurley avatar eriknelson avatar jwmatthews avatar tchughesiv avatar sabre1041 avatar djzager avatar djwhatle avatar flaper87 avatar karmab avatar matzew avatar codificat avatar wmengrh avatar philbrookes avatar

Watchers

James Cloos avatar

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.