Newer
Older
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
---
# tasks file for disabling CUPS on target system
- name: DISABLE CUPS | Populate service facts
ansible.builtin.service_facts:
- name: DISABLE CUPS | Setting fact from cups status
ansible.builtin.set_fact:
cups_status: "{{ ansible_facts.services['cups.service'].status }}"
when: ansible_facts.services['cups.service'].status is defined
- name: DISABLE CUPS | DEBUG -> Print cups_status
ansible.builtin.debug:
msg: "cups_status: {{ cups_status }}"
when: c3infodesk_printer_host_cups_disable_debug | bool
- name: DISABLE CUPS | Stop the running CUPS on target
ansible.builtin.command:
cmd: systemctl stop cups
become: true
when:
- cups_status is defined
- cups_status != 'masked'
- name: DISABLE CUPS | Disable the running CUPS on target
ansible.builtin.command:
cmd: systemctl disable cups
become: true
# when: cups_status != 'masked'
when:
- cups_status is defined
- cups_status != 'masked'
- name: DISABLE CUPS | Mask the running CUPS on target
ansible.builtin.command:
cmd: systemctl mask cups
become: true
# when: cups_status != 'masked'
when:
- cups_status is defined
- cups_status != 'masked'