A Chef cookbook to manage Git.
To install Git and clone a repository using a deploy key from a data bag:
poise_git '/srv/myapp' do
repository '[email protected]:example/myapp.git'
deploy_key data_bag_item('keys', 'myapp')['key']
endTo install Git and clone a repository using a deploy key that already exists on disk:
poise_git '/srv/myapp' do
repository '[email protected]:example/myapp.git'
deploy_key '/path/to/mykey.pem'
endpoise-git::default– Install Git.
node['poise-git']['default_recipe']– Recipe used bypoise_gitto install Git if not already available. (default: poise-git)node['poise-git']['provider']– Default provider forpoise_git_clientresource instances. (default: auto)node['poise-git']['recipe'][*]– All subkeys of'recipe'will be passed as properties to thepoise_git_clientresource before installation when using thepoise-git::defaultrecipe.
The poise_git resource extends the core git resource, adding a deploy_key
property to use SSH deploy keys automatically.
poise_git '/srv/myapp' do
repository '[email protected]:example/myapp.git'
deploy_key 'mysecretkey'
endThe poise_git resource supports all the same actions and properties as the
core git resource.
The deploy_key property can either be passed the absolute path to an existing
SSH key file, or the raw SSH private key text.
The poise_git_client resource installs Git.
poise_git_client 'git':install– Install Git. (default):uninstall– Uninstall Git.
version– Version of Git to install. If a partial version is given, use the latest available version matching that prefix. (name property)
The poise_git_client resource uses provide options for per-provider configuration. See
the poise-service documentation
for more information on using provider options.
The system provider installs Git using system packages. This is currently
only tested on platforms using apt-get and yum (Debian, Ubuntu, RHEL, CentOS
Amazon Linux, and Fedora) and is a default provider on those platforms. It may
work on other platforms but is untested.
poise_git_client 'git' do
provider :system
endpackage_name– Override auto-detection of the package name.package_upgrade– Install using action:upgrade. (default: false)package_version– Override auto-detection of the package version.
The dummy provider supports using the poise_git_client resource with ChefSpec
or other testing frameworks to not actually install Git. It is used by default under
ChefSpec. It can also be used to manage the Git installation externally from
this cookbook.
poise_git_client 'git' do
provider :dummy
options git_binary: '/path/to/git'
endgit_binary– Path to thegitexecutable. (default: /git)git_environment– Hash of environment variables to use with this Git. (default: {})
Development sponsored by SAP.
The Poise test server infrastructure is sponsored by Rackspace.
Copyright 2015-2017, Noah Kantrowitz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.