Initial official build for 9.3/8.9 - new role postgresql

fingerprint in config files managed by roles
Resolves:rhbz#2185062

ha_cluster - Add possibility to load SBD watchdog kernel modules
Resolves:rhbz#2185067

ha_cluster - support for resource and operation defaults
Resolves:rhbz#2185065

postgresql - [RFE] system role for PostgreSQL management
Resolves:rhbz#2151373

rhc - [RFE] New role for Red Hat subscription management, insights management [rhel-9.3.0]
Resolves:rhbz#2179026

ha_cluster - use pcs to setup qdevice certificates if available
Resolves:rhbz#2185066

spec: Remove doc fragments from vendored modules
Resolves:rhbz#2185002

use ansible-galaxy collection build/install instead of tar
Resolves:rhbz#2175324

rhc - RHC system role: activation key registration fails if system is already registered
Resolves:rhbz#2186218

selinux - failing test - sshd/tests_firewall_selinux.yml - No package matching 'firewalld' found available, installed or updated
Resolves:rhbz#2190501
This commit is contained in:
Rich Megginson 2023-04-06 14:11:23 -06:00
parent df519d40e3
commit 94fdbccf4d
9 changed files with 358 additions and 1409 deletions

70
.gitignore vendored
View File

@ -431,3 +431,73 @@
/network-1.11.2.tar.gz
/rhc-1.1.1.tar.gz
/community-general-6.4.0.tar.gz
/community-general-6.5.0.tar.gz
/auto-maintenance-40e904d40dcfb8b522c91e525b2a0da24f9ad7ea.tar.gz
/postfix-1.3.4.tar.gz
/selinux-1.5.7.tar.gz
/timesync-1.7.3.tar.gz
/kdump-1.2.7.tar.gz
/storage-1.9.7.tar.gz
/metrics-1.8.2.tar.gz
/tlog-1.2.12.tar.gz
/kernel_settings-1.1.13.tar.gz
/logging-1.11.6.tar.gz
/nbde_server-1.3.4.tar.gz
/certificate-1.1.10.tar.gz
/crypto_policies-1.2.8.tar.gz
/ssh-1.1.13.tar.gz
/ha_cluster-1.9.0.tar.gz
/vpn-1.5.4.tar.gz
/firewall-1.4.3.tar.gz
/podman-1.1.3.tar.gz
/ad_integration-1.0.3.tar.gz
/journald-1.0.1.tar.gz
/postgresql-1.0.0.tar.gz
/nbde_client-1.2.11.tar.gz
/ansible-sshd-v0.18.2.tar.gz
/postfix-1.3.5.tar.gz
/selinux-1.5.8.tar.gz
/timesync-1.7.4.tar.gz
/kdump-1.2.8.tar.gz
/network-1.11.3.tar.gz
/storage-1.9.8.tar.gz
/metrics-1.8.3.tar.gz
/tlog-1.2.13.tar.gz
/kernel_settings-1.1.14.tar.gz
/logging-1.11.7.tar.gz
/nbde_client-1.2.12.tar.gz
/crypto_policies-1.2.9.tar.gz
/ssh-1.1.14.tar.gz
/vpn-1.5.5.tar.gz
/firewall-1.4.4.tar.gz
/podman-1.1.4.tar.gz
/journald-1.0.2.tar.gz
/ansible-posix-1.5.2.tar.gz
/cockpit-1.4.4.tar.gz
/postgresql-1.0.1.tar.gz
/cockpit-1.4.5.tar.gz
/auto-maintenance-81f9d109236b6c46c229b196a4087424542f8b6d.tar.gz
/ad_integration-1.1.0.tar.gz
/postfix-1.3.6.tar.gz
/selinux-1.5.9.tar.gz
/timesync-1.7.5.tar.gz
/kdump-1.2.9.tar.gz
/metrics-1.8.4.tar.gz
/tlog-1.2.14.tar.gz
/kernel_settings-1.1.15.tar.gz
/nbde_server-1.3.5.tar.gz
/nbde_client-1.2.13.tar.gz
/certificate-1.1.11.tar.gz
/ssh-1.1.15.tar.gz
/ha_cluster-1.9.2.tar.gz
/vpn-1.5.6.tar.gz
/podman-1.1.5.tar.gz
/rhc-1.1.2.tar.gz
/journald-1.0.3.tar.gz
/postgresql-1.0.2.tar.gz
/community-general-6.6.0.tar.gz
/network-1.11.4.tar.gz
/ansible-sshd-v0.19.0.tar.gz
/auto-maintenance-3a0a698cb96e0fccf4d00b45e29414c28c1ab0a1.tar.gz
/auto-maintenance-f8932b3155a3cb7579a2b3c453578f7bee6bb837.tar.gz
/postgresql-1.0.3.tar.gz

View File

