chrisroberts / vagabond

Advocating idleness and work-shyness
Other
233 stars 25 forks source link

vagabond knife for the local chef server? #17

Closed jaypipes closed 11 years ago

jaypipes commented 11 years ago

When executing vagabond knife, I'm seeing some unusual results:

jpipes@uberbox:~/repos/att-cloud/chef-repo$ bundle exec vagabond knife cookbook list
chef-server-populator   0.2.0

I was expecting to see the cookbooks in the Berksfile from the chef-repo. My Vagabondfile looks like this:

{
  :nodes => {
    :controller => {
      :template => "ubuntu_1204",
      :run_list => []
    },
    :compute_worker => {
      :template => "ubuntu_1204",
      :run_list => []
    },
    :ops => {
      :template => "ubuntu_1204",
      :run_list => []
    }
  },
  :clusters => {
    :simple => [
      'compute_worker',
      'controller',
      'ops'
    ]
  },
  :local_chef_server => {
    :zero => false,
    :berkshelf => true,
    :librarian => false,
    :enabled => true,
    :auto_upload => true
  },
  :sudo => true
}

What am I missing? Is the local (er)chef server not what vagabond knife communicates with?

If I ssh into one of the nodes and run knife cookbook list, I get an error:

jpipes@uberbox:~/repos/att-cloud/chef-repo$ bundle exec vagabond ssh controller
Vagabond: SSH connect to: controller
Warning: Permanently added '10.0.3.52' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.8.0-23-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
Last login: Thu Jun 27 18:52:31 2013 from 10.0.3.1
root@ubuntu1204-XXJFFz0Pf5OR:~# knife cookbook list
WARNING: No knife configuration file found
ERROR: ArgumentError: Cannot sign the request without a client name, check that :node_name is assigned

Perhaps because I have an empty run_list for the nodes?

chrisroberts commented 11 years ago

Ah, I bet since it failed on upload during the initial server provision (#16) that it never got to the cookbooks (or environments or data bags). Give this a try:

$ bundle exec vagabond server upload_cookbooks

That will upload all the cookbooks based on the Vagabondfile configuration (using berkshelf in this case). And since it can take awhile to complete depending on the size and complexity of the berksfile and cookbooks loaded, you can add the --debug switch to see how things are progressing.

jaypipes commented 11 years ago

Hmm, something's not quite working :)

jpipes@uberbox:~/repos/att-cloud/chef-repo$ bundle exec vagabond server upload_cookbooks --debug
Local chef server: Uploading cookbooks
Cookbooks being uploaded via berks
Vagabond exiting. Reason: undefined method `[]' for true:TrueClass

The cluster nodes and the local chef server do seem to be OK, though:

jpipes@uberbox:~/repos/att-cloud/chef-repo$ bundle exec vagabond status
Name            State    PID    IP        
compute_worker  running  19244  10.0.3.169
controller      running  19868  10.0.3.52 
ops             running  20495  10.0.3.9  
server          running  16441  10.0.3.47 
chrisroberts commented 11 years ago
:berkshelf => {}

Can you toss that into your vagabondfile in place of the :berkshelf => true

jaypipes commented 11 years ago

That did it. Makes sense after looking at the code in https://github.com/chrisroberts/vagabond/blob/master/lib/vagabond/server.rb#L167.

You want me to submit a patch that fixes up the docs in USAGE.md and/or changes the above code to be tolerant of TrueClass? Happy to do so.

chrisroberts commented 11 years ago

Actually applying the fix right now. Thanks :)