Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


chef_eye (8) Versions 1.0.0

Installs/Configures chef_eye

cookbook 'chef_eye', '= 1.0.0', :supermarket
cookbook 'chef_eye', '= 1.0.0'
knife supermarket install chef_eye
knife supermarket download chef_eye
Quality 100%


Cookbook for setup eye services and applications

Code Climate
Build Status

Supported Platforms

  • Ubuntu 12.04
  • Ubuntu 14.04


Key Type Description Default
chef_eye.eye_bin String Path to eye executable file /usr/local/bin/eye
chef_eye.leye_bin String Path to local eye executable file /usr/local/bin/leye Hash or Array Array of users or Hash with users as keys and service options as value ['root']
chef_eye.service_provider String 'upstart' or 'init' 'upstart'
chef_eye.applications Hash Applications configurations {}
chef_eye.install_ruby Boolean Try to install ruby packages ruby, ruby-dev. If you want to install ruby using another way, you should set this value to false true


This cookbook provides two strategies of usage eye. "Eye" per user and "eye" per project (local eye).
First strategy run one eye daemon for all configurations and load it.

Eye per user file structure (for user vagrant):

/etc/init/eye_vagrant.conf # Eye service for user vagrant (generated by chef_eye::service recipe)
/etc/eye/config.eye # Main eye file. This file contains eye service settings and load config files from /etc/eye/vagrant/*.eye
/etc/eye/vagrant/application1.eye # Application config (generated by chef_eye_application lwrp)

Eye per project (local eye) file structure (generated by chef_eye_application_local lwrp):

/var/www/application/shared # Eye home
/var/www/application/shared/Eyefile # Local eye service configuration and loader for application config
/var/www/application/shared/config/application.eye # Configuration file for application. Default path /config/.eye



