W3cubDocs

/Ansible

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
  • True
  • False
force disabling of default modules and override Debian warnings
ignore_configcheck
(added in 2.3)
no
  • True
  • False
Ignore configuration checks about inconsistent module configuration. Especially for mpm_* modules.
name
yes
name of the module to enable/disable
state
no present
  • present
  • absent
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
warnings
list of warning messages
when needed list
stdout
stdout of underlying command
failed string
result
message about action taken
always string
stderr
stderr of underlying command
failed string
rc
return code of underlying command
failed int

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–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/apache2_module_module.html