An Ansible role that installs Apache Web Server and configures it. It is currently used and tested for RHEL / CentOS 6 but may also work for 7. This Role has also a skeleteon for Debian based distributions.
- Ansible 2+
Variables with defaults:
apache_config_dir: '/etc/httpd/conf.d'
apache_use_ssl: 'no'
apache_user: 'apache'
apache_vhost_desired: 'no'
You can set this var to simple string values:
apache_virtual_hostname: 'hostname.domainname.edu'
Be careful: It has to be set if you want to use ssl with apache_use_ssl
Configure ssl certificate variables like paths if apache_use_ssl
is set, e.g.:
apache_ssl_cert_file: '/etc/ssl/yourcert.pem'
apache_ssl_cert_key_file: '/etc/ssl/yourkey.key'
If you wish you can also provide a chain file extra:
apache_ssl_cert_key_file: '/etc/ssl/yourchainfile.pem'
Feel Free to define your own variables for different apache modules. Please use the config dir and avoid hacking the httpd.conf
main config file.
None.
Add to requirements.yml
:
---
- src: sloan87.httpd
...
Download:
$ ansible-galaxy install -r requirements.yml
Write a top-level playbook:
---
- name: head server
hosts: head
roles:
- role: sloan87.httpd
tags:
- apache
- httpd
- webserver
...
Define the role dependency in meta/main.yml
:
---
dependencies:
- role: sloan87.httpd
tags:
- apache
- httpd
- webserver
...
MIT
This role was created in 2018 by Ben Langenberg aka sloan87 at GitHub