Include chef_eye in your node's run_list:

  "run_list": [


Cookbook used system ruby and try to install ruby, ruby-dev packages if node['chef_eye']['install_ruby'] set to true
If you want to use custom system ruby, you need set node['chef_eye']['install_ruby'] to false and install custom ruby before
before this cookbook. For example, if you want to use uid and gid application options,
you need install ruby 2.0.0 as system ruby. Its installation is your concern.


This recipe configure chef_eye_service for using with per user strategy

By default service named by eye_<username>. For example, service for user vagrant, will be named as eye_vagrant, service for user root as eye_root, etc.

If you need to reload service for user vagrant, you can use

some_resource do
  notifies :reload, 'chef_eye_service[eye_vagrant]'

If you want to change configuration for service for ubuntu:

default['chef_eye']['services'] = {
  ubuntu: {
    'logger' => '/var/log/eye/ubuntu.log'
    'mail' => {
      'host' => '',
      'port' => 25,
      'domain' => ''
    contacts: {
      'errors' => {
        'type' => 'mail',
        'contact' => ''
      'dev' => {
        'type' => 'mail',
        'contact' => '',
        'opts' => {}


This service generate chef_eye_application LWRP's using node['chef_eye']['applications'] attributes.
For example:

default['chef_eye']['applications']['my_app'] = {
  type: 'local',
  owner: 'vagrant', # required
  group: 'vagrant',
  config_dir: '/var/www/rails_sample/shared/config',

  # for local version
  eye_file: 'Eyefile',
  eye_home: '/var/www/rails_sample/shared',
  eye_config: {
    logger: '/var/www/rails_sample/shared/log/eye.log'
  service_provider 'upstart',
  #application config
  config: {
    working_dir: '/var/www/rails_sample/current',
    checks: {
      cpu: {
        :every => 30,
        :below => 80,
        :times => 3
        :every => 30,
        :below => 73400320,
        :times => [ 3, 5 ]
    process: {
      unicorn: {
        daemonize:  true,
        pid_file: '',
        stdall: 'puma.log',
        start_command: 'bundle exec unicorn --port 33280 --environment production',
        stop_signals: ['TERM', 5, 'KILL']
      resque: {
        pid_file: 'tmp/pids/',
        start_command: 'bin/resque work --queue=high',
        checks: {
          cpu: {
            :every => 30,
            :below => 80,
            :times => 3




Name Type Description Default Value
service_name String Name of the system service and system configuration file (/etc/init/<service_name>.conf). This is a name_attribute
type String Type need for set execution file eye or leye. Can be 'local' or 'user' 'user'
service_provider String upstart or init 'upstart'
owner String Owner of service 'root'
group String Group of service 'root'
cookbook Symbol, String, NilClass Cookbook name for searching templates nil
eye_home String, NilClass Home directory for eye process. Used only for 'local' service type nil
eye_file String, NilClass Main configuration file for loading by service. For local service this is Eyefile name, for user '/etc/<username>.eye'. This file must be generated by another LWRP. nil


Name Description
:nothing default
:start Start eye service
:stop Stop eye service
:restart Restart eye service
:stop_all Send start to all loaded applications
:start_all Send stop to all loaded applications
:restart_all Send restart to all loaded applications


This is a main LWRP for configure eye application.
You can use any valid eye options for config attribute.


Name Type Description Default Value
owner String Owner fo application 'root'
group String Owner fo application 'root'
cookbook String Cookbook name for searching templates 'chef_eye'
config Hash or Block Application configuration {}
config_dir String, NilClass Application configuration nil (set dynamic: <eye_home>/config for local, /etc/eye/<user_name>/ for user strategies)
service_provider string Application configuration node['chef_eye']['service_type']
eye_home String, NillClass Home for .eye directory, used only for local strategy. If empty, provider try to resolve eye_home path by eye_file. If eye_file is relative path, and eye_home empty, provider raise exception.
eye_file String Application service configuration file name (relative of eye_home) or absolute path, used only for local strategy 'Eyefile'
eye_config Hash or Block Application Service configuration, used only for local strategy {}


Provider Name Description
Chef::Provider::ChefEyeApplication Default provider. This provider implement user application strategy
Chef::Provider::ChefEyeApplicationLocal Default provider. This provider implement local application strategy

Cookbook provide chef_eye_application resource. This is a main resource for generate eye application configuration.

chef_eye_application 'name_of_my_app' do
  owner 'ubuntu'
  group 'ubuntu'
  working_dir '/var/www/rails_sample'
  config do
    env 'RAILS_ENV' => 'production'
    working_dir '/var/www/my_app'
    trigger :flapping, :times => 10, :within => 1.minute
    process :puma do
      daemonize true
      pid_file ""
      stdall "puma.log"
      start_command "bundle exec puma --port 33280 --environment production"
      stop_signals [:TERM, 5.seconds, :KILL]
      restart_command "kill -USR2 {PID}"
      restart_grace 10.seconds
      check :cpu, :every => 30, :below => 80, :times => 3
      check :memory, :every => 30, :below => 70.megabytes, :times => [3,5]
  action :configure # or :delete
  notifies :reload, 'chef_eye_service[eye_ubuntu]' # you need notify service for reload

Or as hash

chef_eye_application 'name_of_my_app' do
  owner 'ubuntu'
  group 'ubuntu'
      env: {
        RAILS_ENV: 'production'
      working_dir: '/var/www/my_app',
      triggers: {
        flapping: {
          :times => 10,
          :within => 1.minute
      processes: {
        puma: {
          daemonize: true,
          pid_file: "",
          stdall: "puma.log",
          start_command: "bundle exec puma --port 33280 --environment production",
          stop_signals: [:TERM, 5.seconds, :KILL],
          restart_command: "kill -USR2 {PID}",
          restart_grace: 10.seconds,
          checks: {
            cpu: {:every => 30, :below => 80, :times => 3},
            memory: {:every => 30, :below => 70.megabytes, :times => [3, 5]}
  action :configure # or :delete
  notifies :reload, 'chef_eye_service[eye_ubuntu]' # you need notify service for reload


  • Add unit tests
  • Add integration tests

License and Authors

Author:: Nikolay Murga (

Dependent cookbooks

apt >= 0.0.0
build-essential >= 0.0.0
ruby_rvm >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.


Initial release of chef-eye

Foodcritic Metric

1.0.0 passed this metric