Combine start/restart steps

This commit is contained in:
Wojciech Kozlowski 2022-08-30 15:33:13 +02:00
parent bc2bf5ca27
commit 0ddf73d8ae

View File

@ -102,13 +102,7 @@
path: /etc/postfix/sasl_passwd.db
mode: 0600
- name: Enable/start postfix
service:
name: postfix
enabled: yes
state: started
- name: Restart postfix
- name: Enable/start/restart postfix
service:
name: postfix
enabled: yes
@ -236,6 +230,7 @@
- name: Install acpupsd
apt:
name: apcupsd
register: apcupsd_install
- name: Apcupsd configuration
copy:
@ -244,16 +239,11 @@
mode: 0644
register: apcupsd_cfg
- name: Enable/start apcupsd
service:
name: apcupsd
enabled: yes
state: started
- name: Restart apcupsd
- name: Enable/start/restart apcupsd
service:
name: apcupsd
enabled: yes
state: restarted
when:
apcupsd_install is changed or
apcupsd_cfg is changed