An Ansible Role that installs Apache from the distribution packages with a default virtual host and common modules enabled, specifically created with Phansible in mind.
- Ubuntu 22.04, 24.04, 26.04 or Debian 12, 13
- Ansible 2.15 or newer, with the
community.generalcollection (shipped with theansiblepackage)
Available variables are listed below, along with default values (see defaults/main.yml):
apache:
docroot: "/vagrant"
servername: "myApp.vb"apache.docroot: document root of the default virtual host, withAllowOverride All.apache.servername:ServerNameof the default virtual host.
The role also enables rewrite, vhost_alias, headers, expires and filter, and sets ServerSignature Off and ServerTokens Prod.
None.
- hosts: all
become: yes
vars:
apache:
docroot: /var/www/app/public
servername: app.test
roles:
- role-apacheThis role is released under the terms of the license specified in the repository or if not specified, under the MIT license.
This role was created in 2015 by The Phansible Team & Contributors, credits go also to Jeff Geerling, author of Ansible for DevOps and source of inspiration.