Add mod_wsgi.actions and libdnf plugin, to restart httpd.

Signed-off-by: James Antill <james@and.org>
This commit is contained in:
James Antill 2025-02-14 16:59:02 -05:00 committed by kevin
parent fb4e2937a3
commit 0405924e26
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,19 @@
# Requirements: yum install libdnf5-plugin-actions
# At the end of the DNF transaction
# if python3-mod_wsgi has (re)installed/(up|down)graded then
# restart HTTPD
# if python3-libs has (re)installed/(up|down)graded then
# restart HTTPD
# (will run the cmd twice on if they both change on (up/down)grades)
# Doesn't do anything if either are removed.
post_transaction:python3-mod_wsgi:in:enabled=host-only:/bin/systemctl try-restart --no-block httpd.service
post_transaction:python3-libs:in:enabled=host-only:/bin/systemctl try-restart --no-block httpd.service
# Uncomment this line to do the same thing when it's removed
# (will run the cmd twice on (up/down)grades)
# post_transaction:python3-mod_wsgi:out:enabled=host-only:/bin/systemctl try-restart --no-block httpd.service
# This is for python2-mod_wsgi ... probably DNF5 doesn't exist, or this package
# doesn't.
# post_transaction:python2-mod_wsgi:in:enabled=host-only:/bin/systemctl try-restart --no-block httpd.service

View file

@ -30,3 +30,21 @@
- Restart apache
tags:
- config
# These next two should eventually be: install mod_wsgi-dnf5-actions
- name: Install libdnf actions plugin
ansible.builtin.package:
name: libdnf5-plugin-actions
state: present
tags:
- packages
# This is currently Fedora-40+ ... no RHEL, no EPEL
when: ansible_distribution == 'Fedora'
- name: Wsgi libdnf actions
ansible.builtin.copy: src="mod_wsgi.actions" dest=/etc/dnf/libdnf5-plugins/actions.d
tags:
- config
# This does nothing without the above plugin, although we could install it
# everywhere.
when: ansible_distribution == 'Fedora'