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_arch
- 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:80Optional default server name
apache_default_server_name:apache_default_server_name: server.example.comPath to error page files
apache_error_pages: errorTarget system architecture of the binary
apache_exporter_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' or ansible_architecture == 'arm64' else 'amd64' }}"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-{{ apache_exporter_arch }}.tar.gzEnable the installation of the apache exporter
apache_exporter_enabled: trueScrape 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/?autoVersion of the apache exporter to install
apache_exporter_version: 1.1.0List of additional modules to enable
apache_extra_modules: []apache_extra_modules:
- proxy
- name: ssl
state: present
- name: foobar
state: absentList 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: presentapache_general_modules:
- proxy
- name: ssl
state: present
- name: foobar
state: absentList of packages to install
apache_general_packages:
- apache2
- apachetop
- libapache2-mod-rpafOptional content for index page
apache_index_content:Keep an empty index page
apache_keep_index: trueList of language priorities for error pages
apache_language_priority:
- de
- en
- cs
- es
- fr
- it
- nl
- sv
- pt-br
- roList of ports to listen to
apache_listen:
- 80apache_listen:
- 80
- 127.0.0.1:8080Email address of server admin
apache_server_admin: hostmaster@localhostDisplay server version and virtual host name
apache_server_signature: OffWhat you return as the server HTTP response
apache_server_tokens: ProdAllow TRACE method for the webserver
apache_trace_enable: Offapache
apache-exporter
Apache-2.0