[LRUG] puppet or chef [was: availability of talks]
Alex Tomlins
alex.tomlins at unboxedconsulting.com
Mon Aug 22 11:32:46 PDT 2011
On 19/08/11 10:11, Henry Garner wrote:
> On 18 Aug 2011, at 23:50, Viktor Tron wrote:
>> After I found this impressive piece of work https://github.com/fnichol/chef-rvm
>> I am considering switching to Chef.
> I've recently explored a similar set up (Ubuntu 10.04, RVM, Chef). Fletcher's project is impressive, but still quite new. The API was still changing as little as a fortnight ago.
>
> In the end http://help.opscode.com/kb/troubleshooting/may-i-use-rvm-to-install-ruby-andor-rubygems-that-the-chef-client-runs-under convinced me to write my own bootstrap script to install ruby and rubygems from source before any of the chef magic happens.
I've found it useful to separate the system ruby from the application
ruby. For the system ruby, I use whatever comes with the distribution,
installed in /usr/bin. This is used to run chef and any other system
utils (munin scripts, whatever...). I then have a separate ruby install
under /usr/local that is solely for the apps' use. This means that the
app ruby environment can be kept clean (rake, bundler and that's about it).
My bootstrap script (invoked from xen-tools) installs ruby (from apt),
and then chef (from rubygems). It then invokes chef-client with a json
file which then causes chef to configure itself from the server (using
the chef-client cookbook).
For the app ruby, I've re-packaged up ruby-enterprise 1.8.6 and 1.8.7
with the following changes:
* It installs under /usr/local instead of /opt/ruby-enterprise (1.8.6
only, 1.8.7 already did this)
* Exclude docs and common gems.
* Include rubygems 1.3.7 (patched to not install rdoc and ri by
default, see https://github.com/rubygems/rubygems/pull/42)
If that's useful to you, the changes are available here
<https://github.com/unboxed/rubyenterpriseedition187-330/tree/release>
and here <https://github.com/unboxed/rubyenterpriseedition186>. If
there's any interest, I can make the debs (for Ubuntu 10.04) available.
>> - do you use your provision agent for deployment? which allows for better management of rake tasks, cron, db privileges, etc
> I'm still using capistrano for deployment, but my deploy script just executes chef-client on the remote server and leaves chef to synchronise everything.
>
> The chef deploy resource has a few different callbacks which allow you to symlink your shared directories, install your bundle, call whenever to update your crontab, etc.
Personally, I don't think using chef for deployment makes much sense
until you're using something like AWS, and dynamically spinning up app
servers etc.
I'm using chef mostly to manage our various staging servers for
projects, and we still use capistrano for deployment there.
>> - if you use public recipes/modules, how do you manage their updates?
> I haven't needed to do this yet, but since your chef-repo is under version control all the normal rules apply.
If you're using official opscode cookbooks, you can use the 'knife
cookbook site vendor' command, which will pull the latest version of the
cookbook into your tree in a git friendly way (it creates a
vendor-<cookbook_name> branch, pulls the cookbook into there, tags it,
and then merges it into master). This means that you can make your own
tweaks to the cookbook, and maintain them separately from upstream changes.
>> - any pointers to good resources for your typical rails stack using puppet/chef would be fab
> Opscode hosts an 'application' cookbook which aims to be a bit of a swiss army knife for deploying all manner of apps. I found it to be the single most helpful resource for figuring out how to deploy my app and dependencies (I ended up hacking it about to write my own application-specific cookbook as a learning exercise). https://github.com/opscode/cookbooks/tree/master/application
>
I've done a similar thing for configuring app deployment environments.
It doesn't handle the deployment itself, but it sets up the target
environment (creates the user and database, sets up the apache vhost
etc.). This all driven from items in a central web_apps data bag. To
setup a new app, I simply need to upload a json file to the data bag,
and the next time the relevant server checks in, the environment is created.
newho, I think I've rambled on enough for now...
thanks,
Alex
--
Alex Tomlins
Unboxed
Consulting
E: alex.tomlins at unboxedconsulting.com
<mailto:alex.tomlins at unboxedconsulting.com>
M: +44 7824 696 890
T: +44 20 3137 2930
F: +44 20 7183 4251
17 Blossom Street
London, E1 6PL
United Kingdom
www.unboxedconsulting.com <http://www.unboxedconsulting.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20110822/d77eb3fc/attachment-0003.html>
More information about the Chat
mailing list