apache2_module - enables/disables a module of the Apache2 webserver
New in version 1.6.
Synopsis
- Enables or disables a specified module of the Apache2 webserver.
Requirements (on host that executes module)
- a2enmod
- a2dismod
Options
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| force (added in 2.1)
| no |
| force disabling of default modules and override Debian warnings | |
| ignore_configcheck (added in 2.3)
| no |
| Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules. | |
| name | yes | name of the module to enable/disable | ||
| state | no | present |
| indicate the desired state of the resource |
Examples
# 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
Return Values
Common return values are documented here Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample |
|---|---|---|---|---|
| rc | return code of underlying command | failed | int | |
| result | message about action taken | always | string | |
| stderr | stderr of underlying command | failed | string | |
| stdout | stdout of underlying command | failed | string | |
| warnings | list of warning messages | when needed | list |
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/apache2_module_module.html