Ansible Service Broker is an implementation of the Open Service Broker API that will manage applications defined by Ansible Playbook Bundles.
An Ansible Playbook Bundle (APB) is a new method for defining and distributing container applications in OpenShift consisting of a bundle of Ansible Playbooks built into a container with an Ansible runtime.
Read more about the Ansible Service Broker and Ansible Playbook Bundles in this introduction.
NOTE: this broker will be based on the open-service-broker-sdk project in the future.
- Email: ansible-service-broker@redhat.com
- IRC (Freenode): #asbroker
- Trello
- Github:
- Demo environment with oc cluster up - Catalog & Ansible Service Broker 'catasb'
- Library of example APBs
- ManageIQ
- PostgreSQL
- Wordpress
- Hello-World
- Red Hat Summit 2017
- YouTube Channel:
- Docker hub published APBs
The ansible-service-broker community publishes images in Docker Hub. Image tags:
- canary - The newest source build
- latest - The newest release build
- <release_number> - The stable release of an image
The following will use oc cluster up
to bring up a cluster with Ansible Service Broker installed.
The script will run from start to finish in under 2 minutes, giving you an easy way to see the Ansible Service Broker in action.
- Ensure that your system is setup to run
oc cluster up
- Follow these instructions if you haven't already seen success with
oc cluster up
- Follow these instructions if you haven't already seen success with
- Download run_latest_build.sh
wget https://raw.githubusercontent.com/openshift/ansible-service-broker/master/scripts/run_latest_build.sh chmod +x ./run_latest_build.sh
- Execute run_latest_build.sh, this will take ~90 seconds.
./run_latest_build.sh
- You now have a cluster running with the Service Catalog and Ansible Service Broker ready
A basic test to see the capabilities of the Ansible Service Broker:
- Provision Mediawiki APB
- Provision PostgreSQL APB
- Bind Mediawiki to PostgreSQL
Steps to accomplish this are:
- Log into OpenShift Web Console
- Create a new project 'demo'
- Select 'Mediawiki(APB)' to Provision
- Select the 'demo' project
- Enter a 'Mediawiki Admin User Password': 's3curepw'
- Select 'Create'
- Go Back to Catalog main page
- Select 'PostgreSQL(APB)' to Provision
- Select the 'demo' project
- Leave 'PostgreSQL Password' blank, a random password will be generated
- Chose a 'PostgreSQL Version', either version will work.
- Select 'Create'
- View the 'demo' project
- Wait till both APBs have finished deploying and you see pods running for mediawiki and postgres
- Right click on the kebab menu for mediawiki
- Select 'Create Binding'
- Select the Postgres service and complete creating the Binding
- Redeploy mediawiki so the pod is able to consume the credentials for the database.
- View the route for mediawiki and verify the wiki is up and running.
glide is used for dependency management. Binaries are available on the releases page.
Packages
Our dependencies currently require development headers for btrfs and dev-mapper.
CentOS/RHEL/Fedora (sub dnf for Fedora):
sudo yum install device-mapper-devel btrfs-progs-devel etcd
sudo /sbin/service etcd restart # start etcd
mkdir -p $GOPATH/src/github.com/openshift
git clone https://github.com/openshift/ansible-service-broker.git $GOPATH/src/github.com/openshift/ansible-service-broker
cd $GOPATH/src/github.com/openshift/ansible-service-broker
make vendor
Config
A broker is configured via the config.yaml
file. It's recommended to
copy over etc/example-config.yaml
to etc/ansible-service-broker/config.yaml
, and edit
as desired.
See the Broker Configuration doc for other example configurations.
make vendor
: Installs or updates the dependenciesmake build
: Builds the binary from sourcemake install
: Installs the built binary.make prepare-local-env
: will set up the local environemt to test and run the broker against a local deployment of catasbmake run
: Runs the broker with the default profile, configured viaetc/generated_local_development.yaml
- make run can be run without catasb and prepare-local-env by setting the
BROKER_INSECURE="true"
variable to true inscripts/my_local_dev_vars
- make run can be run without catasb and prepare-local-env by setting the
make uninstall
Deletes the installed binary and config.yaml- Notes for install, run, and uninstall:
- The default install prefix is /usr/local. Use
make build && sudo make install
to build and install. - Alternatively you can alter the installation directory by using PREFIX, e.g if you don't want to install somewhere that requires escalated privileges.
make build && PREFIX=~ make install
- The default install prefix is /usr/local. Use
- Notes for install, run, and uninstall:
make ci
: Run the CI workflow that gets executed by travis, locally.- Workflow:
- Provision Mediawiki
- Provision Postgresql
- Bind Postgresql and Mediawiki
- Curl the Mediawiki endpoint to check for success
- Requires:
- Cluster
- Service Catalog
- Ansible-service-broker either running locally or in the cluster
- DOCKERHUB_ORG="ansibleplaybookbundle"
- Workflow:
make build-image
: Builds a docker container of the current source
make release
Builds a docker container using the latest rpm from Coprmake push
Push the built image
make clean
: Delete binaries built from sourcemake run
: Runs the broker with the default profile, configured viaetc/generated_local_development.yaml
make install
: Builds the source and installs in$GOPATH/bin
make test
: Runs the test suite.make vendor
: Updates the dependenciesmake build
: Builds a docker container of the current sourcemake deploy
: Deploys the currently build container into your clustermake test
: Runs the test suite.
Note
Scripts found in /test
can act as manual Service Catalog requests until a larger
user scenario can be scripted.