The problem I'm having seems to be true to all distors but let's assume I use an all-default
debian-stable (server), and ran
apt update -y.
Installing, upgrading, restarting as well as enabling or disabling modules in Apache are all non version-agnostic operations and I find this a problem:
Installing or upgrading Apache should be
apt upgrade apache1or
apt upgrade apache2. It can't be just "apt upgrade apache" with whatever version out there, as with
apt upgrade zipor
apt upgrade unzipand so forth.
To restart Apache one has to do
systemctl restart apache2and to enable or disable an Apache module one has to do say
a2enmod http2 deflate expiresor
a2dismod http2 deflate expires.
Approaches I considered to deal with that problem
I thought Ansible might help here by transcribing the old installation command with Ansible's
state=latest option but the Ansible Apache docs doesn't include a non version-agnostic syntax of these commands and installs only Apache2 as well, so even when Apache3 comes out, I will still have to manually release_upgrade it from 2.4 to 3.x even though I continuously-upgrade basically all the rest of the above-OS software with Ansible (like
1. Combining Ansible with regex (as in Ansible's apt
systemctl restart apache*) is still not enough or at least "fragile".
2. Even combining Ansible and
tasksel with and regex:
- name: Install latest Apache apt: lamp-server^ state: latest - do stuff and restart Apache command: args: argv: - aenmod http2 deflate expires # Non version-agnostic http version; - systemctl restart apache*
may not be enough, as it will still require me for manual changes when Apache 3 or 4 or 5 comes out (say, to existing virtual host files).
I know it might be an extreme desire but is there a way to install, and totally continuously upgrade Apache (including release_upgrades and virtual host files and so forth) smoothly?
Maybe a communally maintained and well supported Ansible-Galaxy role is the correct approach. Maybe I should pick another webserver - I don't know.
Update per comment
It comes up from a comment by Michael Hampton that this is all Debian specific and that other distros might have version-agnostic ways to install Apache - to be honest, I considered ArchLinux because of its fully rolling-release OS upgrade model. An answer could example a few distros that may suffice the approach I seek in Apache.