RubyGems Navigation menu

chef_instance 0.1.0

# chef_instance ## Why What is our goal when we install a piece of daemonized software? Why does the minutia of configuration concern us so greatly? Do we really want to emulate shell scripts in a recipe and end up with hundreds of random resources on our node? Why do I even care about resources on my node? Before I answer those questions lets get back to our goal, which was? Goal: A unique instance of a daemon with our supplied configuration. ## Usage ``` # In this hypothetical instance we have a 'pie' daemon named 'pumpkin' that stores # pies recieved on port 314. We may want to run another instance called 'pecan' on # a different port that receives different types of pies. # htce::default.rb pie_instance 'pumpkin' do # File owner and group. # Daemon user and group. user 'pumpkin' group 'pies' # creates `/opt/pies/pumpkins` then stores all config and runtime data. root_path '/opt/pies' service_options({ port: 314, store_pies: true, daemon_args: %w(-Tsteaming -Sdelicious) }) end ``` ## How it works Provides resource provider super classes for building instances of software. ``` class Chef class Resource class Daemon < Chef::Resource::Instance end end end ``` Ignores system defaults (configuration, initscripts, etc). ## Installation Because of Ruby library load race conditions with Chef and Gems you need to ensure that `chef_instance` is installed before you execute Chef. This can be achieved by: - Install the Chef (through the Omnibus, or however you do it). - Install `chef_instance` into the Ruby system used by Chef. If you used Omnibus you'll need to use the `gem` command provided in `/opt/chef/embedded/bin` ## Code Style This code follows the [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) and all contributions should as well. The code style is checked by [Rubocop](http://batsov.com/rubocop/) and can be checked by executing `rake test:rubocop` or `rubocop`. [![Build Status](https://travis-ci.org/miah/chef_instance.png?branch=master)](https://travis-ci.org/miah/chef_instance) [![Code Climate](https://codeclimate.com/github/miah/chef_instance.png)](https://codeclimate.com/github/miah/chef_instance) [![Code Climate Coverage](https://codeclimate.com/github/miah/chef_instance/coverage.png)](https://codeclimate.com/github/miah/chef_instance) [![Dependency Status](https://gemnasium.com/miah/chef_instance.svg)](https://gemnasium.com/miah/chef_instance) # Author Author:: Miah Johnson (<miah@chia-pet.org>) # License Copyright 2013 Miah Johnson Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 0.1.1 - August 09, 2014 (21 KB)
  2. 0.1.0 - August 09, 2014 (21.5 KB)

Runtime Dependencies (1):

chef >= 11.12.2

Development Dependencies (6):

minitest ~> 5.3.1
rake ~> 10.3.0
rubocop ~> 0.20.1
simplecov ~> 0.8.2
yard ~> 0.8.7.3

Owners:

Authors:

  • Miah Johnson

SHA 256 checksum:

80d0c3a754a05b240548fdfe7ab56ad0b605369db6b047ad785b646486e56a93

Total downloads 6,307

For this version 2,753

License:

Apache-2.0

Required Ruby Version: >= 0

Links: