Ansible role to install and configure an Apache webserver.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- apache_default_server_listen
- apache_default_server_name
- apache_error_pages
- apache_exporter_args
- apache_exporter_download
- apache_exporter_enabled
- apache_exporter_scrape_uri
- apache_exporter_version
- apache_extra_modules
- apache_extra_packages
- apache_general_modules
- apache_general_packages
- apache_index_content
- apache_keep_index
- apache_language_priority
- apache_listen
- apache_server_admin
- apache_server_signature
- apache_server_tokens
- apache_trace_enable
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
Listening address of default vhost
apache_default_server_listen: 0.0.0.0:80
Optional default server name
apache_default_server_name:
apache_default_server_name: server.example.com
Path to error page files
apache_error_pages: error
Optional list of additional arguments for the apache exporter
apache_exporter_args: []
URL to the apache exporter to install
apache_exporter_download: https://github.com/Lusitaniae/apache_exporter/releases/download/v{{
apache_exporter_version }}/apache_exporter-{{ apache_exporter_version }}.linux-amd64.tar.gz
Enable the installation of the apache exporter
apache_exporter_enabled: true
Scrape URI of the exporter
apache_exporter_scrape_uri: http://{{ 'localhost' if apache_default_server_listen
== '0.0.0.0:80' else apache_default_server_listen }}/server-status/?auto
Version of the apache exporter to install
apache_exporter_version: 1.0.10
List of additional modules to enable
apache_extra_modules: []
apache_extra_modules:
- proxy
- name: ssl
state: present
- name: foobar
state: absent
List of additional packages to install
apache_extra_packages: []
List of modules to enable
apache_general_modules:
- name: rpaf
state: present
- name: ssl
state: present
- name: rewrite
state: present
- name: include
state: present
- name: alias
state: present
- name: negotiation
state: present
apache_general_modules:
- proxy
- name: ssl
state: present
- name: foobar
state: absent
List of packages to install
apache_general_packages:
- apache2
- apachetop
- libapache2-mod-rpaf
Optional content for index page
apache_index_content:
Keep an empty index page
apache_keep_index: true
List of language priorities for error pages
apache_language_priority:
- de
- en
- cs
- es
- fr
- it
- nl
- sv
- pt-br
- ro
List of ports to listen to
apache_listen:
- 80
apache_listen:
- 80
- 127.0.0.1:8080
Email address of server admin
apache_server_admin: hostmaster@localhost
Display server version and virtual host name
apache_server_signature: Off
What you return as the server HTTP response
apache_server_tokens: Prod
Allow TRACE method for the webserver
apache_trace_enable: Off
apache
apache-exporter
Apache-2.0