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.5.0

Git users configuration

Policyfile
Berkshelf
Knife
cookbook 'git_user', '~> 0.5.0', :supermarket
cookbook 'git_user', '~> 0.5.0'
knife supermarket install git_user
knife supermarket download git_user
README
Dependencies
Changelog
Quality 33%

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.5.0 / 2017-06-01

lookup users data bag in the same style as user cookbook @GolubevV, #7
github requires login as git user @veilig2000, #5

0.4.0 / 2015-12-02

expose gitconfig values as cookbook attributes
change gitconfig ownership to specified user @bcg62, #6

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.

Collaborator Number Metric
            

0.5.0 passed this metric

Contributing File Metric
            

0.5.0 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

Foodcritic Metric
            

0.5.0 failed this metric

FC064: Ensure issues_url is set in metadata: git_user/metadata.rb:1
FC065: Ensure source_url is set in metadata: git_user/metadata.rb:1
FC066: Ensure chef_version is set in metadata: git_user/metadata.rb:1
FC069: Ensure standardized license defined in metadata: git_user/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: git_user/resources/default.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: git_user/providers/default.rb:52
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.5.0 passed this metric

Testing File Metric
            

0.5.0 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

Version Tag Metric
            

0.5.0 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