Skip to content

Commit

Permalink
Added deploy_chef support for Arch Linux.
Browse files Browse the repository at this point in the history
Not installing rubygems from source since the arch ruby
package includes rubygems 1.3.7.
  • Loading branch information
uggedal committed Sep 22, 2011
1 parent 17de512 commit 5694d02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -134,7 +134,7 @@ LittleChef will try to autodetect the distro type and version of that node, and
You can also install Chef Solo with gems and/or without asking for confirmation:
`fix node:MYNODE deploy_chef:gems=yes,ask=no`
Currently supported Linux distributions include Ubuntu, Debian, CentOS, RHEL, Scientific Linux and Gentoo.
Currently supported Linux distributions include Ubuntu, Debian, CentOS, RHEL, Scientific Linux, Gentoo, and Arch Linux.
When using the Debian repository, you need to take into account that Opscode has separated Chef versions in different repos. Current default is Chef 0.10, but you can install Chef 0.9 by typing:
`fix node:MYNODE deploy_chef:version=0.9`
Expand Down
15 changes: 15 additions & 0 deletions littlechef/solo.py
Expand Up @@ -42,6 +42,8 @@ def install(distro_type, distro, gems, version, stop_client):
_rpm_install()
elif distro_type == "gentoo":
_emerge_install()
elif distro_type == "pacman":
_gem_pacman_install()
else:
abort('wrong distro type: {0}'.format(distro_type))

Expand Down Expand Up @@ -122,12 +124,16 @@ def check_distro():
elif 'This is \\n.\\O (\\s \\m \\r) \\t' in output:
distro = "Gentoo"
distro_type = "gentoo"
elif 'Arch Linux \\r (\\n) (\\l)' in output:
distro = "Arch Linux"
distro_type = "pacman"
else:
print "Currently supported distros are:"
print " Debian: " + ", ".join(debian_distros)
print " Ubuntu: " + ", ".join(ubuntu_distros)
print " RHEL: " + ", ".join(rpm_distros)
print " Gentoo"
print " Arch Linux"
abort("Unsupported distro '{0}'".format(output))
return distro_type, distro

Expand Down Expand Up @@ -164,6 +170,15 @@ def _gem_rpm_install():
_gem_install()


def _gem_pacman_install():
"""Install Chef from gems for apt based distros"""
with hide('stdout', 'running'):
sudo('pacman -Syu --noconfirm')
with show('running'):
sudo('pacman -S --noconfirm ruby base-devel wget rsync')
sudo('gem install --no-rdoc --no-ri chef')


def _apt_install(distro, version, stop_client='yes'):
"""Install Chef for debian based distros"""
with settings(hide('stdout', 'running')):
Expand Down

0 comments on commit 5694d02

Please sign in to comment.