diff --git a/ansible-freeipa-0.3.8-Replace-json_query-in-tests-user-test_users_absent.y_rhbz#1992997.patch b/ansible-freeipa-0.3.8-Replace-json_query-in-tests-user-test_users_absent.y_rhbz#1992997.patch new file mode 100644 index 0000000..bbdc232 --- /dev/null +++ b/ansible-freeipa-0.3.8-Replace-json_query-in-tests-user-test_users_absent.y_rhbz#1992997.patch @@ -0,0 +1,34 @@ +From 545d1c742231ea3151a6b0474de4c198dcbc8604 Mon Sep 17 00:00:00 2001 +From: Thomas Woerner +Date: Wed, 11 Aug 2021 11:24:36 +0200 +Subject: [PATCH] Replace json_query in tests/user/test_users_absent.yml + +json_query is not part of Ansible Core. As this is the only used module +that is not in Core it has been replaced by constructig a new dict with +the needed user names from users dict using a loop and set_fact. +--- + tests/user/test_users_absent.yml | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests/user/test_users_absent.yml b/tests/user/test_users_absent.yml +index 752b241..d211816 100644 +--- a/tests/user/test_users_absent.yml ++++ b/tests/user/test_users_absent.yml +@@ -12,8 +12,13 @@ + include_vars: + file: users.json + ++ - name: Create dict with user names ++ set_fact: ++ user_names: "{{ user_names | default([]) + [{ 'name': item.name }] }}" ++ loop: "{{ users }}" ++ + - name: Users absent len:{{ users | length }} + ipauser: + ipaadmin_password: SomeADMINpassword +- users: "{{ users | json_query('[*].{name: name}') }}" ++ users: "{{ user_names }}" + state: absent +-- +2.31.1 + diff --git a/ansible-freeipa.spec b/ansible-freeipa.spec index 9441e4f..d116e14 100644 --- a/ansible-freeipa.spec +++ b/ansible-freeipa.spec @@ -8,11 +8,15 @@ Summary: Roles and playbooks to deploy FreeIPA servers, replicas and clients Name: ansible-freeipa Version: 0.3.8 -Release: 2%{?dist} +Release: 3%{?dist} URL: https://github.com/freeipa/ansible-freeipa License: GPLv3+ Source: https://github.com/freeipa/ansible-freeipa/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch1: ansible-freeipa-0.3.8-Replace-json_query-in-tests-user-test_users_absent.y_rhbz#1992997.patch BuildArch: noarch +%if 0%{?fedora} >= 35 || 0%{?rhel} >= 9 +Requires: ansible-core +%endif %description Ansible roles and playbooks to install and uninstall FreeIPA servers, replicas and clients. Also modules for group, host, topology and user management. @@ -103,6 +107,7 @@ to get the needed requrements to run the tests. %prep %setup -q # Do not create backup files with patches +%patch1 -p1 # Fix python modules and module utils: # - Remove shebang @@ -159,6 +164,14 @@ cp -rp tests %{buildroot}%{_datadir}/ansible-freeipa/ %{_datadir}/ansible-freeipa/requirements-tests.txt %changelog +* Mon Aug 16 2021 Thomas Woerner - 0.3.8-3 +- Add requirement for ansible-core + Resolves: RHBZ#1993857 +- Remove python3, pip and ansible installation from sanity test + Related: RHBZ#1993857 +- Replace json_query in tests/user/test_users_absent.yml + Resolves: RHBZ#1992997 + * Mon Aug 09 2021 Mohan Boddu - 0.3.8-2 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688 diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh index 359ef0c..615c344 100644 --- a/tests/sanity/runtest.sh +++ b/tests/sanity/runtest.sh @@ -1,9 +1,3 @@ #!/bin/sh -eux -# Install python3 and python3-pip -dnf -y install python3 python3-pip - -# Use pip3 to install ansible (2.9) -pip3 install "ansible>=2.9,<2.10" - ansible-playbook -i inventory install-server.yml -v --connection=local