Debian Codegraph @

test/integration/targets/systemd/tasks/test_unit_template.yml

raw
1 - name: Copy service file
2 template:
3 src: [email protected]
4 dest: /etc/systemd/system/[email protected]
5 owner: root
6 group: root
7 mode: '0644'
8 notify: remove unit file
9
10 - name: Reload systemd
11 systemd:
12 daemon_reload: yes
13
14 - name: Start and enable service using unit template
15 systemd:
16 name: [email protected]
17 state: started
18 enabled: yes
19 register: template_test_1
20
21 - name: Start and enable service using unit template again
22 systemd:
23 name: [email protected]
24 state: started
25 enabled: yes
26 register: template_test_2
27
28 - name: Stop and disable service using unit template
29 systemd:
30 name: [email protected]
31 state: stopped
32 enabled: no
33 register: template_test_3
34
35 - name: Stop and disable service using unit template again
36 systemd:
37 name: [email protected]
38 state: stopped
39 enabled: no
40 register: template_test_4
41
42 - name:
43 assert:
44 that:
45 - template_test_1 is changed
46 - template_test_1 is success
47 - template_test_2 is not changed
48 - template_test_2 is success
49 - template_test_3 is changed
50 - template_test_4 is not changed