- 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
This commit is contained in:
Thomas Woerner 2021-08-16 12:40:26 +02:00
parent 5682882289
commit 6c3840661f
3 changed files with 48 additions and 7 deletions

View File

@ -0,0 +1,34 @@
From 545d1c742231ea3151a6b0474de4c198dcbc8604 Mon Sep 17 00:00:00 2001
From: Thomas Woerner <twoerner@redhat.com>
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

View File

@ -8,11 +8,15 @@
Summary: Roles and playbooks to deploy FreeIPA servers, replicas and clients Summary: Roles and playbooks to deploy FreeIPA servers, replicas and clients
Name: ansible-freeipa Name: ansible-freeipa
Version: 0.3.8 Version: 0.3.8
Release: 2%{?dist} Release: 3%{?dist}
URL: https://github.com/freeipa/ansible-freeipa URL: https://github.com/freeipa/ansible-freeipa
License: GPLv3+ License: GPLv3+
Source: https://github.com/freeipa/ansible-freeipa/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz 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 BuildArch: noarch
%if 0%{?fedora} >= 35 || 0%{?rhel} >= 9
Requires: ansible-core
%endif
%description %description
Ansible roles and playbooks to install and uninstall FreeIPA servers, replicas and clients. Also modules for group, host, topology and user management. 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 %prep
%setup -q %setup -q
# Do not create backup files with patches # Do not create backup files with patches
%patch1 -p1
# Fix python modules and module utils: # Fix python modules and module utils:
# - Remove shebang # - Remove shebang
@ -159,6 +164,14 @@ cp -rp tests %{buildroot}%{_datadir}/ansible-freeipa/
%{_datadir}/ansible-freeipa/requirements-tests.txt %{_datadir}/ansible-freeipa/requirements-tests.txt
%changelog %changelog
* Mon Aug 16 2021 Thomas Woerner <twoerner@redhat.com> - 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 <mboddu@redhat.com> - 0.3.8-2 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.8-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688 Related: rhbz#1991688

View File

@ -1,9 +1,3 @@
#!/bin/sh -eux #!/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 ansible-playbook -i inventory install-server.yml -v --connection=local