buluma.apache

Ansible role apache

This role installs Apache 2.x on Linux.

GitHub Version Issues Pull Requests Downloads
github Version Issues PullRequests Ansible Role

Example Playbook

Here's an example taken from molecule/default/converge.yml. It is tested automatically with every update.

---
- name: Converge
  hosts: all
  become: true

  vars:
    apache_listen_port_ssl: 443
    apache_create_vhosts: true
    apache_vhosts_filename: "vhosts.conf"
    apache_vhosts:
      - servername: "example.com"
        documentroot: "/var/www/vhosts/example_com"

  pre_tasks:
    - name: Update apt cache.
      apt: update_cache=true cache_valid_time=600
      when: ansible_os_family == 'Debian'
      changed_when: false

  roles:
    - role: buluma.apache

The machine needs to be set up first. In Continuous Integration (CI), this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  gather_facts: false
  become: true

  roles:
    - role: buluma.bootstrap

You can check a full explanation and example on how to use these roles.

Role Variables

Default variable values are set in defaults/main.yml:

---
apache_enablerepo: ""

apache_listen_ip: "*"
apache_listen_port: 80
apache_listen_port_ssl: 443

apache_create_vhosts: true
apache_vhosts_filename: "vhosts.conf"
apache_vhosts_template: "vhosts.conf.j2"

# On Debian/Ubuntu, a default virtualhost is included in Apache’s configuration.
# Set this to `true` to remove that default.
apache_remove_default_vhost: false

apache_global_vhost_settings: |
  DirectoryIndex index.php index.html

apache_vhosts:
  - servername: "local.dev"
    documentroot: "/var/www/html"

apache_allow_override: "All"
apache_options: "-Indexes +FollowSymLinks"

apache_vhosts_ssl: []
apache_ignore_missing_ssl_certificate: true

apache_ssl_protocol: "All -SSLv2 -SSLv3"
apache_ssl_cipher_suite: "AES256+EECDH:AES256+EDH"

# Only used on Debian/Ubuntu.
apache_mods_enabled:
  - rewrite.load
  - ssl.load
apache_mods_disabled: []

# Apache service state; use `started` or `stopped`
apache_state: started

# Apache service status; use `true` or `false`
apache_enabled: true

# Apache state after changes; use `restarted` or `reloaded`
apache_restart_state: restarted

# Apache package state; use `present` to ensure it’s installed, or `latest` to upgrade
apache_packages_state: present

Requirements

State of used roles

To prepare a system, these roles are used. You can also prepare your system differently.

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version

Context

This role fits into a wider set of compatible roles. Find more information in the documentation of these roles.

Here’s a look at related roles:

dependencies

Compatibility

This role works with the following container images:

container tags
EL all
Fedora all
Amazon all
Debian all
Ubuntu all

The minimum Ansible version needed is 2.12. Tests are done on:

  • The previous version.
  • The current version.
  • The development version.

If you find any issues, please report them on GitHub.

Changelog

You can view the Role History.

License

This role is licensed under Apache-2.0.

Author Information

The author is Shadow Walker.

Informazioni sul progetto

Apache 2.x for Linux.

Installa
ansible-galaxy install buluma.apache
Licenza
apache-2.0
Download
111.5k
Proprietario
DevOps Engineer