cookbook 'geminabox-ng', '~> 0.1.1'
geminabox-ng (2) Versions 0.1.1 Follow0
Installs/Configures geminabox-ng
cookbook 'geminabox-ng', '~> 0.1.1', :supermarket
knife supermarket install geminabox-ng
knife supermarket download geminabox-ng
geminabox-ng: Gem in a Box Cookbook
Opinionated Cookbook to install and Configure Gem in a Box
Largely inspired by previous versions:
And modernized, using ruby_rbenv and poise-service
Requirements
Cookbooks
-
poise-service
- for cross platform service script creation. -
ruby_rbenv
- for Ruby binary installation and gem installation.
Gems
These are installed by the cookbook for the function of the application.
Platforms
The following platforms have been tested with test kitchen.
- CentOS 6+
- Ubuntu 14.04
Chef
- 12.7+
Attributes
This cookbook is designed to provide Gem in a Box out of the box with no or minimal customization. However, there are a number of optional settings that can be tuned. Refer to the Default Attributes file for a full listing of available tunable attributes. The most interesting attributes outlined below.
Geminabox User
-
node['geminabox-ng']['user']['name']
- The username the geminabox process will run as. Defaults togeminabox
-
node['geminabox-ng']['name']['home_dir'] - Home Directory of
node['geminabox-ng']['name']user. Defaults to
/opt/geminabox`, full path required.
Geminabox Server Config
The following config options are offered for customization, in most cases the default is the most sane. Refer to the Gem in a Box page for information on options.
node['geminabox-ng-']['config']['build_legacy'] = false
node['geminabox-ng-']['config']['rubygems_proxy'] = true
node['geminabox-ng-']['config']['allow_remote_failure'] = true
Ruby Version,
-
node['geminabox-ng-']['ruby_verison']
- version of Ruby to install. Defaults to 2.4.2
Unicorn Server
Unicorn runs as middleware between Nginx and the Ruby appliation.
-
node['geminabox-ng-']['unicorn']['worker_processes']
- Number of worker processes. Default to 4. -
node['geminabox-ng-']['unicorn']['port']
- port Unicorn should listen on.
Nginx Server
Uhh.... none right now... Port is 8000 and it listens for unicorn on 8080... (so even though you can set node['geminabox-ng-']['unicorn']['port']
it doesn't do anything yet... see the TODO
Run List
By default, this cookbook runs all recipes if the default recipe is included. This is managed via the node['geminabox-ng']['run_list']
attribute. Instead of including or excluding recipes from your node run list, you can disable specific recipes by setting them to false
. e.g. the following will disable user creation/mangement:
node['geminabox-ng']['run_list']['user'] = false
Please refer to Recipes in the Usage section below for a full list of recipe names.
Usage
include recipe[geminabox-ng::default]
in your run list or policy file.
This cookbook is designed to be an out-of-the-box Gem in a Box. Additional work is required on the Nginx config to enable SSL, sockets, and simple auth... however, it should work for most simple use cases.
Recipes
This Cookbook performs a number of different tasks which have been isolated into their own recipes. The intention is that any one of these tasks can be overridden in a parent "wrapper" cookbook, e.g.: you already have a process for creating users so you chose not to use the users cookbook. In such cases, node attributes (such as node['geminabox-ng']['user']['name']
) will still need to be set.
The following recipes are provided:
-
user
- Creates user and home directory as determined bynode['geminabox-ng']['user']
attributes. -
ruby
- Leveragesruby_rbenv
to install rbenv and ruby -
server
- The main recipe in the cookbook. Installs the needed gemsgeminabox
,unicorn
, sets up unicorn config, and creates and starts appropriate init/upstart/systemd script for your system to start geminabox service. -
proxy
- Installs and configures reverse proxy for Unicorn service. Requires further work... not currently very configurable.
Development
- Source hosted at [GitHub][repo]
- Report issues/Questions/Feature requests on [GitHub Issues][issues]
Pull requests are very welcome! Make sure your patches are well tested.
Testing
This cookbook comes with a full suite of ChefSpec and InSpec tests. All patches must pass existing tests. Additional tests required for new features. To run tests use kitchen test
TODO:
- Get travis to work...
- Update Nginx template to be confiurable
- Update Nginx template to handle ssl
License and Author
- Author:: qubitrenegade (qbitrenegade@gmail.com)
Copyright 2017, qubitrenegade
https://opensource.org/licenses/MIT
Dependent cookbooks
ruby_rbenv >= 0.0.0 |
poise-service >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.1 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
0.1.1 failed this metric
Contributing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
0.1.1 failed this metric
Foodcritic Metric
0.1.1 passed this metric
0.1.1 passed this metric
No Binaries Metric
0.1.1 passed this metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
0.1.1 failed this metric
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 failed this metric