1.0.3 • Published 9 years ago

cloudconfig v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

cloudconfig

Build a cloud-config with consistent style from a configuration file.

Related: cloudconfig-cli

Reason

When there are many cloud-configs, that share units/files/services, it is time-consuming and typo-risky to change their content and still ensure, that they are identical. So this package was created to address this issue and build cloud-config from a configuration file.

Installation

$ npm install cloudconfig --save

Usage

const build = require('cloudconfig');

let config = {
  services: {
    etcd: {
      'addr': '195.362.351.235:2379',
      'peer-addr': '195.362.351.235:2380'
    }
  },

  files: [{
    path: '/path/to/some/file',
    permissions: 777,
    owner: 'core:core',
    content: '/path/to/source'
  }, {
    path: '/path/to/another/file',
    permissions: 777,
    owner: 'core:core',
    raw: true,
    content: 'some raw content'
  }],

  units: [{
    name: 'etcd',
    command: 'start'
  }, {
    name: 'custom',
    content: '/path/to/unit/source'
  }]
};

let source = yield build(config);

License

cloudconfig is released under the MIT license.