robertdebock.httpd
Ansible Role HTTPD
This role helps you install and set up HTTPD (web server) on your system.
GitHub | GitLab | Downloads | Version |
---|---|---|---|
Example Playbook
Here’s an example playbook from molecule/default/converge.yml
. It runs tests with every update.
---
- name: Converge
hosts: all
become: true
gather_facts: true
vars_files:
- ../../vars/main.yml
- ../../defaults/main.yml
roles:
- role: robertdebock.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
Before running the main playbook, prepare your machine using molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
- role: robertdebock.epel
- role: robertdebock.buildtools
- role: robertdebock.python_pip
- role: robertdebock.openssl
openssl_items:
- name: apache-httpd
common_name: "{{ ansible_fqdn }}"
For a full guide on using these roles, check out the complete documentation.
Role Variables
Default variable settings can be found in defaults/main.yml
:
---
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_additionnal_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
- Install the pip packages listed in requirements.txt.
Used Roles
Various roles are needed to set up the system. You may use different methods to prepare your system.
Requirement | GitHub | GitLab |
---|---|---|
robertdebock.bootstrap | ||
robertdebock.buildtools | ||
robertdebock.epel | ||
robertdebock.openssl | ||
robertdebock.python_pip | ||
robertdebock.selinux |
Context
This role works with many other roles. Check out these other roles for more information on usage.
Here’s a visual of related roles:
Compatibility
This role is tested on several Docker images:
Container | Tags |
---|---|
EL | 9 |
Debian | all |
Fedora | all |
Ubuntu | all |
To use this role, you need Ansible version 2.12 or higher. Tests are done on older versions as well.
If you encounter problems, please report them on GitHub.
License
This project is licensed under Apache-2.0.
Author Information
The author of this role is robertdebock. You can consider sponsoring him.
Install and configure httpd on your system.
ansible-galaxy install robertdebock.httpd