|
|
||
|---|---|---|
| defaults | ||
| files | ||
| handlers | ||
| meta | ||
| tasks | ||
| templates | ||
| tests | ||
| vars | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
README.md
ansible-role-apache
Installs and configures Apache httpd on Debian and Ubuntu and on EL 8
and 9. The EL side comes from the separate httpd role of
the old library, absorbed here.
Variable names
There is one namespace, apache_*. The absorbed role used
httpd_* and those names are gone: a playbook that still
sets them has no effect. The rename is mechanical, httpd_x
becomes apache_x, with four exceptions:
| old | new |
|---|---|
httpd_main_packages |
apache_packages |
httpd_ssl_enabled |
apache_ssl_modules_enabled |
httpd_modules |
see Modules below |
httpd_additional_modules |
see Modules below |
Distribution differences live inside the defaults, the convention
already used by ansible-role-postgresql, so every value
stays a default and a playbook can still override it.
| deb | EL | |
|---|---|---|
| packages | apache2, apache2-utils |
httpd, httpd-tools |
| mod_ssl | part of apache2 |
separate package |
| service | apache2 |
httpd |
| config directory | /etc/apache2 |
/etc/httpd |
| user, group | www-data |
apache |
| main config file | left to the package | fully templated |
Configuration model
The two families do not configure Apache the same way, and the role does not pretend otherwise.
On deb the packaged apache2.conf is left alone: the role
manages ports.conf, removes the default virtualhost and
enables modules with a2enmod.
On EL the whole httpd.conf is templated, because that is
where the tuning and the document root layout live. This is what the
apache_timeout, apache_keepalive_*,
apache_startservers, apache_maxclients,
apache_min_spare, apache_max_spare,
apache_threads_per_child, apache_serverlimit
and apache_max_requests_per_child variables feed, and they
have no effect on deb.
Modules
On deb, modules are enabled with apache2_module, from
apache_default_modules,
apache_additional_modules_list,
apache_ssl_modules and
apache_http_proxy_modules.
On EL none of that applies. The apache2_module Ansible
module requires the a2enmod and a2dismod
binaries, which the EL httpd package does not ship, so the
httpd_modules list of the absorbed role could never be
applied there. What EL needs is the MPM selection, written to
conf.modules.d/00-mpm.conf from
apache_mpm_mode, while the individual
LoadModule lines come from the distribution’s own
conf.modules.d. apache_el_extra_modules adds
the ones the distribution does not load by default:
apache_el_extra_modules:
- { identifier: 'jk_module', file: 'mod_jk.so' }Handlers
apache2 reload and apache2 restart act on
the right service on both families. httpd reload and
httpd restart exist as well, with the same behaviour, for
the roles that come from the absorbed one and notify those names.