role: stop ppd, handle only when installed

This commit is contained in:
Josh Lay 2024-08-06 08:16:10 -05:00
parent efe17b682a
commit 983d2339f2
No known key found for this signature in database
GPG key ID: 47AA304B2243B579

View file

@ -11,12 +11,14 @@
when: ansible_facts['packages']['tuned'][0]['version'] is version('2.23.0', '<') # versions are in a list...? pick the first; only expect one when: ansible_facts['packages']['tuned'][0]['version'] is version('2.23.0', '<') # versions are in a list...? pick the first; only expect one
# around Fedora 35/36, the packages for 'power-profiles-daemon' and 'tuned' conflicted; no more - can coincide # around Fedora 35/36, the packages for 'power-profiles-daemon' and 'tuned' conflicted; no more - can coincide
# ensuring the service is masked should suffice for their conflicts # ensuring the service is masked should suffice - not removed; gnome/others may 'require' it. doing so may remove them implicitly
- name: Ensure power-profiles-daemon is disabled/masked - name: Ensure power-profiles-daemon is off/disabled/masked
ansible.builtin.systemd_service: ansible.builtin.systemd_service:
name: power-profiles-daemon name: power-profiles-daemon
enabled: false enabled: false
masked: true masked: true
state: stopped
when: "'power-profiles-daemon' in ansible_facts['packages']"
become: true become: true
- name: Ensure 'tuned' is installed - name: Ensure 'tuned' is installed