Project

configgin

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A simple cli app in Ruby to generate configurations using BOSH ERB templates and a BOSH spec, but also using configurations based on environment variables, processed using a set of templates.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

~> 1.0
~> 2.0, != 2.2.1
 Project Readme

configgin

A simple cli app in Ruby to generate configurations using BOSH ERB templates and a BOSH spec, but also using configurations based on environment variables, processed using a set of templates.

Usage

Usage: configgin [options]
    -j, --jobs file                  Job configuration JSON
    -e, --env2conf file              Environment to configuration templates YAML

Examples

Example BOSH spec (bosh_spec.json)

{
    "job": {
        "name": "mysql",
        "templates": [
            {
                "name": "mysql"
            },
            {
                "name": "consul_agent"
            }
        ]
    },
    "networks": {
        "default": {}
    },
    "properties": {
        "acceptance_tests": {
            "include_services": false,
            "include_sso": false,
            "nodes": 2
        }
    }
}  

Example job configuration file (job_config.json)

{
  "job_name": {
    "base": "/tmp/bosh_spec.json",
    "files": {
      "/tmp/my_template.erb": "/tmp/output_file"
    }
  }
}

Example environment variable template file (env2.conf.yml)

---
properties.acceptance_tests.nodes: "((TEST_NODE_COUNT))"
properties.uaa.scim.users: "'((TEST_VAR))'"

Example template (my_template.erb)

Hello, this is the users property: <%= p("uaa.scim.users") %>

Example of using the tool

TEST_VAR=foo
configgin \
  -e ~/tmp/env2.conf.yml \
  -j ~/tmp/job_config.json