No description
Find a file
Mark van Huijstee 54fdb75491
Merge pull request #49 from de-it-krachten/dev
Update supported platforms & CI (2026-07-23)
2026-07-26 21:50:05 +02:00
.github/workflows Update CI 2026-07-22 22:54:52 +02:00
defaults Fix CI 2026-06-08 12:26:42 +02:00
handlers feat: Move to FQCN 2022-10-07 19:13:18 +02:00
meta Update CI 2026-03-14 19:01:36 +01:00
molecule/default Update CI 2026-07-25 16:12:06 +02:00
tasks feat: Add support for ansible-core 2.20+ 2026-06-07 16:24:17 +02:00
templates fix: Fix support for (Open)SUSE 2023-08-14 10:40:22 +02:00
.ansible-lint Update CI 2026-06-07 16:38:03 +02:00
.cicd Update CI 2026-06-09 10:39:02 +02:00
.cicd.overwrite Update CI 2026-06-07 16:38:03 +02:00
.collections Fix .collections 2022-10-07 21:09:30 +02:00
.gitignore feat: Update supported platforms & CI 2024-12-29 01:06:07 +01:00
.releaserc.yml Update CI 2026-03-06 20:41:33 +01:00
.roles feat: Update CI to latest standards 2022-10-07 19:14:03 +02:00
.yamllint feat: Update supported platforms & CI 2024-12-29 01:06:07 +01:00
CHANGELOG.md chore(release): 1.11.0 [skip ci] 2026-07-23 18:00:22 +00:00
README.md Fix CI 2026-06-08 12:26:42 +02:00

CI

ansible-role-apache

Manages apache webserver

Dependencies

Roles

None

Collections

None

Platforms

Supported platforms

  • Red Hat Enterprise Linux 81
  • Red Hat Enterprise Linux 91
  • Red Hat Enterprise Linux 101
  • RockyLinux 8
  • RockyLinux 9
  • RockyLinux 10
  • OracleLinux 8
  • OracleLinux 9
  • OracleLinux 10
  • AlmaLinux 8
  • AlmaLinux 9
  • AlmaLinux 10
  • Debian 11 (Bullseye)
  • Debian 12 (Bookworm)
  • Debian 13 (Trixie)
  • Ubuntu 20.04 LTS
  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS
  • Ubuntu 26.04 LTS

Note: 1 : no automated testing is performed on these platforms

Role Variables

defaults/main.yml


# Main path to create vhosts into
apache_wwwdir: /var/www
apache_vhostdir: /var/www

# List of vhosts
apache_vhosts: []

# SSL private + certificate store
apache_ssl_certs_path: "{{ '/etc/pki/tls/certs' if ansible_facts.os_family == 'RedHat' else '/etc/ssl/certs' }}"
apache_ssl_priv_path: "{{ '/etc/pki/tls/private' if ansible_facts.os_family == 'RedHat' else '/etc/ssl/private' }}"

# SSL/TLS keys
apache_ssl: true
apache_ssl_key: "{{ apache_ssl_priv_path }}/{{ apache_fqdn }}.key"
apache_ssl_crt: "{{ apache_ssl_certs_path }}/{{ apache_fqdn }}.crt"
apache_ssl_chain: "{{ apache_ssl_certs_path }}/{{ apache_fqdn }}.chain.crt"
apache_ssl_fullchain: "{{ apache_ssl_certs_path }}/{{ apache_fqdn }}.fullchain.crt"

# SSL/TLS settings
apache_ssl_settings:
  Listen: "443 {{ '127.0.0.1:' if (sslh_active is defined and sslh_active|bool) }}https"
  SSLCertificateFile: '{{ apache_ssl_crt }}'
  SSLCertificateKeyFile: '{{ apache_ssl_key }}'
  SSLCertificateChainFile: '{{ apache_ssl_chain }}'
  SSLProtocol: 'all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1'
  SSLCipherSuite: 'HIGH:!aNULL:!MD5:!3DES:!SEED:!IDEA'
  SSLHonorCipherOrder: 'on'

