commit a08a3ca71e37efcaacbc96c11ab9c1fe5a3a7583 Author: Chris MacNaughton Date: Thu Apr 7 10:10:23 2016 -0400 initial commit diff --git a/README.ex b/README.ex new file mode 100644 index 0000000..b6816b2 --- /dev/null +++ b/README.ex @@ -0,0 +1,65 @@ +# Overview + +Describe the intended usage of this charm and anything unique about how this +charm relates to others here. + +This README will be displayed in the Charm Store, it should be either Markdown +or RST. Ideal READMEs include instructions on how to use the charm, expected +usage, and charm features that your audience might be interested in. For an +example of a well written README check out Hadoop: +http://jujucharms.com/charms/precise/hadoop + +Use this as a Markdown reference if you need help with the formatting of this +README: http://askubuntu.com/editing-help + +This charm provides [service][]. Add a description here of what the service +itself actually does. + +Also remember to check the [icon guidelines][] so that your charm looks good +in the Juju GUI. + +# Usage + +Step by step instructions on using the charm: + +juju deploy servicename + +and so on. If you're providing a web service or something that the end user +needs to go to, tell them here, especially if you're deploying a service that +might listen to a non-default port. + +You can then browse to http://ip-address to configure the service. + +## Scale out Usage + +If the charm has any recommendations for running at scale, outline them in +examples here. For example if you have a memcached relation that improves +performance, mention it here. + +## Known Limitations and Issues + +This not only helps users but gives people a place to start if they want to help +you add features to your charm. + +# Configuration + +The configuration options will be listed on the charm store, however If you're +making assumptions or opinionated decisions in the charm (like setting a default +administrator password), you should detail that here so the user knows how to +change it immediately, etc. + +# Contact Information + +Though this will be listed in the charm store itself don't assume a user will +know that, so include that information here: + +## Upstream Project Name + + - Upstream website + - Upstream bug tracker + - Upstream mailing list or contact information + - Feel free to add things if it's useful for users + + +[service]: http://example.com +[icon guidelines]: https://jujucharms.com/docs/stable/authors-charm-icon diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..51f2ce4 --- /dev/null +++ b/config.yaml @@ -0,0 +1,14 @@ +options: + string-option: + type: string + default: "Default Value" + description: "A short description of the configuration option" + boolean-option: + type: boolean + default: False + description: "A short description of the configuration option" + int-option: + type: int + default: 9001 + description: "A short description of the configuration option" + diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..e092eef --- /dev/null +++ b/icon.svg @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/layer.yaml b/layer.yaml new file mode 100644 index 0000000..102cf18 --- /dev/null +++ b/layer.yaml @@ -0,0 +1 @@ +includes: ['layer:basic'] # if you use any interfaces, add them here diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 0000000..0760598 --- /dev/null +++ b/metadata.yaml @@ -0,0 +1,19 @@ +name: ceph-base +summary: +maintainer: Chris +description: | + +tags: + # Replace "misc" with one or more whitelisted tags from this list: + # https://jujucharms.com/docs/stable/authors-charm-metadata + - misc +subordinate: false +provides: + provides-relation: + interface: interface-name +requires: + requires-relation: + interface: interface-name +peers: + peer-relation: + interface: interface-name diff --git a/reactive/ceph_base.py b/reactive/ceph_base.py new file mode 100644 index 0000000..dbeed27 --- /dev/null +++ b/reactive/ceph_base.py @@ -0,0 +1,17 @@ +from charms.reactive import when, when_not, set_state + + +@when_not('ceph-base.installed') +def install_ceph-base(): + # Do your setup here. + # + # If your charm has other dependencies before it can install, + # add those as @when() clauses above., or as additional @when() + # decorated handlers below + # + # See the following for information about reactive charms: + # + # * https://jujucharms.com/docs/devel/developer-getting-started + # * https://github.com/juju-solutions/layer-basic#overview + # + set_state('ceph-base.installed') diff --git a/tests/00-setup b/tests/00-setup new file mode 100755 index 0000000..f0616a5 --- /dev/null +++ b/tests/00-setup @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo add-apt-repository ppa:juju/stable -y +sudo apt-get update +sudo apt-get install amulet python-requests -y diff --git a/tests/10-deploy b/tests/10-deploy new file mode 100755 index 0000000..b21f23a --- /dev/null +++ b/tests/10-deploy @@ -0,0 +1,31 @@ +#!/usr/bin/python3 + +import amulet +import requests +import unittest + + +class TestCharm(unittest.TestCase): + def setUp(self): + self.d = amulet.Deployment() + + self.d.add('ceph-base') + self.d.expose('ceph-base') + + self.d.setup(timeout=900) + self.d.sentry.wait() + + self.unit = self.d.sentry['ceph-base'][0] + + def test_service(self): + # test we can access over http + page = requests.get('http://{}'.format(self.unit.info['public-address'])) + self.assertEqual(page.status_code, 200) + # Now you can use self.d.sentry[SERVICE][UNIT] to address each of the units and perform + # more in-depth steps. Each self.d.sentry[SERVICE][UNIT] has the following methods: + # - .info - An array of the information of that unit from Juju + # - .file(PATH) - Get the details of a file on that unit + # - .file_contents(PATH) - Get plain text output of PATH file from that unit + # - .directory(PATH) - Get details of directory + # - .directory_contents(PATH) - List files and folders in PATH on that unit + # - .relation(relation, service:rel) - Get relation data from return service