From d7b33833bc2a81e68d98a7fd6c0c22e75de53817 Mon Sep 17 00:00:00 2001 From: "Benjamin W. Smith" Date: Fri, 6 Nov 2009 19:10:39 -0500 Subject: Decided to use YAML. It just makes sense. Added an example config, updated the readme. --- LANGUAGE_IDEAS | 31 ------------------------------- README | 2 +- examples/webserver.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 32 deletions(-) delete mode 100644 LANGUAGE_IDEAS create mode 100644 examples/webserver.yaml diff --git a/LANGUAGE_IDEAS b/LANGUAGE_IDEAS deleted file mode 100644 index eb5f041..0000000 --- a/LANGUAGE_IDEAS +++ /dev/null @@ -1,31 +0,0 @@ -Example template: - -- Define template "webserver": -; describe template here - -- My Roles: - - webserver - -- I need to use: -; this is where we define the services/dependencies needed - - network - - ssh - - python_modules as modules - -- I need these accounts: - - bsmith - -- I need these packages: - - apache - - version: 2.2.14 - - python - - version: 2.6.2 - - modules: modules.all - -- Runtime -""" -#!/usr/bin/env python -from mrbelvedere import module - -module.do_stuff(arg) -""" diff --git a/README b/README index 595a48f..760347f 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ multiple servers. Several goals for this project: -1. Easy to read/understand config templates kind of like Ruby's RSpec. +1. Easy to read/understand config templates via YAML 2. Distributed Version Control using mercurial 3. Notion of roles 4. Notion of environment (use branching to achieve) diff --git a/examples/webserver.yaml b/examples/webserver.yaml new file mode 100644 index 0000000..7dd937c --- /dev/null +++ b/examples/webserver.yaml @@ -0,0 +1,38 @@ +# YAML +template: + name: webserver + description: | + Basic webserver template + roles: + # Define my roles here + - webserver + services: + # This is where we define the + # services/dependencies needed + use: + - network + - ssh + - accounts: + users: + - bsmith + groups: + - bsmith + disable: + - selinux + software_packages: + apache: + - version: 2.2.14 + python: + - version: 2.6.2 + python_modules: python_modules.all + runtime_script: | + #!/usr/bin/env python + """ Make subset of runtime methods available + """ + from mrbelvedere import module + + module.do_stuff(arg) + # Nice thing about YAML/PyYAML is defining variables + # And calling code in-line. Can do tricks like below + dir: &DIR /tmp + adhoc: !!python/object/apply:os.listdir [*DIR] -- cgit v1.2.3