Unsolved
This post is more than 5 years old
2 Posts
0
15477
Sputnik Profile Tool Feedback Requested
https://github.com/hh-cookbooks/sputnik is ready for more eyes and feedback.
It includes a mini-tutoral and can feed off of yaml files in /etc/sputnik/*yml, but there is much more flexibility.
It basically creates metapackages on the fly based on the profiles. These packages are made available via a local repo (at some point we may make it very easy to push to a ppa). Installing or removing multiple profiles installs and autoremoves any dependencies.
Currently the tool only builds the profiles and makes them available to apt for installation and removal. We could integrate it fully into the tool, but I'd like some more feedback first.
Please fork and make pull requests or respond to this thread.
If you just want to add more example profiles, please fork and put them in files/default/example_profiles and issue a pull request.
kkillebrew
8 Posts
0
September 7th, 2012 14:00
Thanks for the tools. I've gotten a simple profile set up along with the android recipe, on a plain Ubuntu install set up with chef and the two Sputnik repositories. I did run into a couple of issues in the process:
The provided solo.rb fails to run for me, claiming 'realdirpath' is undefined, so I made myself a custom solo.rb with hard-coded file_cache_path and cookbook_path. I tried installing ruby 1.9.3 and setting it as the default, but still no realdirpath found.
Attempting to use the provided profiles failed for me due to an unmet dependency for the emacs profile. Making a custom profile for myself without emacs (just eclipse and ipython) worked for me.
I've got eclipse set up with an Android project checked out of git and compiled. I gave the directory created by the profile in /usr/local/android-sdk-linux user ownership and set it as the Android SDK Manager directory in ecliplse, and installed ia32-libs. I had to modify the compiler compliance level for my eclipse project to 1.6 to get my project to compile. If eclipse configurations could be included in a profile, I think that would be handy.
iandouglas736
68 Posts
0
September 8th, 2012 13:00
I ran into the same problem last night and posted an 'issue' at giithub.
Could you post more information on the workaround solo.rb you made? Or better yet, issue a pull request to fix it for the rest of us?
kkillebrew
8 Posts
0
September 8th, 2012 16:00
Also, I found it necessary to first make the checkout directory a recognized chef cookbook using knife:
knife cookbook create cookbook sputnik -o sputnik/
kkillebrew
8 Posts
0
September 8th, 2012 16:00
Okay, I've posted a modified solo.rb to my fork here:
github.com/.../sputnik
iandouglas736
68 Posts
0
September 9th, 2012 00:00
Thanks for the pull request. I patched my solo.rb but running that knife command didn't help me:
$ knife cookbook create cookbook sputnik -o sputnik/
WARNING: No knife configuration file found
** Creating cookbook cookbook
** Creating README for cookbook: cookbook
** Creating CHANGELOG for cookbook: cookbook
** Creating metadata for cookbook: cookbook
$ sudo chef-solo chef-solo -c sputnik/config/solo.rb -o sputnik::hippiehacker
#
[Sat, 08 Sep 2012 23:46:53 -0700] INFO: *** Chef 10.14.0 ***
[Sat, 08 Sep 2012 23:46:54 -0700] WARN: Run List override has been provided.
[Sat, 08 Sep 2012 23:46:54 -0700] WARN: Original Run List: []
[Sat, 08 Sep 2012 23:46:54 -0700] WARN: Overridden Run List: [recipe[sputnik::hippiehacker]]
[Sat, 08 Sep 2012 23:46:54 -0700] INFO: Run List is [recipe[sputnik::hippiehacker]]
[Sat, 08 Sep 2012 23:46:54 -0700] INFO: Run List expands to [sputnik::hippiehacker]
[Sat, 08 Sep 2012 23:46:54 -0700] INFO: Starting Chef Run for id-sputnik
[Sat, 08 Sep 2012 23:46:54 -0700] INFO: Running start handlers
[Sat, 08 Sep 2012 23:46:54 -0700] INFO: Start handlers complete.
[Sat, 08 Sep 2012 23:46:54 -0700] WARN: found a directory lost+found in the cookbook path, but it contains no cookbook files. skipping.
[Sat, 08 Sep 2012 23:46:54 -0700] ERROR: Running exception handlers
[Sat, 08 Sep 2012 23:46:54 -0700] ERROR: Exception handlers complete
[Sat, 08 Sep 2012 23:46:54 -0700] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Sat, 08 Sep 2012 23:46:54 -0700] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook sputnik not found. If you're loading sputnik from another cookbook, make sure you configure the dependency in your metadata
kkillebrew
8 Posts
0
September 9th, 2012 10:00
I've put a fix into the solo.rb I posted, to set the file cache path to the checkout directory. Running the knife command isn't actually necessary. Running chef-solo now I think should work for you.
iandouglas736
68 Posts
0
September 11th, 2012 00:00
cd # return to home dir
git clone git://github.com/hh-cookbooks/sputnik.git
wget " -O sputnik/config/solo.rb
chef-solo chef-solo -c sputnik/config/solo.rb -o sputnik::hippiehacker
#
[Mon, 10 Sep 2012 23:43:35 -0700] INFO: *** Chef 10.14.2 ***
[Mon, 10 Sep 2012 23:43:35 -0700] WARN: Run List override has been provided.
[Mon, 10 Sep 2012 23:43:35 -0700] WARN: Original Run List: []
[Mon, 10 Sep 2012 23:43:35 -0700] WARN: Overridden Run List: [recipe[sputnik::hippiehacker]]
[Mon, 10 Sep 2012 23:43:35 -0700] INFO: Run List is [recipe[sputnik::hippiehacker]]
[Mon, 10 Sep 2012 23:43:35 -0700] INFO: Run List expands to [sputnik::hippiehacker]
[Mon, 10 Sep 2012 23:43:35 -0700] INFO: Starting Chef Run for id-sputnik
[Mon, 10 Sep 2012 23:43:35 -0700] INFO: Running start handlers
[Mon, 10 Sep 2012 23:43:35 -0700] INFO: Start handlers complete.
[Mon, 10 Sep 2012 23:43:35 -0700] ERROR: Running exception handlers
[Mon, 10 Sep 2012 23:43:35 -0700] ERROR: Exception handlers complete
/usr/lib/ruby/vendor_ruby/chef/file_cache.rb:56:in `initialize': Permission denied - /home/chef-stacktrace.out (Errno::EACCES)
from /usr/lib/ruby/vendor_ruby/chef/file_cache.rb:56:in `open'
from /usr/lib/ruby/vendor_ruby/chef/file_cache.rb:56:in `store'
from /usr/lib/ruby/vendor_ruby/chef/application.rb:144:in `debug_stacktrace'
from /usr/lib/ruby/vendor_ruby/chef/application/solo.rb:248:in `run_application'
from /usr/lib/ruby/vendor_ruby/chef/application/solo.rb:218:in `loop'
from /usr/lib/ruby/vendor_ruby/chef/application/solo.rb:218:in `run_application'
from /usr/lib/ruby/vendor_ruby/chef/application.rb:70:in `run'
from /usr/bin/chef-solo:24
The permission denied error is because the cache path goes one level too high.
Changing the cache path back to ../cache and mkdir ~/cache/ I get this error:
chef-solo chef-solo -c sputnik/config/solo.rb -o sputnik::hippiehacker
#
[Mon, 10 Sep 2012 23:44:52 -0700] INFO: *** Chef 10.14.2 ***
[Mon, 10 Sep 2012 23:44:52 -0700] WARN: Run List override has been provided.
[Mon, 10 Sep 2012 23:44:52 -0700] WARN: Original Run List: []
[Mon, 10 Sep 2012 23:44:52 -0700] WARN: Overridden Run List: [recipe[sputnik::hippiehacker]]
[Mon, 10 Sep 2012 23:44:52 -0700] INFO: Run List is [recipe[sputnik::hippiehacker]]
[Mon, 10 Sep 2012 23:44:52 -0700] INFO: Run List expands to [sputnik::hippiehacker]
[Mon, 10 Sep 2012 23:44:52 -0700] INFO: Starting Chef Run for id-sputnik
[Mon, 10 Sep 2012 23:44:52 -0700] INFO: Running start handlers
[Mon, 10 Sep 2012 23:44:52 -0700] INFO: Start handlers complete.
[Mon, 10 Sep 2012 23:44:52 -0700] ERROR: Running exception handlers
[Mon, 10 Sep 2012 23:44:52 -0700] ERROR: Exception handlers complete
[Mon, 10 Sep 2012 23:44:52 -0700] FATAL: Stacktrace dumped to /home/id/cache/chef-stacktrace.out
[Mon, 10 Sep 2012 23:44:52 -0700] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook sputnik not found. If you're loading sputnik from another cookbook, make sure you configure the dependency in your metadata
Either way, the system doesn't know how to find some core sputnik cookbook.
iandouglas736
68 Posts
0
September 11th, 2012 01:00
Same issue:
iandouglas736
68 Posts
0
September 11th, 2012 01:00
Backing up a step or two, where are you checking out the sputnik repo? I've been doing it in my home directory.
I created /etc/chef/solo.rb and included the two lines above, but that didn't help any either. I have /etc/chef/client.rb but it's empty.
There has to be something much more fundamental that's missing from my configuration/setup.
kkillebrew
8 Posts
0
September 11th, 2012 01:00
Hm, I'm guessing I've done something different in setting up chef then. I think I edited /etc/chef/solo.rb to set:
file_cache_path "/var/cache/chef"
cookbook_path [ "/var/chef/cookbooks" ]
kkillebrew
8 Posts
0
September 11th, 2012 01:00
I've been running chef-solo as sudo; the error I get if I don't regards permissions denial to /var/chef, so I believe it's necessary. Also, chef writes to its /var directory later. Have you tried running it as sudo?
The sputnik cookbook in question consists of the contents of the repository we're looking at.
Looking at the notes in the solo.rb provided, it looks like the intent was to use the checkout directory as the cache directory, which I believe my version does. Chef then looks within its cache directory for the cookbook (the sputnik directory checked out).
kkillebrew
8 Posts
0
September 11th, 2012 02:00
Aha, I've been working down one directory in my home folder. I just deleted all the other chef cookbook checkouts I'd made in to my home directory and got the 'CookbookNotFound' error. Then I checked the hh-cookbooks version back out into my home directory, changed into the directory with my checkout, and it works again! So yes, it is going up one directory too far somewhere. I've just put in another change to my version that I think fixes this.
iandouglas736
68 Posts
0
September 11th, 2012 02:00
Yes, that worked great.
$ cd
$ git clone github.com/.../sputnik.git
$ sudo chef-solo chef-solo -c sputnik/config/solo.rb -o sputnik::hippiehacker
I tried the Android cookbook for kicks, it downloaded and unpacked, though the chef output doesn't seem to indicate *where* it unpacked... I found it under /usr/local/
Thanks again for the help! Hopefully these notes help others too.