buluma.httpd

Ansible Role httpd

This role helps you install and set up httpd on your system.

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

Example Playbook

Here is an example playbook from molecule/default/converge.yml that is tested with each code change.

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

  vars_files:
    - ../../vars/main.yml
    - ../../defaults/main.yml

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

  roles:
    - role: buluma.httpd
      # https_ssl_enable: true
      httpd_port: 8080
      httpd_ssl_port: 8443
      httpd_locations:
        - name: my_location
          location: /my_location
          backend_url: "http://localhost:8080/myapplication"
      httpd_directories:
        - name: my_directory
          path: "{{ httpd_data_directory }}/my_directory"
          allow_override: All

Make sure your machine is ready. In CI, this is done with molecule/default/prepare.yml:

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

  roles:
    - role: buluma.bootstrap
    - role: buluma.epel
    - role: buluma.buildtools
    - role: buluma.python_pip
    - role: buluma.openssl
      openssl_items:
        - name: apache-httpd
          common_name: "{{ ansible_fqdn }}"

You can also see a full explanation and example of how to use these roles.

Role Variables

Default values for the variables can be found in defaults/main.yml:

---
# defaults file for httpd

httpd_servername: "{{ ansible_fqdn }}"
httpd_port: 80
https_ssl_enable: false
httpd_ssl_servername: "{{ ansible_fqdn }}"
httpd_ssl_port: 443
httpd_openssl_crt: "{{ httpd_openssl_crt_directory }}/apache-httpd.crt"
httpd_openssl_key: "{{ httpd_openssl_key_directory }}/apache-httpd.key"
httpd_remove_example: false
httpd_additional_modules: []
httpd_custom_modules_to_activate_with_command: []
apache_global_vhost_settings: |
  DirectoryIndex index.php index.html
vhost_conf_template: vhost.conf.j2
default_vhost_conf: default_vhost.conf

Requirements

State of Used Roles

These roles help prepare your system. You can also prepare your system in different ways.

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version
buluma.buildtools Ansible Molecule Version
buluma.epel Ansible Molecule Version
buluma.openssl Ansible Molecule Version
buluma.python_pip Ansible Molecule Version
buluma.selinux Ansible Molecule Version

Context

This role works with other compatible roles. You can check these roles' documentation for more information.

Compatibility

This role has been tested on these container images:

container tags
EL 8, 9
Debian all
Fedora all
opensuse all
Ubuntu jammy, focal, bionic, lunar, noble

You need at least Ansible version 2.12 to use this role, and it has been tested on earlier and newer versions.

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

Changelog

You can view the history of changes for this role here.

License

This role is licensed under Apache-2.0.

Author Information

Created by Shadow Walker.

Informazioni sul progetto

Install and configure httpd on your system.

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