Permalink
Browse files

Added support for installation via the Opscode Omnibus installer

  • Loading branch information...
wamcvey committed May 18, 2012
1 parent b8fa5f2 commit 6f7861e20ecee809c7e35276f4aa35b8e75c1e6c
Showing with 30 additions and 6 deletions.
  1. +9 −1 docs/index.rst
  2. +3 −0 fabfile.py
  3. +18 −5 provision/__init__.py
View
@@ -85,4 +85,12 @@ Settings
:default: ``{}``
- Additional JSON information you'd like to transfer to the server.
+ Additional JSON information you'd like to transfer to the server.
+
+.. attribute:: use_omnibus_installer
+
+ :default: ``False``
+
+ Whether to use the
+ `Opscode Omnibus Installer <http://www.opscode.com/chef/install/>`_
+ to load Chef.
View
@@ -3,5 +3,8 @@
env.hosts = ['vagrant@localhost:2222']
+# Uncomment to use the Opscode Omnibus installer
+# chef.use_omnibus_installer = True
+
chef.add_recipe('python')
chef.path = '/var/chef-solo'
View
@@ -16,6 +16,7 @@
gems='1.8.10',
recipes=[],
json={},
+ use_omnibus_installer = False,
)
SOLO_RB = """
@@ -70,6 +71,18 @@ def gems():
if not files.exists('/usr/local/bin/chef-solo'):
sudo('gem install chef --no-rdoc --no-ri -n /usr/local/bin')
+def omnibus_install():
+ """Install Chef from Opscode's Omnibus installer
+ """
+ ctx = {
+ 'filename':'%(path)s/install.sh' % chef,
+ 'url':'http://opscode.com/chef/install.sh',
+ }
+ if not files.exists(ctx['filename']):
+ sudo('wget -O %(filename)s %(url)s' % ctx)
+ with cd(chef.path):
+ sudo('bash install.sh')
+
def upload():
ctx = {
'cookbooks': '%(path)s/cookbooks' % chef,
@@ -107,13 +120,13 @@ def upload():
files.append(ctx['solo.rb'], SOLO_RB % chef, use_sudo=True)
@task(default=True)
-def provision():
+def provision(omnibus=False):
sudo('mkdir -p %(path)s' % chef)
apt()
- gems()
+ if omnibus or chef.use_omnibus_installer:
+ omnibus_install()
+ else:
+ gems()
upload()
with cd(chef.path):
sudo('chef-solo -c solo.rb -j node.json')
-
-
-

0 comments on commit 6f7861e

Please sign in to comment.