40a / ansible-playbook-bundle

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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

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 apb
source apb/bin/activate

Install requirements and run the setup script (requires python)

pip install -r src/requirements.txt && python setup.py install

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,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,build}
    init                Initialize the directory for APB development
    help                Display this help message
    prepare             Prepare an ansible-container project for APB packaging
    build               Build and package APB container
    push                Push the APB spec to an Ansible Service Broker

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 -p name=my_apb_param,type=string,default=foo_param,description="sample description" --async=optional --bindable --organization my_organization

This gives us the following example apb.yaml

name: my_apb
image: my_organization/my_apb
description: This is a sample application generated by apb init
bindable: True
async: optional
parameters:
- name: my_apb_param
  description: sample description
  type: string
  default: foo_param

About

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

License:GNU General Public License v2.0


Languages

Language:Python 100.0%