Giter VIP home page Giter VIP logo

saltscaffold's Introduction

Build Status

saltscaffold

This python module creates a new directory structure for salt formulas with the following features:

  • README.md with sample content
  • state files that mimic the package / file / service pattern.
  • .kitchen.yml with content to drive test-kitchen
  • .kitchen-ci.yml with content to drive test-kitchen with alternate settings
  • custom-pillar content to show pillar overrides
  • defaults.yml content with default values
  • map.jinja show how to have grains based overrides and merge defaults with custom pillars
  • example of toggle feature
  • The resulting formula will be testable with test-kitchen
  • serverspec test to used with kitchen verify
  • Gemfile added so one can 'bundle install' inside the formula directory to get the necessary ruby gems

Folder and File Structure

Each salt formula that you scaffold will create the following folder structure:

[formula_name]/
[formula_name]/README.md
[formula_name]/pillar-custom.sls
[formula_name]/Gemfile
[formula_name]/.kitchen.yml
[formula_name]/.kitchen-ci.yml
[formula_name]/LICENSE.txt
[formula_name]/[formula_name]
[formula_name]/[formula_name]/defaults.yaml
[formula_name]/[formula_name]/map.jinja
[formula_name]/[formula_name]/init.sls
[formula_name]/[formula_name]/install.sls
[formula_name]/[formula_name]/config.sls
[formula_name]/[formula_name]/service.sls
[formula_name]/[formula_name]/files/
[formula_name]/[formula_name]/files/config.conf
[formula_name]/test/integration/default/serverspec/_spec.rb
[formula_name]/test/mockup/init.sls

It's expected you'll modify and rename these as you need.

Installing saltscaffold

You can view the source code on the Github Project Page

Install from source

  1. clone the repo git clone https://github.com/cmarzullo/saltscaffold
  2. make the packages cd saltscaffold && python setup.py sdist
  3. install the package sudo pip install dist/Saltscaffold-<version>.tar.gz

Running saltscaffold

The module gets installed as an executable python script. There aren't many options. You can only choose the name of the formula and an optional directory to create the formula in.

saltscaffold -p myformula [-d {base directory} ]

If you don't supply a base directory the formula will be created in your current directory.

Contribution

Pull requests are welcome!

Templating

It's kinda wierd to have to write jinja looking files with jinja. So I switched to the mako templating engine.

Running Tests

There are tests written. Make sure they pass. You can run tests using nosetests -v There's no test for it, but make sure you can do a kitchen verify with the output.

saltscaffold's People

Contributors

cmarzullo avatar hansohn avatar rwaweber avatar

Watchers

 avatar  avatar

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.