Giter Club home page Giter Club logo

bluepill's Introduction

bluepill Cookbook

Build Status Cookbook Version

Installs bluepill Ruby Gem and configures it to manage services. Also includes a LWRP.

Requirements

Platforms

Bluepill is a pure Ruby service management tool/library, so this cookbook should work on any system. The attributes do set up paths based on FHS locations, see below.

Chef

  • Chef 12.7+

Cookbooks

  • none

Attributes

Default locations for bluepill are in "FHS compliant" locations.

  • node["bluepill"]["bin"] - Path to bluepill program, default is 'bluepill' in the RubyGems binary directory.
  • node["bluepill"]["logfile"] - Location of the bluepill log file, default "/var/log/bluepill.log".
  • node["bluepill"]["conf_dir"] - Location of service config files (pills), default "/etc/bluepill".
  • node["bluepill"]["pid_dir"] - Location of pidfiles, default "/var/run/bluepill"
  • node["bluepill"]["state_dir"] - Location of state directory, default "/var/lib/bluepill"
  • node["bluepill"]["init_dir"] - Location of init script directory, default selected by platform.
  • node["bluepill"]["version"] - Version of bluepill to install, default is latest.
  • node["bluepill"]["use_rsyslog"] - Enable configuration and use of rsyslog for bluepill.

Resources

This cookbook contains a resource, bluepill_service. This can be used with the normal Chef service resource, by using the provider parameter, or by specifying the bluepill_service shortcut. These two resources are equivalent.

bluepill_service 'my_app' do
  action [:enable, :load, :start]
end

The load action should probably always be specified, to ensure that if bluepill isn't running already it gets started. The The recipe using the service must contain a template resource for the pill and it must be named my_app.pill.erb, where my_app is the service name passed to the bluepill service resource.

Usage

Be sure to include the bluepill recipe in the run list to ensure that the gem and bluepill-related directories are created. This will also make the cookbook available on the system and other cookbooks won't need to explicitly depend on it in the metadata.

If the default directory locations in the attributes/default.rb aren't what you want, change them by setting them either in the attributes file itself, or create attributes in a role applied to any systems that will use bluepill.

Bluepill uses configuration files named my_app.pill that are stored in /etc/bluepill. Here is an example pill:

Bluepill.application('my_app') do |app|
  app.process('my_app') do |process|
    process.pid_file = '/var/run/my_app.pid'
    process.start_command = '/usr/bin/my_app'
  end
end

You can create this file with cookbook_file as follows:

cookbook_file '/etc/bluepill/my_app.pill' do
  source 'my_app.pill'
end

See bluepill's documentation for more information on creating pill templates.

License & Authors

Author: Cookbook Engineering Team ([email protected])

Copyright: 2010-2016, Chef Software, Inc.

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.

bluepill's People

Contributors

chulkilee avatar cmcfadden avatar eamelink avatar iennae avatar jonathantron avatar josephholsten avatar jsirianni avatar karlfreeman avatar luckymike avatar michaeltaras avatar miketheman avatar nathenharvey avatar reset avatar sethvargo avatar tas50 avatar temporarilyoffline avatar trobrock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bluepill's Issues

New rsyslog 3.0.0 upstream cookbook not compatible with chef 11+

By not locking the rsyslog cookbook version in metadata.rb, Berkshelf will upgrade to the latest rsyslog 3.0.0 cookbook (released on 11/10/15) which now depends upon the compat_resources cookbook. The compat_resources cookbook only works with Chef 12+.

Need to either lock your metadata.rb version and/or bump the version number here so that you have versions compatible with chef 11+ and chef 12+, or decide to label as only compatible with chef 12+.

require 'chef/mixin/language' deprecated as part of 14.0 chef

Cookbook version

4.1.0

Chef-client version

14.1.1

Platform Details

Amazon EC2 cloud Ubuntu 16.04

Scenario:

While running chef client, failing with compilation error
cannot load such file -- chef/mixin/language
Cookbook Trace:

/var/chef/cache/cookbooks/bluepill/resources/service.rb:23:in `class_from_file'

Relevant File Content:

/var/chef/cache/cookbooks/bluepill/resources/service.rb:

16: # See the License for the specific language governing permissions and
17: # limitations under the License.
18: #
19:
20: property :service_name, name_property: true
21: property :variables, Hash
22:
23>> require 'chef/mixin/language'
24:
25: action :start do
26: unless service_running?
27: converge_by("start #{new_resource.service_name}") do
28: shell_out!(start_command)
29: end
30: end
31: end
32:

Steps to Reproduce:

Run chef client with 14.0 or plus chef

Expected Result:

Removal of require 'chef/mixin/language' as it is deprecated

Version constraint problem with rsyslog

The pessimistic version matching breaks, because the rsyslog cookbook has switched major versions.

I changed ~> to >= to get it to work in the metadata. I can do a PR, but I'm not 100% sure that's the correct way.

Ohai doesn't return value.

https://github.com/chef-cookbooks/bluepill/blob/178239cdf2ee77d122294df833a78a72394ff3d6/attributes/default.rb#L18

Value node['languages']['ruby']['bin_dir'] is nil. If workaround https://github.com/chef-cookbooks/bluepill/blob/178239cdf2ee77d122294df833a78a72394ff3d6/.kitchen.yml#L24 is removed, then test kitchen fails with error

Errno::ENOENT

No such file or directory - /bluepill

Cookbook Trace:

/tmp/kitchen/cache/cookbooks/bluepill/resources/service.rb:69:in block (2 levels) in class_from_file' /tmp/kitchen/cache/cookbooks/bluepill/resources/service.rb:68:in block in class_from_file'

Resource Declaration:

In /tmp/kitchen/cache/cookbooks/bluepill_test/recipes/default.rb

15: bluepill_service node['bluepill_test']['service_name'] do
16: action [:enable, :load, :start]
17: end

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.