- Docs »
- apache2_module - Enables/disables a module of the Apache2 webserver.
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
apache2_module - Enables/disables a module of the Apache2 webserver.
- Enables or disables a specified module of the Apache2 webserver.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
force
bool
(added in 2.1) |
|
Force disabling of default modules and override Debian warnings.
|
identifier
(added in 2.5) |
|
Identifier of the module as listed by apache2ctl -M . This is optional and usually determined automatically by the common convention of appending _module to name as well as custom exception for popular modules.
|
ignore_configcheck
bool
(added in 2.3) |
|
Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules.
|
name
required |
|
Name of the module to enable/disable as given to a2enmod/a2dismod .
|
state
|
Choices:
present ←
- absent
|
Desired state of the module.
|
# enables the Apache2 module "wsgi"
- apache2_module:
state: present
name: wsgi
# disables the Apache2 module "wsgi"
- apache2_module:
state: absent
name: wsgi
# disable default modules for Debian
- apache2_module:
state: absent
name: autoindex
force: True
# disable mpm_worker and ignore warnings about missing mpm module
- apache2_module:
state: absent
name: mpm_worker
ignore_configcheck: True
# enable dump_io module, which is identified as dumpio_module inside apache2
- apache2_module:
state: present
name: dump_io
identifier: dumpio_module
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
rc
int
|
failed |
return code of underlying command
|
result
string
|
always |
message about action taken
|
stderr
string
|
failed |
stderr of underlying command
|
stdout
string
|
failed |
stdout of underlying command
|
warnings
list
|
when needed |
list of warning messages
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
- Christian Berendt (@berendt)
- Ralf Hertel (@n0trax)
- Robin Roth (@robinro)
Hint
If you notice any issues in this documentation you can edit this document to improve it.