File: test_enabled_runtime.yml

package info (click to toggle)
ansible-core 2.19.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,944 kB
  • sloc: python: 181,408; cs: 4,929; sh: 4,661; xml: 34; makefile: 21
file content (50 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
- name: Copy enabled-runtime service file
  template:
    src: baz.service
    dest: /etc/systemd/system/baz.service
    owner: root
    group: root
    mode: '0644'
  notify: remove unit file

- name: Reload systemd
  systemd:
    daemon_reload: true

- name: Enable the enabled-runtime service using shell command
  shell: systemctl enable --runtime baz

- name: Enable enabled-runtime service
  systemd:
    name: baz.service
    enabled: true
  register: baz_test_1

- name: Enable enabled-runtime service again
  systemd:
    name: baz.service
    enabled: true
  register: baz_test_2

- name: Disable enabled-runtime service
  systemd:
    name: baz.service
    state: stopped
    enabled: false
  register: baz_test_3

- name: Disable enabled-runtime service again
  systemd:
    name: baz.service
    enabled: false
  register: baz_test_4

- name:
  assert:
    that:
      - baz_test_1 is changed
      - baz_test_1 is success
      - baz_test_2 is not changed
      - baz_test_2 is success
      - baz_test_3 is changed
      - baz_test_4 is not changed