Coder Social home page Coder Social logo

c10l / cookbook-deploy_key Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 27.0 39 KB

Idempotent Chef LWRP for creating, adding, removing and deleting SSH Deploy Keys on Bitbucket and Github

Home Page: https://supermarket.getchef.com/cookbooks/deploy_key

License: Other

Ruby 100.00%

cookbook-deploy_key's People

Contributors

dwradcliffe avatar ggayan avatar truenrush1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cookbook-deploy_key's Issues

Using an LWRP provider by its name directly is no longer supported in Chef 12

I am getting an warning when using DeployKeyGithub as it is show in the documentation.

"WARN: Using an LWRP provider by its name (DeployKeyGithub) directly is no longer supported in Chef 12 and will be removed. Use Chef::ProviderResolver.new(node, resource, action) instead."

I am not certain if this is an issue in the examples in the documentation or in the cookbook code.

Token with bitbucket?

Which token are we supposed to use with Bitbucket? Currently I'm using username/password, and using the API key as the password.

deloy_key resource gives error

I've a git repository hosted in bitbucket and I'm writing a recipe to clone the recipe suing 'deploy_key' and 'git' resource as mentioned below.

deploy_key "bitbucket_key" do
provider Chef::Provider::DeployKeyBitbucket
path 'C:\Windows\Temp'
credentials({
:user => 'my_user',
:password => "my_passowrd"
})
repo 'account/repo.git'
action :add
end

git "C:\ABC" do
repository "[email protected]:account/repo.git"
user "my_user"
action :checkout
end

While deploying recipe I'm getting following error.

Recipe Compile Error in

c:/chef/cache/cookbooks/deploy_key/libraries/deploy_key.rb

Gem::LoadError

Unable to activate httparty-0.12.0, because json-1.7.7 conflicts with json (~>
1.8)

Cookbook Trace:

c:/chef/cache/cookbooks/deploy_key/libraries/deploy_key.rb:22:in `<top
(required)>'

Environment detail:
OS: Windows 2012

Mutliple keys?

Hi, currently this cookbook creates 1 pub/private key per repo. Here I'm doing:

  %w[org/project1 org/project2].each do |repo|
    deploy_key repo.split('/')[1] do
      provider Chef::Provider::DeployKeyBitbucket
      path '/home/classcraft/.ssh'
      credentials({ user: 'my_user', password: 'MY_KEY' })
      repo repo
      owner 'my_user'
      group 'my_group'
      action :add
    end
  end

It seems that git is confused about the fact that it now has two keys. Why do you create a key per repo? Should we not create just 1 key and always upload that one?

Unable to activate httparty-0.12.0, because json-1.7.7 conflicts with json (~> 1.8)

This was reported on the Chef mailing list.

I'm using deploy_key resource to upload ssh key and then using git resource to
clone the repository. I'm getting below mentioned compilation error.

================================================================================
Recipe Compile Error in
c:/chef/cache/cookbooks/deploy_key/libraries/deploy_key.rb
================================================================================

Gem::LoadError
--------------
Unable to activate httparty-0.12.0, because json-1.7.7 conflicts with json (~>
1.8)

Cookbook Trace:
---------------
c:/chef/cache/cookbooks/deploy_key/libraries/deploy_key.rb:22:in `<top
(required)>'

Here is how my recipe looks like.

deploy_key "bitbucket_key" do
  provider Chef::Provider::DeployKeyBitbucket
  path 'C:\Windows\Temp'
  credentials({
    :user => 'my_user',
    :password => "my_passowrd"
  })
  repo 'organization/repo/path'
  action :add
end

git "C:\\ABC" do
  repository "https://bitbucket.org/organization/repo/path"
  user "my_user"
  action :checkout
end

Empty ssh-keygen

I am experiencing a very odd issue with the deploy_key resource. When I provide the name ads_dev-chef-ads1_deploy_key my keys are generated but empty. The files appear, but nothing is in them.

I have appended a single character to the file name and it works. But remove that character and you get empty files.

-rw------- 1 kpdev kpdev 1675 May 19 00:10 aads_dev-chef-ads1_deploy_key
-rw------- 1 kpdev kpdev  382 May 19 00:10 aads_dev-chef-ads1_deploy_key.pub
-rw------- 1 kpdev kpdev    0 May 19 00:07 ads_dev-chef-ads1_deploy_key
-rw------- 1 kpdev kpdev    0 May 19 00:07 ads_dev-chef-ads1_deploy_key.pub

I have removed the cache, deleted the whole ~/.ssh/ folder and the results are always the same. I have even gone so far as to manually run the command and it works.

ssh-keygen -t rsa -q -C '' -f '/home/kpdev/.ssh/ads_dev-chef-ads1_deploy_key' -P "" produces the appropriate output, but not through cookbook-deploy_key

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.