@@ -126,8 +126,10 @@ bundle agent cfengine_build_host_setup
126126 "xfsprogs";
127127
128128# note that shellcheck, fakeroot and ccache require epel-release to be installed
129- (redhat|centos).(yum_dnf_conf_ok)::
130- "epel-release";
129+ !(redhat_8|centos_8).(redhat|centos).(yum_dnf_conf_ok)::
130+ "epel-release"
131+ comment => "centos-8/rhel-8 at least in AWS has no epel-release package to install so later we will install with downloaded rpm from dl.fedoraproject.org";
132+
131133 !(redhat_7|centos_7|redhat_8|centos_8).(yum_dnf_conf_ok)::
132134 "fail2ban"
133135 comment => "Ban IPs with repeated failed SSH auth attempts";
@@ -139,7 +141,6 @@ bundle agent cfengine_build_host_setup
139141 "ccache";
140142 "fakeroot";
141143 "perl-JSON-PP";
142- "perl-Data-Dumper";
143144 "perl-Digest-MD5";
144145
145146 (redhat_7|centos_7|redhat_9|redhat_10).(yum_dnf_conf_ok)::
@@ -217,6 +218,11 @@ bundle agent cfengine_build_host_setup
217218 "yum_conf_ok" expression => "any"; # rhel/centos-6 and 7 do not support --nobest or best property in yum.conf
218219 redhat_8|centos_8::
219220 "have_fakeroot" expression => returnszero("command -v fakeroot >/dev/null", "useshell");
221+ "epel_release_installed" expression => returnszero("yum info --installed epel-release", "useshell");
222+ (redhat_8|centos_8).have_perl::
223+ "have_data_dumper" expression => returnszero("cpan -l | grep Data::Dumper", "useshell");
224+ "have_data_dumper_names" expression => returnszero("cpan -l | grep Data::Dumper::Names", "useshell");
225+ "have_padwalker" expression => returnszero("cpan -l | grep PadWalker", "useshell");
220226 redhat_8|centos_8|redhat_9|redhat_10::
221227 "redhat_has_python3" expression => returnszero("command -v python3 >/dev/null", "useshell");
222228 "dnf_conf_ok" expression => returnszero("grep best=False /etc/dnf/dnf.conf >/dev/null", "useshell");
@@ -248,6 +254,19 @@ bundle agent cfengine_build_host_setup
248254 (redhat_8|centos_8).!have_fakeroot:: # special fakeroot, missing from _8 an d up?
249255 "sudo rpm -iv https://kojipkgs.fedoraproject.org//packages/fakeroot/1.23/1.fc29/x86_64/fakeroot-1.23-1.fc29.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/fakeroot/1.23/1.fc29/x86_64/fakeroot-libs-1.23-1.fc29.x86_64.rpm"
250256 contain => in_shell;
257+ (redhat_8|centos_8).!epel_release_installed::
258+ "yum install --assumeyes https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm"
259+ comment => "TODO: check a sha for the epel-release-latest-8.noarch.rpm file",
260+ contain => in_shell;
261+ (redhat_8|centos_8).!have_data_dumper.have_perl::
262+ "cpan Data::Dumper"
263+ contain => in_shell;
264+ (redhat_8|centos_8).!have_data_dumper_names.have_perl::
265+ "cpan Data::Dumper::Names"
266+ contain => in_shell;
267+ (redhat_8|centos_8).!have_padwalker.have_perl::
268+ "cpan PadWalker"
269+ contain => in_shell;
251270 (redhat_8|centos_8|redhat_9|redhat_10).!redhat_has_python3::
252271 "yum install -y python3" -> { "CFE-4313" }
253272 contain => in_shell,
@@ -360,6 +379,7 @@ jenkins_builds ALL=NOPASSWD: /usr/bin/podman
360379 contain => in_shell;
361380 (redhat_8|centos_8|redhat_9|redhat_10).(!have_perl_package_installed).(yum_dnf_conf_ok)::
362381 "yum install -y perl" contain => in_shell,
382+ classes => results( "bundle", "have_perl" ),
363383 comment => "even though rhel8/9 come with /bin/perl perl >= 5.8.8 is needed by cfbuild-lcov-1.16-1.noarch. So the package must be installed.";
364384 redhat_9|redhat_10.!have_python3_pip_package_installed.(yum_dnf_conf_ok)::
365385 "yum install -y python3-pip" contain => in_shell;
0 commit comments