Giter Site home page Giter Site logo

capistrano-chef's People

Contributors

bartoszkopinski avatar catsby avatar deathwish avatar dpnsan avatar justincampbell avatar mgreen avatar relistan avatar rroblak avatar sin-777 avatar smith avatar soupmatt avatar zambot 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

capistrano-chef's Issues

Unify Data Bag API

Make it so set_from_databag and set_from_encrypted_data_bag, are the same method, just with different parameters.

TypeError: no implicit conversion of Symbol into String

Getting this error when calling:

chef_role :web, 'roles:web'

Within my production.rb file.

Full stack trace:

cap aborted!
TypeError: no implicit conversion of Symbol into String
/Users/daniel/.rvm/gems/ruby-2.1.1/gems/capistrano-chef-1.0.0/lib/capistrano/dsl/chef.rb:5:in `delete'
/Users/daniel/.rvm/gems/ruby-2.1.1/gems/capistrano-chef-1.0.0/lib/capistrano/dsl/chef.rb:5:in `chef_role'
config/deploy/production.rb:3:in `<top (required)>'
/Users/daniel/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.0/lib/capistrano/setup.rb:15:in `load'
/Users/daniel/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.0/lib/capistrano/setup.rb:15:in `block (2 levels) in <top (required)>'
/Users/daniel/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.0/lib/capistrano/application.rb:15:in `run'
/Users/daniel/.rvm/gems/ruby-2.1.1/gems/capistrano-3.2.0/bin/cap:3:in `<top (required)>'
/Users/daniel/.rvm/gems/ruby-

Using: gem 'capistrano-chef' within my Gemfile.

Rails: 4.1
Ruby: 2.1

Works when using an empty hash for the options argument.

Capistrano 3 and chef: undefined method `instance' for Capistrano::Configuration:Class

Hi, I'm setting capistrano and chef, but when I run a simple command as rails g --help, this is the result. I'm using the last version of capistrano, capistrano-chef and capistrano-rails.

/home/user/.rvm/gems/ruby-2.0.0-p247@project/gems/capistrano-chef-0.0.8/lib/capistrano/chef.rb:81:in `<top (required)>': undefined method `instance' for Capistrano::Configuration:Class (NoMethodError)
        from /home/user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `require'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `rescue in block in require'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:66:in `block in require'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
        from /home/user/Projects/project/config/application.rb:7:in `<top (required)>'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@project/gems/railties-4.0.0/lib/rails/commands.rb:44:in `require'
        from /home/user/.rvm/gems/ruby-2.0.0-p247@project/gems/railties-4.0.0/lib/rails/commands.rb:44:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Need a better way to set db master automatically

The db role is for running migrations as far as I understand it. To do this at the moment I have an empty chef role on my chef server for db_master which i apply to one of my webservers, that I search on and use to set the db master. It would be nice to have a way to tell it to pick one of the webservers and use it to run migrations.

ec2 public_hostnames

How would I populate the chef_role entries with ec2 public_hostname data? Or am I thinking about this the wrong way?

Fix Travis

I swear everything is set up correctly, yet travis doesn't work for this. Probably missing something.

Unable to activate chef-10.12.0, because net-ssh-2.5.2 conflicts with net-ssh (~> 2.2.2)

Trying to enable capistrano-chef on a brand new install of OS X Mountain Lion, I get the following error whenever I add require 'capistrano/chef' to my Capfile.

/Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate chef-10.12.0, because net-ssh-2.5.2 conflicts with net-ssh (~> 2.2.2) (Gem::LoadError)
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:in `activate'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:780:in `block in activate_dependencies'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `each'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:in `activate'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:212:in `rescue in try_activate'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:209:in `try_activate'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:152:in `require'
    from Capfile:1:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:93:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:89:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:86:in `block in load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:86:in `each'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/configuration/loading.rb:86:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:65:in `each'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:65:in `load_recipes'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:31:in `execute!'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.12.0/bin/cap:4:in `<top (required)>'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/bin/cap:23:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/bin/cap:23:in `<main>'

Launching Capistrano when a new Chef node is bootstrapping fails

Currently, we have Amazon automatically launching and terminating instances. When a new instance is launched, our bootup script bootstraps the instance with Chef. However, if a user tries to open a Capistrano session with capistrano-chef installed during the bootstrap period, the following error appears:

/Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/server_definition.rb:16:in `initialize': undefined method `match' for nil:NilClass (NoMethodError)
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/roles.rb:57:in `new'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/roles.rb:57:in `block in role'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/roles.rb:57:in `each'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/roles.rb:57:in `role'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-chef-0.0.8/lib/capistrano/chef.rb:59:in `chef_role'
    from Capfile:12:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:89:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `block in load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `each'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `each'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `load_recipes'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:31:in `execute!'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/bin/cap:23:in `load'
    from /Users/rfonseca/.rbenv/versions/1.9.3-p194/gemsets/global/bin/cap:23:in `<main>'

This seems to be because during the bootstrap period the node is created in Chef, but has no attributes set (node is only saved at the end of the run).

Fails when chef query returns a nil entry

Chef::Search::Query#search can return nil rows, causing Capistrano::Chef.search_nodes to fail with:

capistrano-chef-0.0.7/lib/capistrano/chef.rb:29:in `search_chef_nodes': undefined method `[]' for nil:NilClass (NoMethodError)

Looking at Chef::Search::Query#search, nils are handled gracefully, leading me to believe that this may have come up for others.

400 "Bad Request" when limit is not explicitly stated in chef_role

I ran into an issue when upgrading from capistrano-chef 0.0.2 to 0.0.4 which I wanted to report. Perhaps this is something on my end but I'm not sure.

It appears if the limit attribute is not explicitly stated in the chef_role, the search query to the chef server fails with a 400 "Bad Request":

$ cap -v staging deploy
~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2632:in `error!': 400 "Bad Request" (Net::HTTPServerException)
from ./config/deploy/staging.rb:5:in `load'

This fails:

chef_role :web, "chef_environment:my_env_name AND roles:my_role",:attribute => :fqdn

This succeeds:

chef_role :web, "chef_environment:my_env_name AND roles:my_role",:attribute => :fqdn,:limit => 100

I'm not sure why this is happening as it appears limit is assigned a default value of 1000 in:
https://github.com/cramerdev/capistrano-chef/blob/v0.0.4/lib/capistrano/chef.rb

This was tested using:
Chef: 0.10.10
Capistrano: 2.13.4
Capistrano-chef: 0.0.4

Happy to share more info if needed. Thanks!

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.