# Ansible installation

**URL:** <https://forum.ansible.com/t/ansible-installation/26120>\
**Category:** Ansible Project\
**Created:** [November 24, 2017, 2:51am UTC](https://forum.ansible.com/t/ansible-installation/26120 "2017-11-24T02:51:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ki-Hyun\_Sung](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Ki-Hyun\_Sung](https://forum.ansible.com/u/Ki-Hyun_Sung)\
**Post date:** [November 24, 2017, 2:51am UTC](https://forum.ansible.com/t/ansible-installation/26120/1 "2017-11-24T02:51:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Todd\_Zullinger](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Todd\_Zullinger](https://forum.ansible.com/u/Todd_Zullinger)\
**Post date:** [November 24, 2017, 3:41am UTC](https://forum.ansible.com/t/ansible-installation/26120/2 "2017-11-24T03:41:45Z")

</div>

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:

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

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

&nbsp;&nbsp;&nbsp;&nbsp;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

&nbsp;&nbsp;&nbsp;&nbsp;GITINFO ""

If git is installed, then the Makefile sets

&nbsp;&nbsp;&nbsp;&nbsp;GITINFO = .$(GIT\_HASH).$(GIT\_BRANCH)

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

&nbsp;&nbsp;&nbsp;&nbsp;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  
&nbsp;&nbsp;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.

---

<div class="post-metadata">

**Author:** ![Todd\_Zullinger](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Todd\_Zullinger](https://forum.ansible.com/u/Todd_Zullinger)\
**Post date:** [November 24, 2017, 4:05am UTC](https://forum.ansible.com/t/ansible-installation/26120/3 "2017-11-24T04:05:44Z")

</div>

I wrote:

> I needed to install the following packages to build:
> 
> &nbsp;&nbsp;asciidoc  
> &nbsp;&nbsp;epel-release  
> &nbsp;&nbsp;python2-devel  
> &nbsp;&nbsp;python2-jinja2

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

---

<div class="post-metadata">

**Author:** ![Ki-Hyun\_Sung](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Ki-Hyun\_Sung](https://forum.ansible.com/u/Ki-Hyun_Sung)\
**Post date:** [November 24, 2017, 5:48am UTC](https://forum.ansible.com/t/ansible-installation/26120/4 "2017-11-24T05:48:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Todd\_Zullinger](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@Todd\_Zullinger](https://forum.ansible.com/u/Todd_Zullinger)\
**Post date:** [November 24, 2017, 5:19pm UTC](https://forum.ansible.com/t/ansible-installation/26120/5 "2017-11-24T17:19:58Z")

</div>

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. 🙂
