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