Ansible installation

49 views
Skip to first unread message

Ki-Hyun Sung

unread,
Nov 23, 2017, 9:51:21 PM11/23/17
to Ansible Project
Hi there,

I am trying to create my own Ansible rpm from the tarball.
I am on Centos 7, with asciidoc, epel-release and rpmbuild packages installed.

However I get this error when I try to 'make rpm' from the root of the extracted tarball (ansible version 2.4.0.0)

error: line 10: Illegal char '"' in: Release: 100.git201711240000"".el7.centos

Just wondering if anyone know what the issue is here?

I am also not familiar with rpm build, or Linux in general - any help would be much appreciated!

-Darren

Todd Zullinger

unread,
Nov 23, 2017, 10:42:02 PM11/23/17
to ansible...@googlegroups.com
Hi,

Ki-Hyun Sung wrote:
> I am trying to create my own Ansible rpm from the tarball.
> I am on Centos 7, with asciidoc, epel-release and rpmbuild packages
> installed.
>
> However I get this error when I try to 'make rpm' from the root of the
> extracted tarball (ansible version 2.4.0.0)
>
> *error: line 10: Illegal char '"' in: Release: 100.git201711240000"".el7.centos*
>
> Just wondering if anyone know what the issue is here?
>
> I am also not familiar with rpm build, or Linux in general - any help would
> be much appreciated!

It looks like the `make rpm` target is a bit broken by default. I
tested in a centos 7 docker container. I needed to install the
following packages to build:

asciidoc
epel-release
python2-devel
python2-jinja2
python-jinja2
python-setuptools
python-yaml
rpm-build

And to get around the error you mentioned, I had to pass OFFICIAL=yes
to the make command:

make OFFICIAL=yes rpm

Without OFFICIAL=yes, the Makefile uses 100.git$(DATE)$(GITINFO) as
the release tag. If git is not installed, it sets

GITINFO ""

If git is installed, then the Makefile sets

GITINFO = .$(GIT_HASH).$(GIT_BRANCH)

And from a tarball, this results in GITINFO = .., which is also
invalid in the release tag:

error: line 10: Illegal sequence ".." in: Release: 100.git201711240000...el7.centos

So I'd just build with 'make OFFICIAL=yes rpm'.

The Makefile seems like it needs several fixes to make this work as
documented. One is to drop the "" from GITINFO when git is not found:

--- Makefile~ 2017-11-24 03:32:55.848113798 +0000
+++ Makefile 2017-11-24 03:33:12.178749893 +0000
@@ -45,7 +45,7 @@
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/[-_.\/]//g')
GITINFO = .$(GIT_HASH).$(GIT_BRANCH)
else
-GITINFO = ""
+GITINFO =
endif

ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)

Fixing things if git is installed and 'make rpm' is run from a tarball
is more work than I'm looking to do tonight. It should likely test
whether .git exists and/or that both GIT_HASH and GIT_BRANCH are not
empty before using them to set GITNFO.

--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The power of accurate observation is frequently called cynicism by
those who don't have it.
-- George Bernard Shaw

Todd Zullinger

unread,
Nov 23, 2017, 11:06:00 PM11/23/17
to ansible...@googlegroups.com
I wrote:
> I needed to install the following packages to build:
>
> asciidoc
> epel-release
> python2-devel
> python2-jinja2

BTW, python2-jinja2 was a typo. It's just python-jinja2 in EL-7, as
listed below.

> python-jinja2
> python-setuptools
> python-yaml
> rpm-build

--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I cook with wine, sometimes I even add it to the food.
-- W.C. Fields

Ki-Hyun Sung

unread,
Nov 24, 2017, 12:48:42 AM11/24/17
to ansible...@googlegroups.com
Thanks a lot for that Todd!
The export=yes worked for me.

So does it mean that now I can take the resultant noarch rpm and use it to install ansible on other centos boxes, in a docker container etc?



Sent from my iPhone
> --
> You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/NTmpFBEr9Rg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20171124040544.GL3693%40zaya.teonanacatl.net.
> For more options, visit https://groups.google.com/d/optout.

Todd Zullinger

unread,
Nov 24, 2017, 12:20:12 PM11/24/17
to ansible...@googlegroups.com
Ki-Hyun Sung wrote:
> Thanks a lot for that Todd!
> The export=yes worked for me.
>
> So does it mean that now I can take the resultant noarch rpm and use
> it to install ansible on other centos boxes, in a docker container
> etc?

I would like to think so, but I can't vouch for the build process.
It's possible there are other, more subtle, bugs when using 'make rpm'
from the tarball.

If it were me, I'd use the officially provided rpm packages. At least
then, any bugs which are present are going to be seen by everyone and
are more likely to be found and fixed. :)

--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Originality is nothing but judicious plagiarism.
-- Voltaire

Reply all
Reply to author
Forward
0 new messages