RPM BUILD procedure for ansible-core 2.14.1

345 views
Skip to first unread message

sathish subramani

unread,
Dec 15, 2022, 1:47:03 AM12/15/22
to Ansible Project

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


Nico Kadel-Garcia

unread,
Dec 16, 2022, 6:43:17 AM12/16/22
to ansible...@googlegroups.com
On Thu, Dec 15, 2022 at 1:48 AM sathish subramani
<ssathi...@gmail.com> wrote:
>
> 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/

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.

sathish subramani

unread,
Dec 16, 2022, 6:52:29 AM12/16/22
to Ansible Project
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

Nico Kadel-Garcia

unread,
Dec 16, 2022, 10:34:23 PM12/16/22
to ansible...@googlegroups.com
On Fri, Dec 16, 2022 at 6:52 AM sathish subramani
<ssathi...@gmail.com> wrote:
>
> 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
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/eb194da9-778f-4e46-9327-844663dd040fn%40googlegroups.com.

sathish subramani

unread,
Dec 19, 2022, 8:11:15 AM12/19/22
to Ansible Project
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

Nico Kadel-Garcia

unread,
Dec 19, 2022, 12:58:56 PM12/19/22
to ansible...@googlegroups.com
On Mon, Dec 19, 2022 at 8:11 AM sathish subramani
<ssathi...@gmail.com> wrote:
>
> 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.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/171c5c2d-e292-407f-aedf-04949a4e870an%40googlegroups.com.

sathish subramani

unread,
Dec 20, 2022, 7:38:03 PM12/20/22
to Ansible Project
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

Nico Kadel-Garcia

unread,
Dec 20, 2022, 11:35:09 PM12/20/22
to ansible...@googlegroups.com
On Tue, Dec 20, 2022 at 7:38 PM sathish subramani
<ssathi...@gmail.com> wrote:
>
> 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
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/797e55a3-badd-498e-9bfc-cf87b883c755n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages