RPM BUILD procedure for ansible-core 2.14.1

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/

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

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

Thanks and Regards,
S Sathish

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

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

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:

    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

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
$ cd ./ansible
$ make rpm

Error Message:

[root@node1 ansible]# make rpm

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

Thanks and Regards,S Sathish

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

Hi Team,

As per below input we have gone through 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 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

Hi Team,

As per below input we have gone through 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