Created
August 2, 2013 02:24
-
-
Save ches/6137066 to your computer and use it in GitHub Desktop.
Ansible Homebrew formula. Might not be accepted, so alas, Gist. See https://github.com/mxcl/homebrew/pull/21602
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Ansible < Formula | |
homepage 'http://www.ansibleworks.com/' | |
url 'http://ansibleworks.com/releases/ansible-1.2.2.tar.gz' | |
sha1 '41672bf49ccdfcfe09a3614171a80e979304e071' | |
head 'https://github.com/ansible/ansible.git', :branch => 'devel' | |
depends_on :python => ['paramiko', 'jinja2'] | |
depends_on :python => ['yaml' => 'PyYAML'] | |
depends_on 'libyaml' => :recommended | |
def install | |
files = Dir['**/*'].select { |path| File.file? path } | |
inreplace files do |s| | |
s.gsub! %r{/etc/ansible}, "#{prefix}/etc/ansible", false | |
s.gsub! %r{/usr/share/ansible}, "#{share}/ansible", false | |
end | |
system python, "setup.py", "install", "--prefix=#{prefix}" | |
man1.install Dir['docs/man/man1/*.1'] | |
end | |
test do | |
(testpath/'inventory').write <<-EOS.undent | |
[local] | |
127.0.0.1 | |
EOS | |
system "#{bin}/ansible", "all", "-i", "inventory", "-m", "setup", "-c", "local" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment