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