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

git_user (4) Versions 0.3.1

Git users configuration

Policyfile
Berkshelf
Knife
cookbook 'git_user', '= 0.3.1', :supermarket
cookbook 'git_user', '= 0.3.1'
knife supermarket install git_user
knife supermarket download git_user
README
Dependencies
Changelog
Quality 0%

git_user

Build Status

Description

This cookbook features:

  • A Chef LWRP to configure:
    • git config.name and config.email
    • a git-specific private ssh key
    • known ssh hosts
  • A companion recipe for user::data_bag which adds the aforementioned configuration.

Usage

Include recipe[git_user] in your run_list and git_user resource will become available.

The git_user::data_bag recipe assumes that you're using the user::data_bag recipe from the excellent user cookbook. It lets you configure git-related aspects in user specific data_bags, e.g.

{
  "id"       : "testman",
  "home"     : "/home/testman"
  ...
  "git_user" : {
    "enabled"    : true,
    "full_name"  : "Test Man Jr.",
    "email"      : "testman@test.com",
    "private_key": "ABC123",
    "known_hosts": ["github.com"]
  }
}

Requirements

Platform

This cookbook has been tested with the following OSes:

  • centos / redhat
  • ubuntu
  • gentoo

Cookbooks

The cookbook has got the following dependencies:

Recipes

default

No-op, does nothing.

data_bag

Processes node['users'] and performs the configuration for the ones whose data_bags enable it, e.g.

{
  "id"        : "ranger",
  ...
  "git_user" : { "enabled": true, "email": "ranger@solarsystems.io" }
}

Resources and Providers

git_user

Actions

<table>
<thead>
<tr>
<th>Action</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>create</td>
<td>Creates <code>.gitconfig</code> and/or configures the ssh key and known hosts.
</td>
<td>Yes</td>
</tr>
</tbody>
</table>

Attributes

<table>
<thead>
<tr>
<th>Attribute</th>
<th>Description</th>
<th>Default Value</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td>login</td>
<td><b>Name attribute:</b> The login of the user.</td>
<td><code>nil</code></td>
<td>yes</td>
</tr>
<tr>
<td>home</td>
<td>User's home directory.</td>
<td><code>/home/<i>username</i></code> or <code>/root</code></td>
<td>no</td>
</tr>
<tr>
<td>full_name</td>
<td>A value for git <code>config.name</code></td>
<td><code><i>username</i></code></td>
<td>no</td>
</tr>
<tr>
<td>email</td>
<td>A value for git <code>config.email</code></td>
<td><code>"<i>username</i>@#{node['fqdn']}"</code></td>
<td>no</td>
</tr>
<tr>
<td>private_key</td>
<td>A private SSH key to use for git, will be created as <code>/home/<i>username</i>/.ssh/git_user_rsa</code></td>
<td><code>nil</code></td>
<td>no</td>
</tr>
<tr>
<td>known_hosts</td>
<td>Hosts which the <code>private_key</code> will be used with</td>
<td><code>[]</code></td>
<td>yes if <code>private_key</code> is specified</td>
</tr>
</tbody>
</table>

Example

git_user 'charlie' do
  private_key get_my_super_secret_key
  known_hosts %w{ github.com bitbucket.org }
end

git_user 'bob' do
  full_name   'Bob McAllister'
  email       'bob@example.com'
end

License

Copyright:: Vasily Mikhaylichenko and LxMx.

Licensed under BSD license.

http://opensource.org/licenses/BSD-2-Clause

Dependent cookbooks

user >= 0.0.0
git >= 0.0.0
ssh_known_hosts >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

0.3.1 / 2014-09-23

Provide a way to not include git recipe - @obazoud, #1

0.3.0 / 2013-06-17

Full rewrite with a LWRP and a data_bag recipe.
Implemented integration tests.

Foodcritic Metric
            

0.3.1 failed this metric

FC023: Prefer conditional attributes: /tmp/cook/bd600417d0f9b248254db82d/git_user/recipes/data_bag.rb:7