@ -1,6 +1,20 @@
Changelog
=========
[1.22.0-0.6] - 2023-05-04
----------------------------
### New Features
- [fingerprint in config files managed by roles](https://bugzilla.redhat.com/show_bug.cgi?id=2185062)
- [ha_cluster - Add possibility to load SBD watchdog kernel modules](https://bugzilla.redhat.com/show_bug.cgi?id=2185067)
- [ha_cluster - support for resource and operation defaults](https://bugzilla.redhat.com/show_bug.cgi?id=2185065)
- [postgresql - [RFE] system role for PostgreSQL management](https://bugzilla.redhat.com/show_bug.cgi?id=2151373)
### Bug Fixes
- none
[1.21.1] - 2023-03-16
----------------------------

21
ansible-packaging.inc Normal file
View File

@ -0,0 +1,21 @@
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
# This file is for maintaining the compatibility with macros and other
# functionality (generators) provided by ansible-packaging on Fedora.
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}
# ansible-galaxy is available by ansible-core on RHEL 8.6 and newer at buildtime.
%define ansible_collection_build() ansible-galaxy collection build
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
%define ansible_roles_dir %{_datadir}/ansible/roles
%define ansible_collections_dir %{_datadir}/ansible/collections/ansible_collections
# TODO: Officially deprecate this macro and add the following line to the macro
# def after the new approach has gotten more testing and adoption:
# %%{warn: %%{ansible_collection_files} is deprecated. Use %%files -f %%{ansible_collection_filelist} instead.}
%define ansible_collection_files %{shrink:
%{ansible_collections_dir}/%{collection_namespace}/
}
%define ansible_collection_filelist %{__ansible_builddir}/ansible_collection_files

View File

@ -1,9 +1,9 @@
Source801: https://galaxy.ansible.com/download/ansible-posix-1.5.1.tar.gz
Source901: https://galaxy.ansible.com/download/community-general-6.4.0.tar.gz
Source801: https://galaxy.ansible.com/download/ansible-posix-1.5.2.tar.gz
Source901: https://galaxy.ansible.com/download/community-general-6.6.0.tar.gz
Source902: https://galaxy.ansible.com/download/containers-podman-1.10.1.tar.gz
Provides: bundled(ansible-collection(ansible.posix)) = 1.5.1
Provides: bundled(ansible-collection(community.general)) = 6.4.0
Provides: bundled(ansible-collection(ansible.posix)) = 1.5.2
Provides: bundled(ansible-collection(community.general)) = 6.6.0
Provides: bundled(ansible-collection(containers.podman)) = 1.10.1
Source996: CHANGELOG.rst

View File

@ -1,15 +1,12 @@
# NOTE: Even though ansible-core is in 8.6, it is only available
# at *runtime*, not at *buildtime* - so we can't have
# ansible-core as a build_dep on RHEL8
%if 0%{?fedora} || 0%{?rhel} >= 9
%bcond_without ansible
# NOTE: ansible-core is in rhel-8.6 and newer, but not installable
# in buildroot as it depended on modular Python.
# It has been installable at buildtime in 8.8 and newer.
%if 0%{?fedora}
BuildRequires: ansible-packaging
%else
%if 0%{?rhel} >= 8
BuildRequires: ansible-core >= 2.11.0
%endif
%else
%bcond_with ansible
%endif
%bcond_with collection_artifact
@ -29,8 +26,8 @@ Name: linux-system-roles
%endif
Url: https://github.com/linux-system-roles
Summary: Set of interfaces for unified system management
Version: 1.21.1
Release: 2%{?dist}
Version: 1.22.0
Release: 0.6%{?dist}
License: GPLv3+ and MIT and BSD and Python
%global _pkglicensedir %{_licensedir}/%{name}
@ -45,24 +42,6 @@ License: GPLv3+ and MIT and BSD and Python
%global collection_version %{version}
# Helper macros originally from macros.ansible by Igor Raits <ignatenkobrain>
# On RHEL, not available, so we must define those macros locally
# On Fedora, provided by ansible-packager
# Not used (yet). Could be made to point to AH in RHEL - but what about CentOS Stream?
#%%{!?ansible_collection_url:%%define ansible_collection_url() https://galaxy.ansible.com/%%{collection_namespace}/%%{collection_name}}
%if 0%{?rhel}
Provides: ansible-collection(%{collection_namespace}.%{collection_name}) = %{collection_version}
%global ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/
%define ansible_roles_dir %{_datadir}/ansible/roles
%if %{without ansible}
# Untar and copy everything instead of galaxy-installing the built artifact when ansible is not available
%define ansible_collection_build() tar -cf %{collection_namespace}-%{collection_name}-%{version}.tar.gz .
%define ansible_collection_install() mkdir -p %{buildroot}%{ansible_collection_files}%{collection_name}; tar -xf %{collection_namespace}-%{collection_name}-%{version}.tar.gz --directory %{buildroot}%{ansible_collection_files}%{collection_name}
%else
%define ansible_collection_build() ansible-galaxy collection build
%define ansible_collection_install() ansible-galaxy collection install -n -p %{buildroot}%{_datadir}/ansible/collections %{collection_namespace}-%{collection_name}-%{version}.tar.gz
%endif
%endif
# be compatible with the usual Fedora Provides:
Provides: ansible-collection-%{collection_namespace}-%{collection_name} = %{collection_version}-%{release}
@ -107,83 +86,86 @@ Requires: (ansible-core >= 2.11.0 or ansible >= 2.9.0)
%%global rolestodir %%{?rolestodir} %%{roletodir%{1}}
}
%global mainid d6a8e0167e9ed8d089093b7ead1e298241b534e1
%global mainid f8932b3155a3cb7579a2b3c453578f7bee6bb837
Source: %{url}/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
# BEGIN AUTOGENERATED SOURCES
%global rolename1 postfix
%deftag 1 1.3.3
%deftag 1 1.3.6
%global rolename2 selinux
%deftag 2 1.5.6
%deftag 2 1.5.9
%global rolename3 timesync
%deftag 3 1.7.2
%deftag 3 1.7.5
%global rolename4 kdump
%deftag 4 1.2.6
%deftag 4 1.2.9
%global rolename5 network
%deftag 5 1.11.2
%deftag 5 1.11.4
%global rolename6 storage
%deftag 6 1.9.6
%deftag 6 1.9.8
%global rolename7 metrics
%deftag 7 1.8.1
%deftag 7 1.8.4
%global rolename8 tlog
%deftag 8 1.2.11
%deftag 8 1.2.14
%global rolename9 kernel_settings
%deftag 9 1.1.11
%deftag 9 1.1.15
%global rolename10 logging
%deftag 10 1.11.5
%deftag 10 1.11.7
%global rolename11 nbde_server
%deftag 11 1.3.3
%deftag 11 1.3.5
%global rolename12 nbde_client
%deftag 12 1.2.10
%deftag 12 1.2.13
%global rolename13 certificate
%deftag 13 1.1.9
%deftag 13 1.1.11
%global rolename14 crypto_policies
%deftag 14 1.2.7
%deftag 14 1.2.9
%global forgeorg15 https://github.com/willshersystems
%global repo15 ansible-sshd
%global rolename15 sshd
%deftag 15 v0.18.1
%deftag 15 v0.19.0
%global rolename16 ssh
%deftag 16 1.1.12
%deftag 16 1.1.15
%global rolename17 ha_cluster
%deftag 17 1.8.7
%deftag 17 1.9.2
%global rolename18 vpn
%deftag 18 1.5.3
%deftag 18 1.5.6
%global rolename19 firewall
%deftag 19 1.4.2
%deftag 19 1.4.4
%global rolename20 cockpit
%deftag 20 1.4.3
%deftag 20 1.4.5
%global rolename21 podman
%deftag 21 1.1.2
%deftag 21 1.1.5
%global rolename22 ad_integration
%deftag 22 1.0.2
%deftag 22 1.1.0
%global rolename23 rhc
%deftag 23 1.1.1
%deftag 23 1.1.2
%global rolename24 journald
%deftag 24 1.0.0
%deftag 24 1.0.3
%global rolename25 postgresql
%deftag 25 1.0.3
Source1: %{archiveurl1}
Source2: %{archiveurl2}
@ -209,14 +191,22 @@ Source21: %{archiveurl21}
Source22: %{archiveurl22}
Source23: %{archiveurl23}
Source24: %{archiveurl24}
Source25: %{archiveurl25}
# END AUTOGENERATED SOURCES
# Includes with definitions/tags that differ between RHEL and Fedora
Source2301: redhat_subscription.py
Source1001: extrasources.inc
%include %{SOURCE1001}
# Includes with ansible_collection_build/_install that differ between RHEL versions
Source1002: ansible-packaging.inc
%include %{SOURCE1002}
Source1003: vendoring-prep.inc
Source1004: vendoring-build.inc
Source995: CHANGELOG.md
BuildArch: noarch
@ -276,23 +266,11 @@ end
%prep
# BEGIN AUTOGENERATED SETUP
%setup -q -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -a15 -a16 -a17 -a18 -a19 -a20 -a21 -a22 -a23 -a24 -n %{getarchivedir 0}
%setup -q -a1 -a2 -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a13 -a14 -a15 -a16 -a17 -a18 -a19 -a20 -a21 -a22 -a23 -a24 -a25 -n %{getarchivedir 0}
# END AUTOGENERATED SETUP
%if 0%{?rhel}
# Untar vendored collection tarballs to corresponding directories
for file in %{SOURCE801} %{SOURCE901} %{SOURCE902}; do
if [[ "$(basename $file)" =~ ([^-]+)-([^-]+)-(.+).tar.gz ]]; then
ns=${BASH_REMATCH[1]}
name=${BASH_REMATCH[2]}
ver=${BASH_REMATCH[3]}
mkdir -p .external/$ns/$name
pushd .external/$ns/$name > /dev/null
tar xfz "$file"
popd > /dev/null
fi
done
%endif
# vendoring prep steps, if any
%include %{SOURCE1003}
declare -A ROLESTODIR=(%{rolestodir})
for rolename in %{rolenames}; do
@ -320,11 +298,12 @@ cd ../..
cd %{rolename15}
find -P tests examples -name \*.yml | while read file; do
sed -r -i -e "s/ansible-sshd/linux-system-roles.sshd/" \
sed -r -i -e "s/willshersystems:ansible-sshd/system_role:sshd/" \
-e "s/ansible-sshd/linux-system-roles.sshd/" \
-e "s/ willshersystems.sshd/ linux-system-roles.sshd/" "$file"
done
sed -r -i -e "s/ willshersystems.sshd/ linux-system-roles.sshd/" README.md
sed -r -i -e "s/min_ansible_version: 2.8/min_ansible_version: 2.9/" meta/main.yml
sed -r -i -e 's/min_ansible_version: 2.8/min_ansible_version: "2.9"/' meta/main.yml
cd ..
cd %{rolename7}
@ -340,115 +319,8 @@ if [ "$rolesdir" != "$realrolesdir" ]; then
fi
cd ..
%if 0%{?rhel}
# Unpack tar.gz to retrieve to be vendored modules and place them in the roles library.
# ansible.posix:
# - library:
# - Module selinux and seboolean for the selinux role
# - Module mount for the storage role
declare -A module_map=( ["selinux.py"]="selinux" ["seboolean.py"]="selinux" ["mount.py"]="storage" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/library ]; then
mkdir $role/library
fi
cp -pL .external/ansible/posix/plugins/modules/$module $role/library/$module
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' -e "s/ansible_collections.ansible.posix.plugins.module_utils/ansible.module_utils.${role}_lsr/" $role/library/$module
done
# ansible.posix:
# - module_utils:
# - Module_util mount for the storage role
module_map=( ["mount.py"]="storage" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/module_utils/${role}_lsr ]; then
mkdir -p $role/module_utils/${role}_lsr
fi
cp -pL .external/ansible/posix/plugins/module_utils/$module $role/module_utils/${role}_lsr/$module
done
# community.general:
# - library:
# - Module seport, sefcontext and selogin for the selinux role rolename2
# - Module ini_file for role tlog
# - rhc modules
module_map=( ["seport.py"]="selinux" ["sefcontext.py"]="selinux" ["selogin.py"]="selinux" ["ini_file.py"]="tlog"
["redhat_subscription.py"]="rhc" ["rhsm_release.py"]="rhc" ["rhsm_repository.py"]="rhc" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/library ]; then
mkdir $role/library
fi
# version 5.x seems to be broken?
moduledir=.external/community/general/plugins/modules
if [ ! -f $moduledir/$module ]; then
moduledir=.external/community/general/plugins/modules/system
fi
if [ ! -f $moduledir/$module ]; then
moduledir=.external/community/general/plugins/modules/files
fi
cp -pL $moduledir/$module $role/library/$module
ls -alrtF $role/library/$module
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' $role/library/$module
# Remove doc_fragments
sed -i '/^extends_documentation_fragment:/,/^[^ -]/{/^extends/d;/^[ -]/d}' $role/library/$module
done
# Fix until the updated redhat_subscription.py is in community.general
cp %{SOURCE2301} rhc/library/redhat_subscription.py
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' rhc/library/redhat_subscription.py
# Remove doc_fragments
sed -i '/^extends_documentation_fragment:/,/^[^ -]/{/^extends/d;/^[ -]/d}' rhc/library/redhat_subscription.py
# containers.podman:
# - library:
# - Module podman_container_info, podman_image and podman_play for the podman role
module_map=( ["podman_container_info.py"]="podman" ["podman_image.py"]="podman" ["podman_play.py"]="podman" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/library ]; then
mkdir $role/library
fi
moduledir=.external/containers/podman/plugins/modules
cp -pL $moduledir/$module $role/library/$module
ls -alrtF $role/library/$module
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' \
-e "s/ansible_collections.containers.podman.plugins.module_utils.podman/ansible.module_utils.${role}_lsr/" \
$role/library/$module
done
# containers.podman:
# - module_utils:
# - Module_util common for the podman role
module_map=( ["common.py"]="podman" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/module_utils/${role}_lsr ]; then
mkdir -p $role/module_utils/${role}_lsr
fi
cp -pL .external/containers/podman/plugins/module_utils/podman/$module $role/module_utils/${role}_lsr/$module
done
# remove the temporary .external directory after vendoring
rm -rf .external
# Replacing "linux-system-roles.rolename" with "rhel-system-roles.rolename" in each role
# Replacing "fedora.linux_system_roles." with "redhat.rhel_system_roles" in each role
# This is for the "roles calling other roles" case
# for podman, change the FQCN - using a non-FQCN module name doesn't seem to work,
# even for the legacy role format
# replace community.general for rhc
for rolename in %{rolenames}; do
find $rolename -type f -exec \
sed -e "s/linux-system-roles[.]${rolename}\\>/%{roleinstprefix}${rolename}/g" \
-e "s/fedora[.]linux_system_roles[.]/%{collection_namespace}.%{collection_name}./g" \
-e "s/containers[.]podman[.]/%{collection_namespace}.%{collection_name}./g" \
-e "s/community[.]general[.]/%{collection_namespace}.%{collection_name}./g" \
-i {} \;
done
%endif
# vendoring build steps, if any
%include %{SOURCE1004}
# Removing symlinks in tests/roles
for rolename in %{rolenames}; do
@ -470,14 +342,25 @@ rm %{rolename5}/tests/ensure_provider_tests.py
# Drop storage tests/scripts
rm -rf %{rolename6}/tests/scripts
# fix system_roles fingerprint in "external" roles
python3 lsr_fingerprint.py
# transform ambiguous #!/usr/bin/env python shebangs to python3 to stop brp-mangle-shebangs complaining
find -type f -executable -name '*.py' -exec \
sed -i -r -e '1s@^(#! */usr/bin/env python)(\s|$)@#\13\2@' '{}' +
%build
%if %{with html}
# HACK HACK HACK
# pandoc/asciidoc on rhel 8.9 does not like the journald README badge links
# remove all of the badge links from all README.md files
# in the first 14 lines of the file, remove any line that looks like a
# github action badge
# HACK HACK HACK
readmes=""
matchstr="actions/workflows/"
for role in %{rolenames}; do
sed -e "1,14 {\\,${matchstr},d; /\!\[/d}" -i $role/README.md
readmes="${readmes} $role/README.md"
done
sh md2html.sh $readmes
@ -487,7 +370,7 @@ mkdir .collections
%if 0%{?rhel}
# Convert the upstream collection readme to the downstream one
%{SOURCE998} lsr_role2collection/collection_readme.md
./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
%{python3} ./galaxy_transform.py "%{collection_namespace}" "%{collection_name}" "%{collection_version}" \
"Red Hat Enterprise Linux System Roles Ansible Collection" \
"https://linux-system-roles.github.io" \
"https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/administration_and_configuration_tasks_using_system_roles_in_rhel" \
@ -520,7 +403,7 @@ extra_mapping="--extra-mapping fedora.linux_system_roles:%{collection_namespace}
%else
extra_mapping=""
%endif
LANG=C.utf-8 LC_ALL=C.utf-8 python3 release_collection.py --galaxy-yml galaxy.yml \
LANG=C.utf-8 LC_ALL=C.utf-8 %{python3} release_collection.py --galaxy-yml galaxy.yml \
--src-path $(pwd) --dest-path $(pwd)/.collections $includes --force --no-update \
--src-owner %{name} --skip-git --skip-check --skip-changelog $extra_mapping --debug
@ -592,16 +475,20 @@ for role in %{rolenames}; do
"%{buildroot}%{_pkglicensedir}/$role.LICENSE"
fi
if [ -d "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/examples" ]; then
for file in "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/examples/"*.yml ; do
basename=$(basename "$file" .yml)
newname="$basename"
if [[ "$newname" != example-* ]]; then
newname="example-$newname"
for file in "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/examples/"* ; do
if [[ "$file" == *.yml ]]; then
basename=$(basename "$file" .yml)
newname="$basename"
if [[ "$newname" != example-* ]]; then
newname="example-$newname"
fi
if [[ "$newname" != *-playbook ]]; then
newname="${newname}-playbook"
fi
cp "$file" "%{buildroot}%{_pkgdocdir}/$role/${newname}.yml"
else
cp "$file" "%{buildroot}%{_pkgdocdir}/$role"
fi
if [[ "$newname" != *-playbook ]]; then
newname="${newname}-playbook"
fi
cp "$file" "%{buildroot}%{_pkgdocdir}/$role/${newname}.yml"
rm "$file"
done
if [ -f "%{buildroot}%{ansible_roles_dir}/%{roleinstprefix}$role/examples/inventory" ]; then
@ -615,7 +502,7 @@ for role in %{rolenames}; do
fi
done
rm %{buildroot}%{ansible_roles_dir}/%{roleinstprefix}*/semaphore
rm -f %{buildroot}%{ansible_roles_dir}/%{roleinstprefix}*/semaphore
rm -r %{buildroot}%{ansible_roles_dir}/%{roleinstprefix}*/molecule
rm -r %{buildroot}%{ansible_roles_dir}/%{roleinstprefix}*/.[A-Za-z]*
@ -758,6 +645,34 @@ find %{buildroot}%{ansible_roles_dir} -mindepth 1 -maxdepth 1 | \
%endif
%changelog
* Thu May 04 2023 Rich Megginson <rmeggins@redhat.com> - 1.22.0-0.6
- Resolves:rhbz#2185062 : fingerprint in config files managed by roles
- Resolves:rhbz#2185067 : ha_cluster - Add possibility to load SBD watchdog kernel modules
- Resolves:rhbz#2185065 : ha_cluster - support for resource and operation defaults
- Resolves:rhbz#2151373 : postgresql - [RFE] system role for PostgreSQL management
- Resolves:rhbz#2179026 : rhc - [RFE] New role for Red Hat subscription management, insights management [rhel-9.3.0]
- Resolves:rhbz#2185066 : ha_cluster - use pcs to setup qdevice certificates if available
- Resolves:rhbz#2185002 : spec: Remove doc fragments from vendored modules
- Resolves:rhbz#2175324 : use ansible-galaxy collection build/install instead of tar
- Resolves:rhbz#2186218 : rhc - RHC system role: activation key registration fails if system is already registered
- Resolves:rhbz#2190501 : selinux - failing test - sshd/tests_firewall_selinux.yml - No package matching 'firewalld' found available, installed or updated
* Wed May 3 2023 Rich Megginson <rmeggins@redhat.com> - 1.22.0-0.5
- fix issue with postgresql tests
* Tue May 2 2023 Rich Megginson <rmeggins@redhat.com> - 1.22.0-0.4
- fix issue with ha_cluster vendoring modprobe
- move vendoring into included files
* Thu Apr 27 2023 Rich Megginson <rmeggins@redhat.com> - 1.22.0-0.3
- fix issues in some tests with ANSIBLE_GATHERING=explicit
- add testing for fingerprints in config files
- fix podman jinja 2.7 issue
- sshd - skip firewall testing if not supported
* Thu Apr 6 2023 Rich Megginson <rmeggins@redhat.com> - 1.22.0-0.2
- initial 8.9/9.3
* Thu Apr 6 2023 Sergei Petrosian <spetrosi@redhat.com> - 1.21.1-2
- Resolves: rhbz#2185002 : Remove doc fragments from vendored modules
- Build collection artifact in the same directory on Fedora and RHEL

File diff suppressed because it is too large Load Diff

55
sources
View File

@ -1,28 +1,29 @@
SHA512 (ad_integration-1.0.2.tar.gz) = ef717a925e5f59391b0e09704e78aed68f03bc89862a2a5063943d46bbed51bda12e85bd4d59c0a332140adf475f64dd84f6b90bab07d2f0e316a5390b9a92f5
SHA512 (ansible-posix-1.5.1.tar.gz) = ca2cadb27c230bd2f921797fb61bbb97c578ddd5d782f04cbd232bba84d091102fee872e69ebcfa5fb5c90b0db4fd90c2f97268e43621b233aa5309e5a0f8802
SHA512 (ansible-sshd-v0.18.1.tar.gz) = e537160b69a1fe096b59a683acf7c5b1cd25b43d8666124da63b78a1664513d1bd3623cf94f2521347ca0a77448622cc329d215af4d2d67ccbe830cfee12befc
SHA512 (auto-maintenance-d6a8e0167e9ed8d089093b7ead1e298241b534e1.tar.gz) = a138b1e1192db8a913c5747b3c92455f41ab75e2c19351e58d69c698681d663c2b192b374934f3acb21a648162188e540fa3751f48b4c3aa0cc6378e745f47c6
SHA512 (certificate-1.1.9.tar.gz) = 97f1c81d587add9362a8006a3045f48ce321e99866be812fe8ec1e3a302eda03b12f456535288b167997508784b520c9ccb802025bb4089919d117ec2d0d8dbe
SHA512 (cockpit-1.4.3.tar.gz) = 9bc613ea4b1dc25831df3b1503ed6697d1b9fc6a61183cd4feb8a5c29568e1b60534d6b088d6a24f6ea773d44502b10090a92a4c344bf3c4150680095f5a5209
SHA512 (community-general-6.4.0.tar.gz) = 2c4a63b12af30d7bbe0db8560ae6c35d3952a4031c0bff9177fdcdae115982c83daf10c8c201deb8ac68623800254313445177da3a108dbf987001a4c2be2306
SHA512 (ad_integration-1.1.0.tar.gz) = 5e94a8af75867425493667b1d5b56706d2cb5e7b28ffe7e361e66e9245bd407cc9572d65f12dbbf1362b3eb7c78370485d0087720c64672fd4677d97714f6655
SHA512 (ansible-posix-1.5.2.tar.gz) = f99b8e33c6eb4a40903c85f8de093f3e714fecad6e0342d84aee33988220d8e55c7ac2d2a835f5c4d6a23d05cff6eda767e9f61e83cb1146a9ceadf7d1b16f18
SHA512 (ansible-sshd-v0.19.0.tar.gz) = 06103696ee1810a8cdbb7f26e0542e85e53c6b758dbc9d87e47a3fd024c8c7fb77b54934e227b0ece4712483d89d52b1e94b1ee5cb667e420261928e8e994b53
SHA512 (auto-maintenance-f8932b3155a3cb7579a2b3c453578f7bee6bb837.tar.gz) = ebae3911dd9d34bdafbe583d29c7aaa5d6eb082adc4a06dbca4cef68c2f37b86cd15d37255fa3e9675c142d8ff5d863d8b7df77b12e32ebad64965dd9d5cea3c
SHA512 (certificate-1.1.11.tar.gz) = e5b0b5070e97125f3ef8cd0f68bb6a309dba61f974d09e4be2410c4cd9bdfb6f619513cb34be1825c9e8a0bd1365e5f2987a750b255e117ac8dff0e290deb143
SHA512 (cockpit-1.4.5.tar.gz) = abe66beab3fe3692fe09c65fcb937a6d0fdea63df258dd469c3a235004e49b020f2d151a91b5acd59bc20717a80be765b16fee1057fbe978c3e3fb5d24da6c8d
SHA512 (community-general-6.6.0.tar.gz) = f62269029f3248e82c7bbfabdfac46a7782fd7b05c8b9e6ba50f4e7c41edfbe891908a588e6c7c10845cc7056107a4b0482d9b8c6e0159b64a6c0170a2a255a9
SHA512 (containers-podman-1.10.1.tar.gz) = 6b489058ae2c38124d0466bd7dccc28b4f36d00c37520399c7d36e1dddb6bc63358f74cccd511067c355364f83e95f3e5256ffb2f9b3dc9d925df0ff74fde77c
SHA512 (crypto_policies-1.2.7.tar.gz) = 3c47e46f49bfe6116b834cfc32f5242fe866074d8cbbc530ad1391980c8dea8dc418bc9372565cbdd46becbab97de7ed69b4ea425750add0925e279e80954b45
SHA512 (firewall-1.4.2.tar.gz) = 88ecce48eb84044c980e2320ea8e06053464e9385ee51b2c4022cdac9a48b18c3ba58b108ae7267decc27d6c991a0ec83f1b2aa0f6b719d93c18b9870663d6a7
SHA512 (ha_cluster-1.8.7.tar.gz) = e67ddfc6a63e88f2fa850caeadf4a060bc9147abb5020140028b96a7027bd0cdd1e89c0167ac481a1b6302ef36dbfec86e1a58ad0effebb4e14a76b26aa59182
SHA512 (journald-1.0.0.tar.gz) = e2af83530ae5e493c3d0833360c7e9fc43772757920b43e3d8b18093f2f98ab03e1ac9e91adbdd76490bb2b39b6e7a6c6b2f9c09d77d5d817676324634089cd5
SHA512 (kdump-1.2.6.tar.gz) = 2e0b8ef49970a43d1c64d55a688925e48733f29e8ee862b0c1f5b01572d6e330ca1de01f65412ea492598d2fb43bc4f9d860f29b45a56051b3a4599001b3536f
SHA512 (kernel_settings-1.1.11.tar.gz) = 70b6f851ab12af1bf6b7c95159a42c709c6d8a9d5673672cf2b77310cdea8288fe05d769c424681288bd711ca3f4f519f87caa726c7f0eb6543b7a0ee272a883
SHA512 (logging-1.11.5.tar.gz) = 8594d4fec3cc6d1fec9feb5a6a2929992f1774dd0c586ab45bcac9f41dc8e9f3d969e417ed855892c281d7c7b5fe29f3da9f5316660c6d268298621fa4ec937f
SHA512 (metrics-1.8.1.tar.gz) = c4373bc925b5b89f47d4abe23e576dba8c8043682e7cd0e564c87474c14e80e347f4fe3ce78ae15bd5eca525c1ab7b9079908651bcf52590fa789fe362453b28
SHA512 (nbde_client-1.2.10.tar.gz) = 3f9458cbf572bbaeca58a99db2e7613106e265a44082d470e31944d508a142954a9fd96bbb4ab9ba483fd1b1e8973b9c60ed6d00838f46acd57e3d3e1e54b293
SHA512 (nbde_server-1.3.3.tar.gz) = 41161f373dda9682796fa3d9940b9e0c39db030b6588c6313f1863c455f213335bb867ddea04bd4719c2d41aa54f0c79fa92e33403b35199f581cbccada4b59b
SHA512 (network-1.11.2.tar.gz) = 642c8d9158be816109d4a153b6c844e4276648d3ae253ff7225eaf19be24c0c494e8bbe3547097ed2def89d5d12d2cd464da4b4a0344e14f36fd4d419073bb5a
SHA512 (podman-1.1.2.tar.gz) = 627bdca8053a2e7b817f2c039dea3ce4a2ec1bf116a455ce812bd1d6f6fc01214a02d582a8789ffd6f8657c959fad773423000ef773fa47e314059a12a70aa6a
SHA512 (postfix-1.3.3.tar.gz) = 93cb2ec4764d5ea7922298194e5ed8613bac50a6646e4410bb608c8590e5f4a1b7aa3a6251bc9551ab3ba2033394a2700542f6377d9bf08676c8ee2b963710de
SHA512 (rhc-1.1.1.tar.gz) = 3cba735d52bee486068867b8881e4a627deb2d56bc408b1fe51af2289506abe379de2c61a0dbf7779af8b0f3963dd218971b8f1be0f0fdfec6ebbd487ffd111c
SHA512 (selinux-1.5.6.tar.gz) = 7467d3f048735151ab2f54949b8ef4af0e5a0a4b808558e0a4bc7bc2f6adcf1e2e4003d5709e3d6b6c4f75ebf2a6ac678e98fe46764e04d373efbd69d4b84afa
SHA512 (ssh-1.1.12.tar.gz) = b3041110726467bb9711babc2dd327622cacb31e3ba19f5f0036b538575ebe71b55521eb7f7e7cb6e5fc22ee230f2909c3eb2308ac163144c72422211f979d6d
SHA512 (storage-1.9.6.tar.gz) = a8de206da08fdc2ad467e493e3a601b72d3aa31133b7d2878ef3b920ad767ea7090b51518eea40de5b7b652fa68d11d14324beb62354956cacd8f6e9c05cc850
SHA512 (timesync-1.7.2.tar.gz) = 0410ef3934ca080f968253a6f5b655e5d7467808af0320f1eb3237eb758415010f8bfe74447ea949fe9d30af63f7b145c455c5485c12227768b8567bb89b024b
SHA512 (tlog-1.2.11.tar.gz) = 98240b3042ff3640a7eccedc4f8b2a99749b2507d7ff7588fa8a2f8cc1004433389b11f654ee5887039e427858eeb891bfd434131daa2bf62b4cd4678c0fe62b
SHA512 (vpn-1.5.3.tar.gz) = fcd0f3c5beaf96f9e07d968562753d2742b9ef32f95c42f1f1093f9de60e0c44772df35964ccc5db8ee0d720ed93f081a96c8e6fd2877b15c8cc1c7cfc451016
SHA512 (crypto_policies-1.2.9.tar.gz) = e8e5a1b3fdad448a59ac3bba451ebdacc757f2c59b779a5f7ed20c19aee79c323c48bf723f5be684eab522ec3ebae60defe5bf426d1cd6701b4efdc79669d72e
SHA512 (firewall-1.4.4.tar.gz) = 19a04369298e80accfaa57e9ca5c2c34b53e05ea78a1cecac46548d6440e54e19f0978742e5852aaf4516de4ccdfa22bb547f6623f05888cdef22df99155cab9
SHA512 (ha_cluster-1.9.2.tar.gz) = c491aae3e99eae0e4f71248ab2f21de0da18c371649d8421d663cd49aea47b845e7adea19c02d5728ca20cf9299eaed8783124abed617d865601ee373153f239
SHA512 (journald-1.0.3.tar.gz) = b7d3a33c16ee8aec11047f34d7d788c6bceb9fe6ef3b8a7d75eb9c461d72e40acb0c5c1e1f1cbe720e0fc530bf609789724295cddb7790eeaee7a850d09d6574
SHA512 (kdump-1.2.9.tar.gz) = b33927fd777a012d949a029ae827b914b26fdafdce8b92475d91f98e0ab445dc30461a1a5d964ec404f5e004e9c203923bdd654af39cae0aa46be70fa82c5935
SHA512 (kernel_settings-1.1.15.tar.gz) = dd74ce866357958a477dbbb84f95677224049135d5d245aeab979fde1da194b07d205a189526e3f0cb39e9c97b526e50eb46e19322289183f3b698fd02c8b4b1
SHA512 (logging-1.11.7.tar.gz) = 4628b0fe6799ed0cff1cabfef3492cebbd55f99cfceb2b2f0db1b47408d2bf497b309024f19522495e5f9562d88a0117839b8bb4d57a56b41a780ee06b6a4280
SHA512 (metrics-1.8.4.tar.gz) = 74a4ddc1133c437ea3fb49388bf73aef0d4a12ecf81a42aa5cc2f4bb85d1c984ec0d18db470f6fb32645d8542507876fee15c96486d21467eeeba91e57fd06df
SHA512 (nbde_client-1.2.13.tar.gz) = b35544ee32a6e0aa54985fbc1225f7e7ba124ecb89065545716a58edf6c7c54ef466aed2d3330a453720d3b4336195814abe831c175c10505ce134b43a202ab6
SHA512 (nbde_server-1.3.5.tar.gz) = 8e4730ea02ed3c85c2b2530b627cc0600251961556cd1c89872db6ca6420eec6aee6d016190fa99d4d1ebe118af3ea017d9c1646ed430ca9fa8a07f0839c1658
SHA512 (network-1.11.4.tar.gz) = 0984041cf312879a2c65690a481f87a5ced61df4e19e0c4775346461851e4a96753ebbde048ca84083b648ff09fea5bdb85e1a65d065cd03f7d1561d9debc312
SHA512 (podman-1.1.5.tar.gz) = dfe6e362f7d151eb8d92fe64bd67980d20d019475d3872d1ca353ef27acec1d055d1d53baf0e7f081b11077219db6405367f514092aa3687308756757bb41fd4
SHA512 (postfix-1.3.6.tar.gz) = 8409adb897e56663ebb5d149f539dfebd70135812fd164b3fa55af56b9601015d0f288448eb38e538b77a71e921719f956ddac9d3d95a46acd382560ac72752e
SHA512 (postgresql-1.0.3.tar.gz) = 8aa19cada6a9ac067cd070faee046106a3c93aef3a439973ffa7531442691ecef4150fe3b39684d60ba1f3b5f34319b67cba4df204677b358f34f046128c3813
SHA512 (rhc-1.1.2.tar.gz) = 18a59153859fca40c571acd114e8e94800cc784a7ff15e3867c2842e0006a66b525e6894954e0d38f86f35debfe768fd0ce6daa9435f80136c07ac8a786f986f
SHA512 (selinux-1.5.9.tar.gz) = df9e2c7594ae3b437b8eb2d0a83e3c0d996323af2f5d6509a01a1297fcf18b8f779cb8975c7cf3c2c8fbd6a391b6b8a2206cc38d16690bdb6c29c7187f1364c8
SHA512 (ssh-1.1.15.tar.gz) = 0901382d0c5859a797fb4d0191a50bf3cec36bfe141cdbc0a03bfaec0c565d180538b51d21c2f7cf763f788315a9392206a084e7cd026b77a7aa437cddefcf7d
SHA512 (storage-1.9.8.tar.gz) = c43e8aa29b8d44409c8409c08c87af80650928bb56497f6b04a9b6e0984c110a333e2c315ca640bfa20092216aa7d650b460681603226fe0857366016fab48c7
SHA512 (timesync-1.7.5.tar.gz) = 6a7ff71a6152e74706836ec32671f1d1dff46b675816e584aa2761acbb88874f6e62d892a74555c3534ba7851a114bef30a18f79620ec707d0829c46c3ce8a33
SHA512 (tlog-1.2.14.tar.gz) = 05b0e23c578b159895a41ec662e0a6a02654bfb966f335a698071635503caa0f27b682fac15aa1948933e2e039eebf1511b527479d92091c5a8edc6d66a19251
SHA512 (vpn-1.5.6.tar.gz) = f4c1fb07d92f9b27fbb846cdce2bb5e138f4e13a9c9bf3495947c8addc4b4fe0a011f0ee6062bff10d5281fbacd7235a0d91a99656d9fa76c5519245db2a7d95

103
vendoring-build.inc Normal file
View File

@ -0,0 +1,103 @@
# Unpack tar.gz to retrieve to be vendored modules and place them in the roles library.
# ansible.posix:
# - library:
# - Module selinux and seboolean for the selinux role
# - Module mount for the storage role
declare -A module_map=( ["selinux.py"]="selinux" ["seboolean.py"]="selinux" ["mount.py"]="storage" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/library ]; then
mkdir $role/library
fi
cp -pL .external/ansible/posix/plugins/modules/$module $role/library/$module
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' -e "s/ansible_collections.ansible.posix.plugins.module_utils/ansible.module_utils.${role}_lsr/" $role/library/$module
done
# ansible.posix:
# - module_utils:
# - Module_util mount for the storage role
module_map=( ["mount.py"]="storage" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/module_utils/${role}_lsr ]; then
mkdir -p $role/module_utils/${role}_lsr
fi
cp -pL .external/ansible/posix/plugins/module_utils/$module $role/module_utils/${role}_lsr/$module
done
# community.general:
# - library:
# - Module seport, sefcontext and selogin for the selinux role rolename2
# - Module ini_file for role tlog
# - rhc modules
# - ha_cluster uses modprobe
module_map=( ["seport.py"]="selinux" ["sefcontext.py"]="selinux" ["selogin.py"]="selinux" ["ini_file.py"]="tlog"
["redhat_subscription.py"]="rhc" ["rhsm_release.py"]="rhc" ["rhsm_repository.py"]="rhc"
["modprobe.py"]="ha_cluster" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/library ]; then
mkdir $role/library
fi
# version 5.x seems to be broken?
moduledir=.external/community/general/plugins/modules
if [ ! -f $moduledir/$module ]; then
moduledir=.external/community/general/plugins/modules/system
fi
if [ ! -f $moduledir/$module ]; then
moduledir=.external/community/general/plugins/modules/files
fi
cp -pL $moduledir/$module $role/library/$module
ls -alrtF $role/library/$module
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' $role/library/$module
# Remove doc_fragments
sed -i '/^extends_documentation_fragment:/,/^[^ -]/{/^extends/d;/^[ -]/d}' $role/library/$module
done
# containers.podman:
# - library:
# - Module podman_container_info, podman_image and podman_play for the podman role
module_map=( ["podman_container_info.py"]="podman" ["podman_image.py"]="podman" ["podman_play.py"]="podman" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/library ]; then
mkdir $role/library
fi
moduledir=.external/containers/podman/plugins/modules
cp -pL $moduledir/$module $role/library/$module
ls -alrtF $role/library/$module
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' \
-e "s/ansible_collections.containers.podman.plugins.module_utils.podman/ansible.module_utils.${role}_lsr/" \
$role/library/$module
done
# containers.podman:
# - module_utils:
# - Module_util common for the podman role
module_map=( ["common.py"]="podman" )
for module in "${!module_map[@]}"; do
role="${module_map[${module}]}"
if [ ! -d $role/module_utils/${role}_lsr ]; then
mkdir -p $role/module_utils/${role}_lsr
fi
cp -pL .external/containers/podman/plugins/module_utils/podman/$module $role/module_utils/${role}_lsr/$module
done
# remove the temporary .external directory after vendoring
rm -rf .external
# Replacing "linux-system-roles.rolename" with "rhel-system-roles.rolename" in each role
# Replacing "fedora.linux_system_roles." with "redhat.rhel_system_roles" in each role
# This is for the "roles calling other roles" case
# for podman, change the FQCN - using a non-FQCN module name doesn't seem to work,
# even for the legacy role format
# replace community.general for rhc
for rolename in %{rolenames}; do
find $rolename -type f -exec \
sed -e "s/linux-system-roles[.]${rolename}\\>/%{roleinstprefix}${rolename}/g" \
-e "s/fedora[.]linux_system_roles[.]/%{collection_namespace}.%{collection_name}./g" \
-e "s/containers[.]podman[.]/%{collection_namespace}.%{collection_name}./g" \
-e "s/community[.]general[.]/%{collection_namespace}.%{collection_name}./g" \
-i {} \;
done

12
vendoring-prep.inc Normal file
View File

@ -0,0 +1,12 @@
# Untar vendored collection tarballs to corresponding directories
for file in %{SOURCE801} %{SOURCE901} %{SOURCE902}; do
if [[ "$(basename $file)" =~ ([^-]+)-([^-]+)-(.+).tar.gz ]]; then
ns=${BASH_REMATCH[1]}
name=${BASH_REMATCH[2]}
ver=${BASH_REMATCH[3]}
mkdir -p .external/$ns/$name
pushd .external/$ns/$name > /dev/null
tar xfz "$file"
popd > /dev/null
fi
done