summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/service_facts/tasks/main.yml
blob: d2d6528bce28602b3c9aef3035ee9fc7630a64cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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'