From 6601ee3af50ba2623f3d75ba702da26d6211932d Mon Sep 17 00:00:00 2001
From: Rafael Guterres Jeffman <rjeffman@redhat.com>
Date: Mon, 14 Nov 2022 17:13:35 -0300
Subject: [PATCH] upstream tests: Removal of 'warn: no' from shell plugins

The parameter 'warn' from ansible.builtin.shell was deprecated in
ansible-core version 2.11 and removed in version 2.14.

This patch removes the usage of this parameter from ansible-freeipa
tests, and adds 'deprecated-command-syntax' to the skip list of
ansible-lint configuration to cope with the change in the linter.
---
 tests/dnsrecord/test_dnsrecord.yml                     | 7 ++-----
 tests/host/certificate/test_host_certificate.yml       | 4 +---
 tests/host/certificate/test_hosts_certificate.yml      | 4 +---
 tests/service/certificate/test_service_certificate.yml | 4 +---
 tests/service/test_service_disable.yml                 | 4 +---
 tests/user/certificate/test_user_certificate.yml       | 4 +---
 tests/user/certificate/test_users_certificate.yml      | 4 +---
 tests/user/certmapdata/test_user_certmapdata.yml       | 4 +---
 tests/user/certmapdata/test_users_certmapdata.yml      | 4 +---
 tests/user/test_users_invalid_cert.yml                 | 4 +---
 10 files changed, 11 insertions(+), 32 deletions(-)

diff --git a/tests/dnsrecord/test_dnsrecord.yml b/tests/dnsrecord/test_dnsrecord.yml
index 176e5492..d13807f6 100644
--- a/tests/dnsrecord/test_dnsrecord.yml
+++ b/tests/dnsrecord/test_dnsrecord.yml
@@ -1549,11 +1549,8 @@
   - name: Cleanup test environment.
     include_tasks: env_cleanup.yml
 
-  - name: Remove certificate files.
-    shell:
-      cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
+    ansible.builtin.shell: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/host/certificate/test_host_certificate.yml b/tests/host/certificate/test_host_certificate.yml
index 33d316d9..b6357808 100644
--- a/tests/host/certificate/test_host_certificate.yml
+++ b/tests/host/certificate/test_host_certificate.yml
@@ -99,11 +99,9 @@
     register: result
     failed_when: result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2, 3]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/host/certificate/test_hosts_certificate.yml b/tests/host/certificate/test_hosts_certificate.yml
index a55c8988..77f861c0 100644
--- a/tests/host/certificate/test_hosts_certificate.yml
+++ b/tests/host/certificate/test_hosts_certificate.yml
@@ -98,11 +98,9 @@
     register: result
     failed_when: not result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2, 3]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/service/certificate/test_service_certificate.yml b/tests/service/certificate/test_service_certificate.yml
index a7fcbeb5..bbac408b 100644
--- a/tests/service/certificate/test_service_certificate.yml
+++ b/tests/service/certificate/test_service_certificate.yml
@@ -214,11 +214,9 @@
       update_dns: yes
       state: absent
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/service/test_service_disable.yml b/tests/service/test_service_disable.yml
index 292ad4e8..822fb9fa 100644
--- a/tests/service/test_service_disable.yml
+++ b/tests/service/test_service_disable.yml
@@ -100,11 +100,9 @@
   - name: Destroy Kerberos tickets.
     shell: kdestroy -A -q -c ${KRB5CCNAME}
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/user/certificate/test_user_certificate.yml b/tests/user/certificate/test_user_certificate.yml
index 5ea6fe90..09dacbb3 100644
--- a/tests/user/certificate/test_user_certificate.yml
+++ b/tests/user/certificate/test_user_certificate.yml
@@ -80,11 +80,9 @@
     register: result
     failed_when: not result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2, 3]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/user/certificate/test_users_certificate.yml b/tests/user/certificate/test_users_certificate.yml
index 313a826f..d649f848 100644
--- a/tests/user/certificate/test_users_certificate.yml
+++ b/tests/user/certificate/test_users_certificate.yml
@@ -93,11 +93,9 @@
     register: result
     failed_when: not result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2, 3]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/user/certmapdata/test_user_certmapdata.yml b/tests/user/certmapdata/test_user_certmapdata.yml
index 144d49f4..0257b23b 100644
--- a/tests/user/certmapdata/test_user_certmapdata.yml
+++ b/tests/user/certmapdata/test_user_certmapdata.yml
@@ -225,11 +225,9 @@
     register: result
     failed_when: not result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.   # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2, 3]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/user/certmapdata/test_users_certmapdata.yml b/tests/user/certmapdata/test_users_certmapdata.yml
index b871fb9c..491face6 100644
--- a/tests/user/certmapdata/test_users_certmapdata.yml
+++ b/tests/user/certmapdata/test_users_certmapdata.yml
@@ -161,11 +161,9 @@
     register: result
     failed_when: not result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2, 3]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
diff --git a/tests/user/test_users_invalid_cert.yml b/tests/user/test_users_invalid_cert.yml
index 0d75159a..50112ce5 100644
--- a/tests/user/test_users_invalid_cert.yml
+++ b/tests/user/test_users_invalid_cert.yml
@@ -54,11 +54,9 @@
     register: result
     failed_when: not result.changed or result.failed
 
-  - name: Remove certificate files.
+  - name: Remove certificate files.  # noqa: deprecated-command-syntax
     shell:
       cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
     with_items: [1, 2]
     become: no
     delegate_to: localhost
-    args:
-      warn: no  # suppres warning for not using the `file` module.
-- 
GitLab