# Defaul firewall ports
apache_fw_ports:
  - { port: 80, proto: tcp }
  - { port: 443, proto: tcp }

defaults/family-Debian.yml


# SSL private + certificate store
apache_ssl_certs_path: /etc/ssl/certs
apache_ssl_priv_path: /etc/ssl/private

# Packages required
apache_packages:
  - apache2
  - apache2-utils
  - openssl

# log directory
apache_logdir: /var/log/apache2

# Apache service
apache_service: apache2

# Apache configuration directory
apache_conf_dir: /etc/apache2/sites-available

# Apache SSL configuration
apache_ssl_conf: /etc/apache2/sites-available/default-ssl.conf

# Default user / group
apache_user: www-data
apache_group: www-data

defaults/family-RedHat.yml


# SSL private + certificate store
apache_ssl_certs_path: /etc/pki/tls/certs
apache_ssl_priv_path: /etc/pki/tls/private

# Packages required
apache_packages:
  - httpd
  - mod_ssl
  - openssl

# log directory
apache_logdir: /var/log/httpd

# Apache service
apache_service: httpd

# Apache configuration directory
apache_conf_dir: /etc/httpd/conf.d

# Apache SSL configuration
apache_ssl_conf: /etc/httpd/conf.d/ssl.conf

# Default user / group
apache_user: apache
apache_group: apache

# Main path to create vhosts into
apache_wwwdir: /var/www
apache_vhostdir: /var/www

defaults/family-Suse.yml


# Main path to create vhosts into
# apache_wwwdir: /srv/www
# apache_vhostdir: /srv/www

# SSL private + certificate store
apache_ssl_certs_path: /etc/ssl/certs
apache_ssl_priv_path: /etc/ssl/private

# Packages required
apache_packages:
  - apache2
  - apache2-utils
  - apache2-mod_nss
  - openssl

# log directory
apache_logdir: /var/log/apache2

# Apache service
apache_service: apache2

# Apache configuration directory
apache_conf_dir: /etc/apache2/conf.d

# Apache SSL configuration
apache_ssl_conf: /etc/apache2/ssl-global.conf

# Default user / group
apache_user: wwwrun
apache_group: wwwrun

Example Playbook

molecule/default/converge.yml


- name: sample playbook for role 'apache'
  hosts: all
  become: 'yes'
  vars:
    molecule_driver: '{{ lookup(''env'', ''MOLECULE_DRIVER_NAME'') }}'
    openssl_fqdn: server.example.com
    openssl_fqdn_additional:
      - vhost1.example.com
      - vhost2.example.com
    apache_fqdn: server.example.com
    apache_ssl_key: '{{ openssl_server_key }}'
    apache_ssl_crt: '{{ openssl_server_crt }}'
    apache_ssl_chain: '{{ openssl_server_crt }}'
    apache_index_html: true
    apache_vhosts:
      - vhost: vhost1.example.com
        alias: vhost1-alias.example.com
        domain: vhost1.example.com
        template: vhost.conf.j2
        listen: '*'
        port: '443'
        ssl: true
        ssl_copy: true
        ssl_key: files/vhost1.example.com.key
        ssl_crt: files/vhost1.example.com.crt
        ssl_chain: files/vhost1.example.com.crt
        index_html: true
        allow_override_all: true
        require_all_granted: true
      - vhost: vhost2.example.com
        alias: vhost2-alias.example.com
        domain: vhost2.example.com
        template: vhost.conf.j2
        listen: '*'
        port: '443'
        ssl: true
        ssl_copy: true
        ssl_key: '{{ openssl_server_key }}'
        ssl_crt: '{{ openssl_server_crt }}'
        ssl_chain: '{{ openssl_server_crt }}'
        index_html: true
        allow_override_all: true
        require_all_granted: true
  roles:
    - deitkrachten.openssl
  tasks:
    - name: Include role 'apache'
      ansible.builtin.include_role:
        name: apache