summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/service_facts/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/service_facts/tasks/main.yml')
-rw-r--r--test/integration/targets/service_facts/tasks/main.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/targets/service_facts/tasks/main.yml b/test/integration/targets/service_facts/tasks/main.yml
new file mode 100644
index 0000000..d2d6528
--- /dev/null
+++ b/test/integration/targets/service_facts/tasks/main.yml
@@ -0,0 +1,29 @@
+# Test playbook for the service_facts module
+# Copyright: (c) 2017, Adam Miller <admiller@redhat.com>
+# Copyright: (c) 2020, Abhijeet Kasurde <akasurde@redhat.com>
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+
+- name: skip broken distros
+ meta: end_host
+ when: ansible_distribution == 'Alpine'
+
+- name: Gather service facts
+ service_facts:
+
+- name: check for ansible_facts.services exists
+ assert:
+ that: ansible_facts.services is defined
+
+- name: Test disabled service facts (https://github.com/ansible/ansible/issues/69144)
+ block:
+ - name: display value of ansible_service_mgr
+ debug:
+ msg: 'ansible_service_mgr: {{ ansible_service_mgr }}'
+
+ - name: setup test service script
+ include_tasks: 'systemd_setup.yml'
+
+ - name: execute tests
+ import_tasks: tests.yml
+
+ when: (ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and ansible_distribution_major_version is version('7', '>=')) or ansible_distribution == 'Fedora' or (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('15.04', '>=')) or (ansible_distribution == 'Debian' and ansible_distribution_version is version('8', '>=')) or ansible_os_family == 'Suse'