add systemd alias check (#76608)

* add systemd alias check

* add .yml

* Delete 75538-systemd-alias-check

* Update lib/ansible/modules/systemd.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/76671/head
James Livulpi 3 years ago committed by GitHub
parent 4d380dcbaa
commit ffd0343670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- systemd - check if service is alias so it gets enabled (https://github.com/ansible/ansible/issues/75538).

@ -502,8 +502,8 @@ def main():
# check systemctl result or if it is a init script # check systemctl result or if it is a init script
if rc == 0: if rc == 0:
enabled = True enabled = True
# Check if service is indirect and if out contains exactly 1 line of string 'indirect' it's disabled # Check if the service is indirect or alias and if out contains exactly 1 line of string 'indirect'/ 'alias' it's disabled
if out.splitlines() == ["indirect"]: if out.splitlines() == ["indirect"] or out.splitlines() == ["alias"]:
enabled = False enabled = False
elif rc == 1: elif rc == 1:

Loading…
Cancel
Save