GithubHelp home page GithubHelp logo

charm-bootstrap-ansible's Introduction

charm-bootstrap-ansible

A quick way to get started creating a juju charm using ansible.

Disclaimer: this template does not try to explain what's possible with either ansible or juju - but if you know a bit about both, it will show you how you can easily use them together.

Make sure you have both git and bzr installed and then:

$ mkdir -p charms/precise && cd charms/precise
$ git clone https://github.com/absoludity/charm-bootstrap-ansible.git mycharm
$ cd mycharm
$ make

That will pull in the required charm-helpers library and run the unit-tests. Take a look around at the hooks/hooks.py or the playbooks/site.yaml, or deploy it with:

$ juju deploy --repository=../.. local:charm-bootstrap-ansible

If you'd like to explore what's happening when the hooks run, once juju status tells you that the services has 'started', you can open another terminal up and run

$ juju debug-hooks charm-bootstrap-ansible/0

Back in your original terminal, let's change one of the config options (defined in the config.yaml):

$ juju set charm-bootstrap-ansible string-option="Hi there"

Back in your debug-hooks terminal, you'll see the prompt has changed to let you know it's ready to run the config-changed hook. Run the hook to see what it does with:

$ hooks/config-changed

You'll see the output of ansible running all the tasks tagged with 'config-changed', including a debug message with the value of the config option that you changed. Just 'exit' to let juju know the hook execution has finished.

Have fun exploring the possibilities of ansible and juju!

Note about Dependencies

The makefile to run tests requires the following dependencies

  • python-nose
  • python-mock
  • python-flake8
  • python-yaml
  • bzr

installable via:

$ sudo apt-get install bzr python-yaml python-nose python-mock python-flake8

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.