2013-09-02 11:43:49 +00:00
|
|
|
class Ansible < Formula
|
2014-10-15 11:29:54 +00:00
|
|
|
homepage "http://www.ansible.com/home"
|
2015-02-24 19:51:22 +00:00
|
|
|
url "http://releases.ansible.com/ansible/ansible-1.8.4.tar.gz"
|
|
|
|
sha1 "74be0c102506d14940bc76f5c5659618368c41ec"
|
2015-03-14 21:14:40 +00:00
|
|
|
revision 1
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
head "https://github.com/ansible/ansible.git", :branch => "devel"
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-06-27 17:31:11 +00:00
|
|
|
bottle do
|
2015-03-14 22:16:45 +00:00
|
|
|
sha256 "9648b22d63035e67dfa370a7193816b72ba0188510711fbd5a1aea96174761d5" => :yosemite
|
|
|
|
sha256 "3e7bcb688870ed8612fe36f13b16cafa3c72b7f2d1fd51d324198f6dfef8fb9e" => :mavericks
|
|
|
|
sha256 "079cd05f4dca46bed885faaaf5d641d48d00ea9322356b08e6571c1784f6cbf9" => :mountain_lion
|
2014-06-27 17:31:11 +00:00
|
|
|
end
|
|
|
|
|
2014-04-30 22:35:13 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
2014-10-15 11:29:54 +00:00
|
|
|
depends_on "libyaml"
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-11-16 16:32:20 +00:00
|
|
|
resource "docker-py" do
|
|
|
|
url "https://pypi.python.org/packages/source/d/docker-py/docker-py-0.6.0.tar.gz"
|
|
|
|
sha1 "01eb7b2cd1a607d361170041b973a0e36bb1be42"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "requests" do
|
2015-03-14 21:14:40 +00:00
|
|
|
url "https://pypi.python.org/packages/source/r/requests/requests-2.6.0.tar.gz"
|
|
|
|
sha256 "1cdbed1f0e236f35ef54e919982c7a338e4fea3786310933d3a7887a04b74d75"
|
2014-11-16 16:32:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "websocket-client" do
|
|
|
|
url "https://pypi.python.org/packages/source/w/websocket-client/websocket-client-0.11.0.tar.gz"
|
|
|
|
sha1 "a38cb6072a25b18faf11d31dd415750692c36f33"
|
|
|
|
end
|
|
|
|
|
|
|
|
resource "six" do
|
|
|
|
url "https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz"
|
|
|
|
sha1 "aa3b0659cbc85c6c7a91efc51f2d1007040070cd"
|
|
|
|
end
|
2013-10-20 13:44:20 +00:00
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "pycrypto" do
|
|
|
|
url "https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz"
|
|
|
|
sha1 "c17e41a80b3fbf2ee4e8f2d8bb9e28c5d08bbb84"
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "boto" do
|
2015-02-03 02:47:36 +00:00
|
|
|
url "https://pypi.python.org/packages/source/b/boto/boto-2.36.0.tar.gz"
|
|
|
|
sha1 "f230ff9b041d3b43244086e38b7b6029450898be"
|
2014-09-04 01:29:10 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "pyyaml" do
|
|
|
|
url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz"
|
|
|
|
sha1 "476dcfbcc6f4ebf3c06186229e8e2bd7d7b20e73"
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "paramiko" do
|
|
|
|
url "https://pypi.python.org/packages/source/p/paramiko/paramiko-1.11.0.tar.gz"
|
|
|
|
sha1 "fd925569b9f0b1bd32ce6575235d152616e64e46"
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "markupsafe" do
|
|
|
|
url "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.18.tar.gz"
|
|
|
|
sha1 "9fe11891773f922a8b92e83c8f48edeb2f68631e"
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "jinja2" do
|
|
|
|
url "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.1.tar.gz"
|
|
|
|
sha1 "a9b24d887f2be772921b3ee30a0b9d435cffadda"
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2014-11-18 07:32:45 +00:00
|
|
|
resource "pyasn1" do
|
|
|
|
url "https://pypi.python.org/packages/source/p/pyasn1/pyasn1-0.1.7.tar.gz"
|
|
|
|
sha1 "e32b91c5a5d9609fb1d07d8685a884bab22ca6d0"
|
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "python-keyczar" do
|
2014-11-18 07:32:45 +00:00
|
|
|
url "https://pypi.python.org/packages/source/p/python-keyczar/python-keyczar-0.71c.tar.gz"
|
|
|
|
sha1 "0ac1e85e05acac470029d1eaeece5c47d59fcc89"
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "pywinrm" do
|
2015-03-16 09:58:02 +00:00
|
|
|
url "https://pypi.python.org/packages/source/p/pywinrm/pywinrm-0.0.3.tar.gz"
|
|
|
|
sha1 "9b4f50e838b9222a101094328b0f6e8669ac17b7"
|
2014-10-15 11:28:03 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "isodate" do
|
|
|
|
url "https://pypi.python.org/packages/source/i/isodate/isodate-0.5.0.tar.gz"
|
|
|
|
sha1 "1174aeb482567df02933bdc6f6e7c2a9a72eb31e"
|
2014-10-15 11:28:03 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
resource "xmltodict" do
|
|
|
|
url "https://pypi.python.org/packages/source/x/xmltodict/xmltodict-0.9.0.tar.gz"
|
|
|
|
sha1 "06e4396e886133fdc0b10147c388ed82b0586c83"
|
2014-10-15 11:28:03 +00:00
|
|
|
end
|
|
|
|
|
2013-09-02 11:43:49 +00:00
|
|
|
def install
|
2014-11-07 06:25:23 +00:00
|
|
|
ENV["PYTHONPATH"] = libexec/"vendor/lib/python2.7/site-packages"
|
|
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-09-04 01:29:10 +00:00
|
|
|
res = %w[pycrypto boto pyyaml paramiko markupsafe jinja2]
|
2014-11-18 07:32:45 +00:00
|
|
|
res += %w[isodate xmltodict pywinrm] # windows support
|
|
|
|
res += %w[six requests websocket-client docker-py] # docker support
|
|
|
|
res += %w[pyasn1 python-keyczar] # accelerate support
|
2014-05-20 00:18:12 +00:00
|
|
|
res.each do |r|
|
2014-12-10 20:21:19 +00:00
|
|
|
resource(r).stage do
|
|
|
|
system "python", *Language::Python.setup_install_args(libexec/"vendor")
|
|
|
|
end
|
2014-01-04 13:01:30 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
inreplace "lib/ansible/constants.py" do |s|
|
2014-11-07 06:25:23 +00:00
|
|
|
s.gsub! "/usr/share/ansible", share/"ansible"
|
|
|
|
s.gsub! "/etc/ansible", etc/"ansible"
|
2013-09-03 09:13:20 +00:00
|
|
|
end
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-12-10 20:21:19 +00:00
|
|
|
system "python", *Language::Python.setup_install_args(libexec)
|
2014-05-01 16:08:37 +00:00
|
|
|
|
2014-10-15 11:29:54 +00:00
|
|
|
man1.install Dir["docs/man/man1/*.1"]
|
2014-11-07 06:25:23 +00:00
|
|
|
bin.install Dir["#{libexec}/bin/*"]
|
|
|
|
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
|
2013-09-02 11:43:49 +00:00
|
|
|
end
|
2013-10-18 23:51:59 +00:00
|
|
|
|
2014-01-04 13:01:30 +00:00
|
|
|
test do
|
2014-12-07 06:38:44 +00:00
|
|
|
ENV["ANSIBLE_REMOTE_TEMP"] = testpath/"tmp"
|
|
|
|
(testpath/"playbook.yml").write <<-EOF.undent
|
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
gather_facts: False
|
|
|
|
tasks:
|
|
|
|
- name: ping
|
|
|
|
ping:
|
|
|
|
EOF
|
|
|
|
(testpath/"hosts.ini").write("localhost ansible_connection=local\n")
|
|
|
|
system bin/"ansible-playbook", testpath/"playbook.yml", "-i", testpath/"hosts.ini"
|
2013-10-18 23:51:59 +00:00
|
|
|
end
|
2013-09-02 11:43:49 +00:00
|
|
|
end
|