From 83d1028a2146c14e6877acd484d3d1dbc47d738d Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 27 Aug 2012 23:06:39 -0400 Subject: [PATCH 1/2] - Makefile now works with freebsd (date command options are diff) date still issues warning and ignores TZ - Updated tests to work inside bsd jails (127 addresses are an issue) Signed-off-by: Brian Coca --- Makefile | 8 +++++++- test/TestPlayBook.py | 2 +- test/TestRunner.py | 6 +++--- test/ansible_hosts | 2 +- test/assemble.d/01-source.txt | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 38c8e4493d6..a8aa8250bb2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ #!/usr/bin/make - +# WARN: gmake syntax ######################################################## # Makefile for Ansible # @@ -15,6 +15,7 @@ # variable section NAME = "ansible" +OS = $(shell uname -s) # Manpages are currently built with asciidoc -- would like to move to markdown # This doesn't evaluate until it's called. The -D argument is the @@ -32,7 +33,12 @@ VERSION := $(shell cat VERSION) ifneq ($(shell which git),) GIT_DATE := $(shell git log -n 1 --format="%ai") endif + +ifeq ($(OS), FreeBSD) +DATE := $(shell date -j -f "%Y-%m-%d %H:%M:%s" "$(GIT_DATE)" +%Y%m%d%H%M) +else DATE := $(shell date --date="$(GIT_DATE)" +%Y%m%d%H%M) +endif # RPM build parameters RPMSPECDIR= packaging/rpm diff --git a/test/TestPlayBook.py b/test/TestPlayBook.py index 85ee178fb1f..87f27910b89 100644 --- a/test/TestPlayBook.py +++ b/test/TestPlayBook.py @@ -137,7 +137,7 @@ class TestPlaybook(unittest.TestCase): print "**ACTUAL**" print utils.jsonify(actual, format=True) expected = { - "127.0.0.2": { + "localhost": { "changed": 9, "failures": 0, "ok": 11, diff --git a/test/TestRunner.py b/test/TestRunner.py index 44f358420cc..6f6b5189388 100644 --- a/test/TestRunner.py +++ b/test/TestRunner.py @@ -71,8 +71,8 @@ class TestRunner(unittest.TestCase): # when using nosetests this will only show up on failure # which is pretty useful print "RESULTS=%s" % results - assert "127.0.0.2" in results['contacted'] - return results['contacted']['127.0.0.2'] + assert "localhost" in results['contacted'] + return results['contacted']['localhost'] def test_ping(self): result = self._run('ping', []) @@ -193,7 +193,7 @@ class TestRunner(unittest.TestCase): def test_fetch(self): input_ = self._get_test_file('sample.j2') - output = os.path.join(self.stage_dir, '127.0.0.2', input_) + output = os.path.join(self.stage_dir, 'localhost', input_) result = self._run('fetch', [ "src=%s" % input_, "dest=%s" % self.stage_dir ]) assert os.path.exists(output) assert open(input_).read() == open(output).read() diff --git a/test/ansible_hosts b/test/ansible_hosts index bff3d17c4be..94074edc3cc 100644 --- a/test/ansible_hosts +++ b/test/ansible_hosts @@ -1,2 +1,2 @@ [somegroup] -127.0.0.2 +localhost diff --git a/test/assemble.d/01-source.txt b/test/assemble.d/01-source.txt index fc88cb924e9..099d99e1686 100644 --- a/test/assemble.d/01-source.txt +++ b/test/assemble.d/01-source.txt @@ -1,2 +1,2 @@ # This is the second comment. -127.0.0.2 +localhost From a9cc24dcd54e0d9dc9606f4a522451fa013d4610 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 28 Aug 2012 13:21:54 -0400 Subject: [PATCH 2/2] added freebsd ports package Signed-off-by: Brian Coca --- packaging/port/sysutils/ansible/Makefile | 23 +++++++++++++++++++++++ packaging/port/sysutils/ansible/pkg-descr | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 packaging/port/sysutils/ansible/Makefile create mode 100644 packaging/port/sysutils/ansible/pkg-descr diff --git a/packaging/port/sysutils/ansible/Makefile b/packaging/port/sysutils/ansible/Makefile new file mode 100644 index 00000000000..14ee5e5fdc9 --- /dev/null +++ b/packaging/port/sysutils/ansible/Makefile @@ -0,0 +1,23 @@ +# $FreeBSD$ + +PORTNAME= ansible +PORTVERSION= 0.6 +CATEGORIES= devel www textproc python +MASTER_SITES= https://github.com/downloads/ansible/ansible/ + +MAINTAINER= briancoca+ansible@gmail.com +COMMENT= Ansible ssh based config management framework + +RUN_DEPENDS= python>2.5:${PORTSDIR}/lang/python ${PORTSDIR}/devel/py-Jinja2 ${PORTSDIR}/devel/py-yaml \ + ${PORTSDIR}/security/py-paramiko ${PORTSDIR}/devel/py-simplejson + +FETCH_ARGS= -pRr + +USE_PYTHON= yes +USE_PYDISTUTILS= yes + +# extracts with github name + short hash, needs to be updated with new releases +#pre-configure: +# @${MV} ${WRKDIR}/ansible ${WRKSRC} + +.include diff --git a/packaging/port/sysutils/ansible/pkg-descr b/packaging/port/sysutils/ansible/pkg-descr new file mode 100644 index 00000000000..3c377016f4c --- /dev/null +++ b/packaging/port/sysutils/ansible/pkg-descr @@ -0,0 +1,4 @@ +Ansible is a radically simple model-driven configuration management, deployment, and command execution framework. + +Author: Michael DeHaan +WWW: http://ansible.github.com/