geerlingguy / ansible-role-ntp

Ansible Role - NTP
https://galaxy.ansible.com/geerlingguy/ntp/
MIT License
319 stars 243 forks source link

fix: Debian 10 issue with systemd-timesyncd.service "status" key not present on old Ansible installs #112

Closed synweap15 closed 2 years ago

synweap15 commented 2 years ago

Target Debian 10, super old Ansible install: ansible==2.5.15

Issue:

TASK [geerlingguy.ntp : Disable systemd-timesyncd if it's running but ntp is enabled.] ************************************************************************************************************************************************************************************************************************
fatal: [textbookweb-client-hetzner]: FAILED! => {"msg": "The conditional check 'services[\"systemd-timesyncd.service\"][\"status\"] != \"not-found\"' failed. The error was: error while evaluating conditional (services[\"systemd-timesyncd.service\"][\"status\"] != \"not-found\"): 'dict object' has no attribute 'status'\n\nThe error appears to have been in '/home/dev/ansible/.galaxy/geerlingguy.ntp/tasks/main.yml': line 44, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Disable systemd-timesyncd if it's running but ntp is enabled.\n  ^ here\n"}

Fix attached.

stale[bot] commented 2 years ago

This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark pull requests as stale.

stale[bot] commented 2 years ago

This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.