Refactor the services task to better handle systemd vs runit.
This commit is contained in:
@@ -16,24 +16,13 @@
|
|||||||
retries: 3
|
retries: 3
|
||||||
delay: 3
|
delay: 3
|
||||||
|
|
||||||
|
- name: General | Software | Services | CROND | Enable (runit)
|
||||||
## CUPS ##
|
|
||||||
|
|
||||||
- name: General | Software | Services | CUPS | Disable
|
|
||||||
service:
|
service:
|
||||||
name: "{{ cups }}"
|
name: "{{ crond }}"
|
||||||
pattern: "{{ cups_pattern }}"
|
state: started
|
||||||
state: stopped
|
enabled: yes
|
||||||
enabled: no
|
when: ansible_virtualization_type != 'docker'
|
||||||
ignore_errors: yes
|
and ansible_service_mgr == "runit"
|
||||||
|
|
||||||
- name: General | Software | Services | CUPS-Browse | Disable
|
|
||||||
service:
|
|
||||||
name: "{{ cups_browse }}"
|
|
||||||
pattern: "{{ cups_browse_pattern }}"
|
|
||||||
state: stopped
|
|
||||||
enabled: no
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
|
|
||||||
## SSHD ##
|
## SSHD ##
|
||||||
@@ -95,6 +84,7 @@
|
|||||||
- name: General | Software | Services | JournalCTL | Reduce Log Size
|
- name: General | Software | Services | JournalCTL | Reduce Log Size
|
||||||
shell: journalctl --vacuum-size=100M
|
shell: journalctl --vacuum-size=100M
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
and ansible_service_mgr == "systemd"
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
||||||
@@ -131,3 +121,30 @@
|
|||||||
# Add a field to general.yml config file which gets applied via timedatectl and /etc/localtime.
|
# Add a field to general.yml config file which gets applied via timedatectl and /etc/localtime.
|
||||||
# Example of what to do to file:
|
# Example of what to do to file:
|
||||||
# /etc/localtime -> ../usr/share/zoneinfo/America/Phoenix
|
# /etc/localtime -> ../usr/share/zoneinfo/America/Phoenix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Disable ##
|
||||||
|
|
||||||
|
- name: General | Software | Services | Disable
|
||||||
|
service:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
pattern: "{{ item.pattern }}"
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
ignore_errors: yes
|
||||||
|
loop:
|
||||||
|
- {name: "{{ cups }}" , pattern: "{{ cups_pattern }}"}
|
||||||
|
- {name: "{{ cups_browse }}", pattern: "{{ cups_browse_pattern }}"}
|
||||||
|
when: ansible_service_mgr != "runit"
|
||||||
|
|
||||||
|
- name: General | Software | Services | Disable (runit)
|
||||||
|
service:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
ignore_errors: yes
|
||||||
|
loop:
|
||||||
|
- {name: "{{ cups }}" }
|
||||||
|
- {name: "{{ cups_browse }}"}
|
||||||
|
when: ansible_service_mgr = "runit"
|
||||||
|
|||||||
Reference in New Issue
Block a user