diff --git a/Makefile b/Makefile
index 2095cf9ed2d..26e350dfb31 100644
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,36 @@
#!/usr/bin/make
NAME = "ansible"
+# This doesn't evaluate until it's called. The -D argument is the
+# directory of the target file ($@), kinda like `dirname`.
ASCII2MAN = a2x -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -D docs/html/man/ -d manpage -f xhtml
+# Space separated list of all the manpages we want to end up with.
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1
SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
+VERSION := $(shell cat VERSION)
+# These are for building the RPM.
RPMVERSION := $(shell awk '/Version/{print $$2; exit}' < ansible.spec | cut -d "%" -f1)
RPMRELEASE := $(shell awk '/Release/{print $$2; exit}' < ansible.spec | cut -d "%" -f1)
-RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)"
+RPMDIST = $(shell rpm --eval '%dist')
+RPMNVR = "$(NAME)-$(RPMVERSION)-$(RPMRELEASE)$(RPMDIST)"
all: clean python
tests:
PYTHONPATH=./lib nosetests -v
+# To force a rebuild of the docs run 'touch VERSION && make docs'
docs: $(MANPAGES)
-%.1: %.1.asciidoc
- $(ASCII2MAN)
+# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more
+# recently than %.1.asciidoc.
+%.1.asciidoc: %.1.asciidoc.in
+ sed "s/%VERSION%/$(VERSION)/" $< > $@
-%.5: %.5.asciidoc
+# Regenerate %.1 if %.1.asciidoc or VERSION has been modified more
+# recently than %.1. (Implicitly runs the %.1.asciidoc recipe)
+%.1: %.1.asciidoc VERSION
$(ASCII2MAN)
loc:
@@ -36,19 +47,20 @@ pyflakes:
clean:
@echo "Cleaning up distutils stuff"
- -rm -rf build
- -rm -rf dist
+ rm -rf build
+ rm -rf dist
@echo "Cleaning up byte compiled python stuff"
- find . -regex ".*\.py[co]$$" -delete
+ find . -type f -regex ".*\.py[co]$$" -delete
@echo "Cleaning up editor backup files"
find . -type f \( -name "*~" -or -name "#*" \) -delete
find . -type f \( -name "*.swp" \) -delete
@echo "Cleaning up asciidoc to man transformations and results"
find ./docs/man -type f -name "*.xml" -delete
+ find ./docs/man -type f -name "*.asciidoc" -delete
@echo "Cleaning up output from test runs"
- -rm -rf test/test_data
+ rm -rf test/test_data
@echo "Cleaning up RPM building stuff"
- -rm -rf MANIFEST rpm-build
+ rm -rf MANIFEST rpm-build
python:
python setup.py build
@@ -90,6 +102,3 @@ rpm: rpmcommon
@echo "Ansible RPM is built:"
@echo " rpm-build/noarch/$(RPMNVR).noarch.rpm"
@echo "#############################################"
-
-.PHONEY: docs manual clean pep8
-vpath %.asciidoc docs/man/man1
diff --git a/VERSION b/VERSION
new file mode 100644
index 00000000000..7bcd0e3612d
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.0.2
\ No newline at end of file
diff --git a/ansible.spec b/ansible.spec
index 2a1d366d0db..4229d12f880 100644
--- a/ansible.spec
+++ b/ansible.spec
@@ -1,40 +1,44 @@
+%if 0%{?rhel} <= 5
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+%endif
Name: ansible
Release: 1%{?dist}
Summary: Minimal SSH command and control
Version: 0.0.2
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Group: Development/Libraries
License: GPLv3
-Prefix: %{_prefix}
Source0: https://github.com/downloads/ansible/ansible/%{name}-%{version}.tar.gz
Url: http://ansible.github.com
BuildArch: noarch
-BuildRequires: asciidoc
-BuildRequires: python-devel
+BuildRequires: python2-devel
Requires: python-paramiko
Requires: python-jinja2
%description
-Ansible is a extra-simple tool/API for doing 'parallel remote things' over SSH
-executing commands, running "modules", or executing larger 'playbooks' that
-can serve as a configuration management or deployment system.
+
+Ansible is a radically simple model-driven configuration management,
+multi-node deployment, and remote task execution system. Ansible works
+over SSH and does not require any software or daemons to be installed
+on remote nodes. Extension modules can be written in any language and
+are transferred to managed machines automatically.
+
%prep
-%setup -q -n %{name}-%{version}
+%setup -q
%build
-python setup.py build
+%{__python} setup.py build
%install
-python setup.py install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
+%{__python} setup.py install -O1 --root=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/ansible/
cp examples/hosts $RPM_BUILD_ROOT/etc/ansible/
-mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
+mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
cp -v docs/man/man1/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1/
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/ansible
cp -v library/* $RPM_BUILD_ROOT/%{_datadir}/ansible/
@@ -43,14 +47,13 @@ cp -v library/* $RPM_BUILD_ROOT/%{_datadir}/ansible/
rm -rf $RPM_BUILD_ROOT
%files
-%doc README.md PKG-INFO
%defattr(-,root,root)
-%{_mandir}/man1/*.gz
-%{python_sitelib}/*
+%{python_sitelib}/ansible*
%{_bindir}/ansible*
-%{_datadir}/ansible/*
-%config(noreplace) /etc/ansible/hosts
-%config(noreplace) %{_sysconfdir}/ansible/
+%{_datadir}/ansible
+%config(noreplace) %{_sysconfdir}/ansible
+%doc README.md PKG-INFO
+%doc %{_mandir}/man1/ansible*
%changelog
diff --git a/docs/man/.gitignore b/docs/man/.gitignore
index 6722cd96e78..81a33679397 100644
--- a/docs/man/.gitignore
+++ b/docs/man/.gitignore
@@ -1 +1,2 @@
*.xml
+*.asciidoc
diff --git a/docs/man/man1/ansible-playbook.1 b/docs/man/man1/ansible-playbook.1
index 5fb260bb0cd..1642966af37 100644
--- a/docs/man/man1/ansible-playbook.1
+++ b/docs/man/man1/ansible-playbook.1
@@ -1,13 +1,22 @@
'\" t
.\" Title: ansible-playbook
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2
-.\" Date: 04/16/2012
+.\" Generator: DocBook XSL Stylesheets v1.76.1
+.\" Date: 04/17/2012
.\" Manual: System administration commands
.\" Source: Ansible 0.0.2
.\" Language: English
.\"
-.TH "ANSIBLE\-PLAYBOOK" "1" "04/16/2012" "Ansible 0\&.0\&.2" "System administration commands"
+.TH "ANSIBLE\-PLAYBOOK" "1" "04/17/2012" "Ansible 0\&.0\&.2" "System administration commands"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
diff --git a/docs/man/man1/ansible-playbook.1.asciidoc b/docs/man/man1/ansible-playbook.1.asciidoc.in
similarity index 98%
rename from docs/man/man1/ansible-playbook.1.asciidoc
rename to docs/man/man1/ansible-playbook.1.asciidoc.in
index 14d34710e71..1ebb0204f4f 100644
--- a/docs/man/man1/ansible-playbook.1.asciidoc
+++ b/docs/man/man1/ansible-playbook.1.asciidoc.in
@@ -2,7 +2,7 @@ ansible-playbook(1)
===================
:doctype:manpage
:man source: Ansible
-:man version: 0.0.2
+:man version: %VERSION%
:man manual: System administration commands
NAME
diff --git a/docs/man/man1/ansible.1 b/docs/man/man1/ansible.1
index 550415ada06..057bad2c7d0 100644
--- a/docs/man/man1/ansible.1
+++ b/docs/man/man1/ansible.1
@@ -1,13 +1,22 @@
'\" t
.\" Title: ansible
.\" Author: [see the "AUTHOR" section]
-.\" Generator: DocBook XSL Stylesheets v1.75.2
-.\" Date: 04/16/2012
+.\" Generator: DocBook XSL Stylesheets v1.76.1
+.\" Date: 04/17/2012
.\" Manual: System administration commands
.\" Source: Ansible 0.0.2
.\" Language: English
.\"
-.TH "ANSIBLE" "1" "04/16/2012" "Ansible 0\&.0\&.2" "System administration commands"
+.TH "ANSIBLE" "1" "04/17/2012" "Ansible 0\&.0\&.2" "System administration commands"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -25,7 +34,7 @@ ansible \- run a command somewhere else
ansible [\-f forks] [\-m module_name] [\-a args]
.SH "DESCRIPTION"
.sp
-\fBAnsible\fR is an extra\-simple tool/framework/API for doing \'remote things\' over SSH\&.
+\fBAnsible\fR is an extra\-simple tool/framework/API for doing \*(Aqremote things\*(Aq over SSH\&.
.SH "ARGUMENTS"
.PP
\fBhost\-pattern\fR
@@ -63,7 +72,7 @@ to load modules from\&. The default is
\fI/usr/share/ansible\fR\&.
.RE
.PP
-\fB\-a\fR \'\fIARGUMENTS\fR\', \fB\-\-args=\fR\'\fIARGUMENTS\fR\'
+\fB\-a\fR \*(Aq\fIARGUMENTS\fR\*(Aq, \fB\-\-args=\fR\*(Aq\fIARGUMENTS\fR\*(Aq
.RS 4
The
\fIARGUMENTS\fR
diff --git a/docs/man/man1/ansible.1.asciidoc b/docs/man/man1/ansible.1.asciidoc.in
similarity index 99%
rename from docs/man/man1/ansible.1.asciidoc
rename to docs/man/man1/ansible.1.asciidoc.in
index a32cbde4534..2e43f64f198 100644
--- a/docs/man/man1/ansible.1.asciidoc
+++ b/docs/man/man1/ansible.1.asciidoc.in
@@ -2,7 +2,7 @@ ansible(1)
=========
:doctype:manpage
:man source: Ansible
-:man version: 0.0.2
+:man version: %VERSION%
:man manual: System administration commands
NAME
diff --git a/hacking/README b/hacking/README
index dd7abbd4fed..c3772269cdb 100644
--- a/hacking/README
+++ b/hacking/README
@@ -6,6 +6,3 @@ To use it from the root of a checkout:
$ . ./hacking/env-setup
Note the space between the '.' and the './'
-
-Man pages will not load until you run 'make docs' from the root of the
-checkout.
diff --git a/hacking/env-setup b/hacking/env-setup
index 2802730b312..b153862a940 100755
--- a/hacking/env-setup
+++ b/hacking/env-setup
@@ -4,14 +4,17 @@
PREFIX_PYTHONPATH="$PWD/lib"
PREFIX_PATH="$PWD/bin"
+PREFIX_MANPATH="$PWD/docs/man"
export PYTHONPATH=$PREFIX_PYTHONPATH:$PYTHONPATH
export PATH=$PREFIX_PATH:$PATH
export ANSIBLE_LIBRARY="$PWD/library"
+export MANPATH=$PREFIX_MANPATH:$MANPATH
echo "PATH=$PATH"
echo "PYTHONPATH=$PYTHONPATH"
echo "ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY"
+echo "MANPATH=$MANPATH"
-echo "reminder: specify your host file with -i"
-echo "done."
+echo "Reminder: specify your host file with -i"
+echo "Done."
diff --git a/library/virt b/library/virt
index 85e88228d1b..e2dee4c182d 100755
--- a/library/virt
+++ b/library/virt
@@ -10,8 +10,7 @@ This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+along with this program. If not, see .
"""
VIRT_FAILED = 1