Files
test/roles/ensure_apache
jmrothst 4078b0b064 refactor(roles): remove redundant post-task service and package assertions
Eliminate post-verification discovery and assert tasks (service_facts
and package_facts) across all 19 roles and align AGENTS.md.

Ansible's built-in declarative modules (package, service) already enforce
target state natively and abort execution immediately on failure. The
subsequent assertion loops were redundant, added significant runtime
overhead, and produced false positives on non-service systemd units
(.socket, .timer) and service aliases (e.g., dbus.socket failing under
service_facts).

- Remove service_facts and Assert Managed Services Are Active across
  11 service roles (ensure_apache, ensure_cockpit, ensure_dbus,
  ensure_dovecot, ensure_fail2ban, ensure_firewalld, ensure_gitea,
  ensure_mariadb, ensure_podman, ensure_postfix, ensure_timezone).
- Remove package_facts and Assert Managed Packages Are Installed across
  8 package roles (ensure_ansible_prereq, ensure_git, ensure_os_patch,
  ensure_os_upgrade, ensure_repo_epel, ensure_repo_rpmfusion,
  ensure_rsync, ensure_vim).
- Update AGENTS.md Section 8.2, Section 10, and Section 21 to codify
  declarative state enforcement and prohibit redundant post-task
  assertion loops.
2026-09-07 23:34:19 -05:00
..
2026-08-11 00:28:29 -05:00

Role Name

A brief description of the role goes here.

Requirements

Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.

Feature List

  • Apache deployed
  • Enables HTTP/2
  • Enables and convets connections to HTTPS by default
  • ACME based TLS Certificate request and renewal
  • ACME uses Lets Encrypt by default, alternative ACME Providers may be specified
  • Optionally act as a proxy to another URL
  • Optionally redirect traffic to another URL
  • Optionally populate DocumentRoot with git clone
  • Multiple DocumentRoots supported, with aliases

Role Variables

  • Lets Encrypt configuration

  • Web Host variable of type list

    • http_vhost
  • required dictionary elements

    • fqdn : The FQDN of the website
  • optional dictionary elements

    • aliases : list of alternative FQDN for the website
    • proxy : URL to direct traffic for the FQDN to, e.g. http://localhost:8080
    • redirect : Where should we send traffic?
    • repo : git URL of website repo to clone/update
lets_encrypt_admin: 'acme@example.com'
lets_encrypt_url: 'https://ipa.example.com'
http_vhost:
  - fqdn: 'www.example.com'
    aliases:
      - 'exmaple.com'
    proxy: 'http://localhost:8080'

Dependencies

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - { role: username.rolename, x: 42 }

License

BSD

Author Information

An optional section for the role authors to include contact information, or a website (HTML is not allowed).