51876

How to pull private git repo using chef from gitolite

Question:

I am new to using chef. I am able to clone/pull a github repository using the following code on my recipe

git "/var/www/hello_app" do repository "git://github.com/MyUser/MyProject.git" reference "master" action "sync" user "gituser" end

I am trying to pull/clone my files from a private git repository managed my gitolite which means that authentication relies on sshd. I already have my id_rsa private key installed through a data_bag on gituser's .ssh/id_rsa file , the user who is pulling/cloning the private repo. Pulling/cloning the repository manually works.

The command I execute is

git clone gitoliteuser@myserver:MyProject.gr

How should I modify my recipe so I can pull my private repository ?

Answer1:

The important part of the resource is the repository value. To use your gitolite repo, change the value to the one shown in your question:

git "/var/www/hello_app" do repository "gitoliteuser@myserver:MyProject.gr" reference "master" action "sync" user "gituser" end

More details about using the git resource can be found on the opscode site here : <a href="http://docs.opscode.com/resource_git.html" rel="nofollow">http://docs.opscode.com/resource_git.html</a>

Recommend

  • ssh: Permission denied (publickey,keyboard-interactive)
  • How to push Tag to Bitbucket Git Repository in Bamboo from Cake build task?
  • SSH Key ask to enter passphrase after start-agent
  • Can gitolite prevent branch deletes?
  • Issue with ngRoute injecting resolve services into component controller
  • Gitolite Eclipse 'Auth fail'
  • Unit Test case using Rspec for each loop
  • Make mongoid session read only
  • Matlab to Python Conversion binary file read
  • gulp: passing dependent task return stream as parameter
  • readyRead() signal of QextSerialPort (QIODevice) is not being called fast enough
  • java.lang.IndexOutOfBoundsException occuring on ArrayList
  • Wrapping a c#/WPF GUI around c++/cli around native c++
  • jwtBearer bearer token with rc-1 update to ASP.Net 5
  • MYSQ & MVC3 SQL connection error \\ ProviderManifestToken but I am using MySQL
  • x64 applications using gdi+: what are the consequences on performance?
  • PHP CURL timing out but CLI CURL works
  • Do I need to reset a Perl hash index?
  • ActiveRecord query for a count of new users by day
  • Why querying a date BC is changed to AD in Java?
  • ilmerge with a PFX file
  • Why value captured by reference in lambda is broken? [duplicate]
  • Update CALayer sublayers immediately
  • Knitr HTML Loop - Some HTML output, some R output
  • Javascript + PHP Encryption with pidCrypt
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • How do I rollback to a specific git commit
  • Is there a mandatory requirement to switch app.yaml?
  • Benchmarking RAM performance - UWP and C#
  • Why joiner is not used after Sequence generator or Update statergy
  • Getting Messege Twice Using IMvxMessenger
  • Turn off referential integrity in Derby? is it possible?
  • Authorize attributes not working in MVC 4
  • Busy indicator not showing up in wpf window [duplicate]
  • Recursive/Hierarchical Query Using Postgres
  • How can i traverse a binary tree from right to left in java?
  • UserPrincipal.Current returns apppool on IIS
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF
  • How can I use threading to 'tick' a timer to be accessed by other threads?