--- - name: remove suspend and standby for notebooks using nfs over wlan ansible.builtin.command: systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target when: fsit_cmgt_lid_close_poweroff - name: overwrite settings in /etc/systemd/logind.conf ansible.lineinfile: path: /etc/systemd/logind.conf regex: "^#HandleLidSwitch=.*" line: "HandleLidSwitch=poweroff" when: fsit_cmgt_lid_close_poweroff notify: fsit_cmgt_reboot - name: overwrite settings in /etc/systemd/logind.conf ansible.lineinfile: path: /etc/systemd/logind.conf regex: "^#HandleLidSwitchExternalPower=.*" line: "HandleLidSwitchExternalPower=poweroff" when: fsit_cmgt_lid_close_poweroff notify: fsit_cmgt_reboot