# RPM BUILD procedure for ansible-core 2.14.1

**URL:** <https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [December 15, 2022, 6:47am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469 "2022-12-15T06:47:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathish\_subramani](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sathish\_subramani](https://forum.ansible.com/u/sathish_subramani)\
**Post date:** [December 15, 2022, 6:47am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/1 "2022-12-15T06:47:02Z")

</div>

Hi Team,

In older version of ansible till 2.9 we download ansible source tar from below Ansible URL

URL: [https://releases.ansible.com/ansible/](https://releases.ansible.com/ansible/)

**Step Followed:**

tar xvf ansible-2.8.3.tar.gz

cp ansible-2.8.3.tar.gz /root/rpmbuild/SOURCES/

cp ansible-2.8.3/packaging/rpm/ansible.spec /root/rpmbuild/SPECS/

rpmbuild -bb SPECS/ansible.spec

RPM will be available under /root/rpmbuild/RPMS/noarch/

Now we are planning to build RPM of ansible-core 2.14.1 for RHEL 8 migration project , we are seeing source available in below path and there is not RPM build procedure support.

[https://github.com/ansible/ansible/tree/v2.14.1](https://github.com/ansible/ansible/tree/v2.14.1)

Please guide procedure to build RPM for ansible-core 2.14.1.

Thanks and Regards,  
S Sathish

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [December 16, 2022, 11:42am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/2 "2022-12-16T11:42:49Z")

</div>

Stop. Grab my tools from https:/github.com/nkadel/ansiblerepo/ , and  
work from those for RHEL 7. If you have RHEL 8 or 9, use the upstream  
RPMs for ansible-core instead, and do \*not\* try to build the  
mislabeled ansible collections package, now published as "ansible",  
without reading my .spec files.

The split of ansible to "ansible-core", which actually contains usable  
ansible binaries and tools, and the mislabeled and very large  
"ansible" tarball built of more than 100 distinct ansible collections  
modules from many distinct third parties has been a source of agony  
for ansible users since it was first published. You need  
"ansible-core". Most of us have no use for the "ansible" package at  
all now, since its more than 100 modules can be installed more safely  
and far more compactly by only installing them if or when needed, and  
updated independently fro meach other.

I publish RPM building tools for RHEL 7, 8, 9, and Fedora over at  
[https://github.com/nkadel/ansiblerepo/](https://github.com/nkadel/ansiblerepo/) . If you have RHEL 8 or later,  
the published RPMs from Red Hat for ansible-coreare nearly as recent,  
but there is no upstream published "ansible" RPM for RHEL. You don't  
need it, and you probably don't want it, but my repo includes for  
building as recent a version as your RHEL can handle if you need. RHEL  
7 has a default of python 3.6 maximum. RHEL 8 and later have python  
3.10 available, and can use that for building current ansible-core and  
ansible releases.

---

<div class="post-metadata">

**Author:** ![sathish\_subramani](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sathish\_subramani](https://forum.ansible.com/u/sathish_subramani)\
**Post date:** [December 16, 2022, 11:52am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/3 "2022-12-16T11:52:28Z")

</div>

Hi Team,

we are using RHEL 8 , you have mentioned to use the upstream RPMs for ansible-core instead of build the RPMs.

can you provide link where we can use upstream RPMs for ansisble-core.2.14.1 version.

Thanks and Regards,  
S Sathish

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [December 17, 2022, 3:33am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/4 "2022-12-17T03:33:59Z")

</div>

> Hi Team,
> 
> we are using RHEL 8 , you have mentioned to use the upstream RPMs for ansible-core instead of build the RPMs.
> 
> can you provide link where we can use upstream RPMs for ansisble-core.2.14.1 version.
> 
> Thanks and Regards,  
> S Sathish

On CentOS, it is:

&nbsp;&nbsp;&nbsp;&nbsp;sudo dnf install -y ansible-core

It's in the "appstream" channel. I don't like the RHEL channels, but I  
believe that one is available by default? If not, you may have to use  
"subscription-manager" to enable the channel.

Nico Kadel-Garcia

---

<div class="post-metadata">

**Author:** ![sathish\_subramani](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sathish\_subramani](https://forum.ansible.com/u/sathish_subramani)\
**Post date:** [December 19, 2022, 1:11pm UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/5 "2022-12-19T13:11:14Z")

</div>

Hi Team,

We have checked ansible-core for RHEL8 comes from ansible-automation-platform Repo which is not part of our default subscription.

So we have decided to build the ansible-core 2.14.1 RPM for our deliverable from Opensource.

Please let us know procedure to do the same.

we have tried below procedure as per documentation it doesn’t work.

$ git clone [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git)  
$ cd ./ansible  
$ make rpm

**Error Message:**

[root@node1 ansible]# make rpm

make: \*\*\* No rule to make target ‘rpm’. Stop.

Thanks and Regards,S Sathish

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [December 19, 2022, 5:58pm UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/6 "2022-12-19T17:58:33Z")

</div>

> Hi Team,
> 
> We have checked ansible-core for RHEL8 comes from ansible-automation-platform Repo which is not part of our default subscription.
> 
> So we have decided to build the ansible-core 2.14.1 RPM for our deliverable from Opensource.

Check my notes at [https://github.com/nkadel/ansiblerepo/README.md](https://github.com/nkadel/ansiblerepo/README.md)  
ansible-core 2.14 requires python 3.8 or later, and a small stack of  
dependencies. My notes there use "mock" to build clean RPMs in a clean  
locally generated environment. I also have tools there to build the  
ansible package as well, and a set of individual ansible\_collections  
modules from Fedora.

> Please let us know procedure to do the same.
> 
> we have tried below procedure as per documentation it doesn't work.
> 
> $ git clone [https://github.com/ansible/ansible.git](https://github.com/ansible/ansible.git)  
> $ cd ./ansible  
> $ make rpm

Yeah, that's not going to work due to the missing python RPM  
dependencies and the lack of a local "make rpm" seutp.

---

<div class="post-metadata">

**Author:** ![sathish\_subramani](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sathish\_subramani](https://forum.ansible.com/u/sathish_subramani)\
**Post date:** [December 21, 2022, 12:38am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/7 "2022-12-21T00:38:03Z")

</div>

Hi Team,

As per below input we have gone through [https://github.com/nkadel/ansiblerepo/README.md](https://github.com/nkadel/ansiblerepo/README.md) for Building ansible. Installed mock package in RHEL 8 system and then performed below tasks in that make cfgs and repos are getting failed in the system with below error message.

Please check and advise on this.

[root@node1 ansible-core-2.14.x-srpm]# make getsrc  
spectool -g `ls *.spec`  
Getting [https://files.pythonhosted.org/packages/source/a/ansible-core/ansible-core-2.14.1.tar.gz](https://files.pythonhosted.org/packages/source/a/ansible-core/ansible-core-2.14.1.tar.gz) to ./ansible-core-2.14.1.tar.gz  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0  
100 13.3M 100 13.3M 0 0 34.8M 0 --:–:-- --:–:-- --:–:-- 338M  
[root@node1 ansible-core-2.14.x-srpm]# ls -lrt  
total 13708  
-rw-r–r–. 1 root root 14000906 Dec 6 21:35 ansible-core-2.14.1.tar.gz  
-rw-r–r–. 1 root root 5052 Dec 8 14:31 fix-tests-failing-on-pytest-7.patch  
-rw-r–r–. 1 root root 12704 Dec 8 14:31 ansible-core.spec  
-rw-r–r–. 1 root root 748 Dec 8 14:31 ansible-core-2.13.1-python3.patch  
-rw-r–r–. 1 root root 811 Dec 8 14:31 2.10.3-test-patch.patch  
lrwxrwxrwx. 1 root root 24 Dec 15 07:24 Makefile → …/Makefile.ansible8-f37  
[root@node1 ansible-core-2.14.x-srpm]# make cfgs  
make: \*\*\* No rule to make target ‘cfgs’. Stop.  
[root@node1 ansible-core-2.14.x-srpm]# make repos  
make: \*\*\* No rule to make target ‘repos’. Stop.

Thanks and Regards,  
S Sathish

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [December 21, 2022, 4:34am UTC](https://forum.ansible.com/t/rpm-build-procedure-for-ansible-core-2-14-1/37469/8 "2022-12-21T04:34:40Z")

</div>

> Hi Team,
> 
> As per below input we have gone through [https://github.com/nkadel/ansiblerepo/README.md](https://github.com/nkadel/ansiblerepo/README.md) for Building ansible. Installed mock package in RHEL 8 system and then performed below tasks in that make cfgs and repos are getting failed in the system with below error message.
> 
> Please check and advise on this.

You need to run these commands at the top of the git repo, in  
"ansiblerepo". It needs to build up the dependency chain, including a  
local git repo to use for mock based builds.

Nico Kadel-Garcia
