summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/service
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2021-05-28 01:06:45 +0200
committerGitHub <noreply@github.com>2021-05-28 01:06:45 +0200
commit5640093f1ca63fd6af231cc8a7fb7d40e1907b8c (patch)
treeacc0d13194185c344ff910eaadf550ed070818ef /test/integration/targets/service
parentssh remove unused/unusable cli option ssh_args (#74846) (diff)
downloadansible-5640093f1ca63fd6af231cc8a7fb7d40e1907b8c.tar.xz
ansible-5640093f1ca63fd6af231cc8a7fb7d40e1907b8c.zip
Use the module redirect_list when getting defaults for action plugins (#73864)
* Fix module-specific defaults in the gather_facts, package, and service action plugins. * Handle ansible.legacy actions better in get_action_args_with_defaults * Add tests for each action plugin * Changelog Fixes #72918
Diffstat (limited to 'test/integration/targets/service')
-rw-r--r--test/integration/targets/service/tasks/tests.yml33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/integration/targets/service/tasks/tests.yml b/test/integration/targets/service/tasks/tests.yml
index de66bf5ca7..cfb4215205 100644
--- a/test/integration/targets/service/tasks/tests.yml
+++ b/test/integration/targets/service/tasks/tests.yml
@@ -11,6 +11,39 @@
that:
- "enable_in_check_mode_result is changed"
+- name: (check mode run) test that service defaults are used
+ service:
+ register: enable_in_check_mode_result
+ check_mode: yes
+ module_defaults:
+ service:
+ name: ansible_test
+ enabled: yes
+
+- name: assert that changes reported for check mode run
+ assert:
+ that:
+ - "enable_in_check_mode_result is changed"
+
+- name: (check mode run) test that specific module defaults are used
+ service:
+ register: enable_in_check_mode_result
+ check_mode: yes
+ when: "ansible_service_mgr in ['sysvinit', 'systemd']"
+ module_defaults:
+ sysvinit:
+ name: ansible_test
+ enabled: yes
+ systemd:
+ name: ansible_test
+ enabled: yes
+
+- name: assert that changes reported for check mode run
+ assert:
+ that:
+ - "enable_in_check_mode_result is changed"
+ when: "ansible_service_mgr in ['sysvinit', 'systemd']"
+
- name: enable the ansible test service
service: name=ansible_test enabled=yes
register: enable_result