From 38128c4720f664347604ef92bfa6927c21fbbf0d Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 13 Apr 2012 15:10:29 -0400 Subject: [PATCH 1/8] Remove asciidoc builddep --- ansible.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible.spec b/ansible.spec index 2a1d366d0d..3ad6138a9f 100644 --- a/ansible.spec +++ b/ansible.spec @@ -13,7 +13,6 @@ Source0: https://github.com/downloads/ansible/ansible/%{name}-%{version}.tar.gz Url: http://ansible.github.com BuildArch: noarch -BuildRequires: asciidoc BuildRequires: python-devel Requires: python-paramiko From c9ab5ebc6bb9c7f3293b12cd9fd85e69e1844f91 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 13 Apr 2012 15:10:45 -0400 Subject: [PATCH 2/8] Fix FSF address in virt header. --- library/virt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/virt b/library/virt index 85e88228d1..e2dee4c182 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 From 9316a504c5d09519508ef7296c7c521534b00f87 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Fri, 13 Apr 2012 16:27:56 -0400 Subject: [PATCH 3/8] Fixup specfile --- ansible.spec | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ansible.spec b/ansible.spec index 3ad6138a9f..d2a85a0c77 100644 --- a/ansible.spec +++ b/ansible.spec @@ -1,19 +1,20 @@ +%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: python-devel +BuildRequires: python2-devel Requires: python-paramiko Requires: python-jinja2 @@ -24,16 +25,16 @@ executing commands, running "modules", or executing larger 'playbooks' that can serve as a configuration management or deployment system. %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/ @@ -42,14 +43,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 From 2d26d1fd71b0b20f21da3a449ee9f9ba79c890fd Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Tue, 17 Apr 2012 10:31:29 -0400 Subject: [PATCH 4/8] Update %description and auto-add version to manpages Conflicts: docs/man/man1/ansible-playbook.1 docs/man/man1/ansible.1 Update %description --- Makefile | 7 ++++--- ansible.spec | 10 +++++++--- docs/man/.gitignore | 1 + docs/man/man1/ansible-playbook.1 | 15 ++++++++++++--- docs/man/man1/ansible-playbook.1.asciidoc | 2 +- docs/man/man1/ansible.1 | 19 ++++++++++++++----- docs/man/man1/ansible.1.asciidoc | 2 +- 7 files changed, 40 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 2095cf9ed2..6de5dd195f 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,10 @@ tests: docs: $(MANPAGES) -%.1: %.1.asciidoc - $(ASCII2MAN) +%.1.asciidoc.gen: %.1.asciidoc ansible.spec + sed "s/%VERSION%/$(RPMVERSION)/" $< > $@ -%.5: %.5.asciidoc +%.1: %.1.asciidoc.gen $(ASCII2MAN) loc: @@ -45,6 +45,7 @@ clean: 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 "*.gen" -delete @echo "Cleaning up output from test runs" -rm -rf test/test_data @echo "Cleaning up RPM building stuff" diff --git a/ansible.spec b/ansible.spec index d2a85a0c77..5280eed8c9 100644 --- a/ansible.spec +++ b/ansible.spec @@ -20,9 +20,13 @@ 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 diff --git a/docs/man/.gitignore b/docs/man/.gitignore index 6722cd96e7..ceb714c17d 100644 --- a/docs/man/.gitignore +++ b/docs/man/.gitignore @@ -1 +1,2 @@ *.xml +*.gen diff --git a/docs/man/man1/ansible-playbook.1 b/docs/man/man1/ansible-playbook.1 index 5fb260bb0c..1642966af3 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 index 14d34710e7..1ebb0204f4 100644 --- a/docs/man/man1/ansible-playbook.1.asciidoc +++ b/docs/man/man1/ansible-playbook.1.asciidoc @@ -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 550415ada0..057bad2c7d 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 index a32cbde453..2e43f64f19 100644 --- a/docs/man/man1/ansible.1.asciidoc +++ b/docs/man/man1/ansible.1.asciidoc @@ -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 From b4ca288a7b416966f78bc5a8d55cd4e4f967bf44 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Mon, 16 Apr 2012 14:11:57 -0400 Subject: [PATCH 5/8] Set %config(noreplace) on /etc/ansible instead of /etc/ansible/* so the directory is removed on uninstall and its contents are considered config files. --- ansible.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible.spec b/ansible.spec index 5280eed8c9..4229d12f88 100644 --- a/ansible.spec +++ b/ansible.spec @@ -51,7 +51,7 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/ansible* %{_bindir}/ansible* %{_datadir}/ansible -%config(noreplace) %{_sysconfdir}/ansible/* +%config(noreplace) %{_sysconfdir}/ansible %doc README.md PKG-INFO %doc %{_mandir}/man1/ansible* From d43cf592eb46b4ba1b52844dab4a117d7e8c9ba7 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Mon, 16 Apr 2012 15:43:21 -0400 Subject: [PATCH 6/8] Renaming asciidoc sources to .in. Change manpages to build from *.in and add comments about how the make targets work. --- Makefile | 11 ++++++++--- docs/man/.gitignore | 2 +- ...book.1.asciidoc => ansible-playbook.1.asciidoc.in} | 0 .../{ansible.1.asciidoc => ansible.1.asciidoc.in} | 0 4 files changed, 9 insertions(+), 4 deletions(-) rename docs/man/man1/{ansible-playbook.1.asciidoc => ansible-playbook.1.asciidoc.in} (100%) rename docs/man/man1/{ansible.1.asciidoc => ansible.1.asciidoc.in} (100%) diff --git a/Makefile b/Makefile index 6de5dd195f..79e7481aa1 100644 --- a/Makefile +++ b/Makefile @@ -14,12 +14,17 @@ all: clean python tests: PYTHONPATH=./lib nosetests -v +# To force a rebuild of the docs run 'touch ansible.spec && make docs' docs: $(MANPAGES) -%.1.asciidoc.gen: %.1.asciidoc ansible.spec +# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more +# recently than %.1.asciidoc. +%.1.asciidoc: %.1.asciidoc.in sed "s/%VERSION%/$(RPMVERSION)/" $< > $@ -%.1: %.1.asciidoc.gen +# Regenerate %.1 if %.1.asciidoc or ansible.spec has been modified +# more recently than %.1. (Implicitly runs the %.1.asciidoc recipe) +%.1: %.1.asciidoc ansible.spec $(ASCII2MAN) loc: @@ -45,7 +50,7 @@ clean: 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 "*.gen" -delete + find ./docs/man -type f -name "*.asciidoc" -delete @echo "Cleaning up output from test runs" -rm -rf test/test_data @echo "Cleaning up RPM building stuff" diff --git a/docs/man/.gitignore b/docs/man/.gitignore index ceb714c17d..81a3367939 100644 --- a/docs/man/.gitignore +++ b/docs/man/.gitignore @@ -1,2 +1,2 @@ *.xml -*.gen +*.asciidoc diff --git a/docs/man/man1/ansible-playbook.1.asciidoc b/docs/man/man1/ansible-playbook.1.asciidoc.in similarity index 100% rename from docs/man/man1/ansible-playbook.1.asciidoc rename to docs/man/man1/ansible-playbook.1.asciidoc.in diff --git a/docs/man/man1/ansible.1.asciidoc b/docs/man/man1/ansible.1.asciidoc.in similarity index 100% rename from docs/man/man1/ansible.1.asciidoc rename to docs/man/man1/ansible.1.asciidoc.in From 3f9a41b22deec67208372b098e30305c2c3e27e4 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Tue, 17 Apr 2012 10:39:36 -0400 Subject: [PATCH 7/8] Docs build using version in the VERSION file. Makefile upgraded with comments and some simplifications. Remove useless 'PHONEY' and 'VPATH' directives from Makefile --- Makefile | 31 +++++++++++++++++-------------- VERSION | 1 + 2 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 VERSION diff --git a/Makefile b/Makefile index 79e7481aa1..26e350dfb3 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +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 ansible.spec && make docs' +# To force a rebuild of the docs run 'touch VERSION && make docs' docs: $(MANPAGES) # Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more # recently than %.1.asciidoc. %.1.asciidoc: %.1.asciidoc.in - sed "s/%VERSION%/$(RPMVERSION)/" $< > $@ + sed "s/%VERSION%/$(VERSION)/" $< > $@ -# Regenerate %.1 if %.1.asciidoc or ansible.spec has been modified -# more recently than %.1. (Implicitly runs the %.1.asciidoc recipe) -%.1: %.1.asciidoc ansible.spec +# 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: @@ -41,10 +47,10 @@ 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 @@ -52,9 +58,9 @@ clean: 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 @@ -96,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 0000000000..7bcd0e3612 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.2 \ No newline at end of file From e9e8417735fa973a02278bed544f71dd36724333 Mon Sep 17 00:00:00 2001 From: Tim Bielawa Date: Tue, 17 Apr 2012 10:53:32 -0400 Subject: [PATCH 8/8] Update hacking with MANPATH. Correct hacking README details. --- hacking/README | 3 --- hacking/env-setup | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hacking/README b/hacking/README index dd7abbd4fe..c3772269cd 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 2802730b31..b153862a94 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."