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

RSS

deployer (2) Versions 0.1.0

Installs/Configures a deployment user

Policyfile
Berkshelf
Knife
cookbook 'deployer', '= 0.1.0', :supermarket
cookbook 'deployer', '= 0.1.0'
knife supermarket install deployer
knife supermarket download deployer
README
Dependencies
Quality -%

deployer

Set up a deploy user with the necessary ssh authorized keys. This is great for working with Capistrano where you need to deploy code, but it doesn't make sense for each user to have a shell account.

This cookbook will create a deployment user (deploy by default) with passwordless-sudo permissions for deployment. As a result, it is highly recommended that you disable password authentication and only support key-based authentication.

Requirements

At this time, you must have a Unix-based machine. This could easily be adapted for Windows machines. Please submit a Pull Request if you wish to add Windows support.

Configuration

There are three attributes that you can override in your node:

  • node['deployer']['user'] - the name of the deploy user (default: deploy)
  • node['deployer']['group'] - the group for the deploy user (default: deploy)
  • node['deployer']['home'] - the home directory for the deploy user (default: /home/deploy)

Adding keys

There are two ways to add keys to the deployer. If you're using the opscode users cookbook, deployer easily integrates with the existing :users data_bags. Simply add the servers key to an existing user:

// data_bags/users/svargo.json
{
  "id": "svargo",
  "uid": "1000",
  "deploy": "any"
}

or specify an array of servers or IP addresses that the user should be allowed to deploy to:

// data_bags/users/svargo.json
{
  "id": "svargo",
  "uid": "1000",
  "deploy": [
    "1.2.3.4",
    "mynode.example.com"
  ]
}

If you're not using the users cookbook, or if you have a conflict, you can use the :deployers data_bag instead:

Create the data_bag:

knife data bag create deployers

Create a deployer:

// data_bags/deployers/svargo.json
{
  "id": "svargo",
  "deploy": [
    "1.2.3.4",
    "mynode.example.com"
  ]
}

The same options apply to the servers key as above. Note: this will not actually create system user accounts.

Usage

If you're using Berkshelf, just add deployer to your Berksfile:

cookbook 'deployer'

Otherwise, install the cookbook from the community site:

knife cookbook site install deployer

Have any other cookbooks depend on deployer by editing editing the metadata.rb for your cookbook.

depends 'deployer'

Once you have the cookbook installed, add it to your node's run_list or role:

"run_list": [
  "recipe[deployer]"
]

And override attributes as necessary:

# mynode.example.com
"override_attributes": {
  "deployer": {
    "user": "apache",
    "group": "apache",
    "home": "/usr/bin/false"
  }
},
"run_list": [
  "recipe[deployer]"
]

Contributing

  1. Fork the project
  2. Create a feature branch corresponding to you change
  3. Commit and test thoroughly
  4. Create a Pull Request on github
    • ensure you add a detailed description of your changes

License and Authors

Authors: Seth Vargo (@sethvargo)

Copyright 2012, Seth Vargo

No quality metric results found