summaryrefslogtreecommitdiff
path: root/test/integration/targets
diff options
context:
space:
mode:
authorRick Elrod <rick@elrod.me>2020-08-27 09:12:27 -0500
committerGitHub <noreply@github.com>2020-08-27 09:12:27 -0500
commit6b4977e3f46699fa410fe7d40c932fa622bfd494 (patch)
tree7f6bcd2429853db3fa6d94b3c8ea42c8425e0185 /test/integration/targets
parentc87d3d629193a9e75aab35ae1863567b2407e6b2 (diff)
downloadansible-6b4977e3f46699fa410fe7d40c932fa622bfd494.tar.gz
Backport cron module regression fix (#71244)
Change: - Backport of #71207 Test Plan: - CI Tickets: - Fixes #71213 - Fixes #71217 - Fixes #71216 - Fixes #71226 - Refs #71207 Signed-off-by: Rick Elrod <rick@elrod.me>
Diffstat (limited to 'test/integration/targets')
-rw-r--r--test/integration/targets/cron/tasks/main.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/integration/targets/cron/tasks/main.yml b/test/integration/targets/cron/tasks/main.yml
index 829b375369..3b7e30fb37 100644
--- a/test/integration/targets/cron/tasks/main.yml
+++ b/test/integration/targets/cron/tasks/main.yml
@@ -100,6 +100,32 @@
- assert:
that: remove_cron_file is not changed
+- name: Non regression test - cron file should not be empty after adding var (#71207)
+ when: ansible_distribution != 'Alpine'
+ block:
+ - name: Cron file creation
+ cron:
+ cron_file: cron_filename
+ name: "simple cron job"
+ job: 'echo "_o/"'
+ user: root
+
+ - name: Add var to the cron file
+ cron:
+ cron_file: cron_filename
+ env: yes
+ name: FOO
+ value: bar
+ user: root
+
+ - name: "Ensure cron_file still contains job string"
+ replace:
+ path: /etc/cron.d/cron_filename
+ regexp: "_o/"
+ replace: "OK"
+ register: find_chars
+ failed_when: (find_chars is not changed) or (find_chars is failed)
+
- name: Allow non-ascii chars in job (#69492)
block:
- name: Cron file creation