Ansible Role for Apache2 VirtualHost Management.
This role require Ansible 2.0 or higher.
This role was designed for Ubuntu Server 14.04 LTS and Ubuntu Server 16.04 LTS.
parameter | required | default | choices | comments |
---|---|---|---|---|
apache2_vhosts_base | yes | {{ apache2_vhosts_home }} | VirtualHost base directory. | |
apache2_vhosts_custom_log | yes | defaults/main.yml | Sets filename and format of log file. | |
apache2_vhosts_document_root | yes | defaults/main.yml | Directory that forms the main document tree visible from the web. | |
apache2_vhosts_error_log | yes | defaults/main.yml | Location where the server will log errors. | |
apache2_vhosts_gid | no | Specifying the GID for shared storage. NOTE: This value should only be set once before deploying and then never changed. | ||
apache2_vhosts_handler_php | yes | defaults/main.yml | Forces all matching files with \.php$ to be processed by a handler. |
|
apache2_vhosts_hash_salt | yes | Specific password hash salt for sha512. | ||
apache2_vhosts_home | yes | defaults/main.yml | Location for the virtual host user home directory. | |
apache2_vhosts_http_port | yes | 80 | Apache2 VirtualHost HTTP port. | |
apache2_vhosts_https_port | yes | 443 | Apache2 VirtualHost HTTPS port. | |
apache2_vhosts_id | yes | Unique ID for virtual host shared among other services. | ||
apache2_vhosts_pass | yes | Password for virtual host user. | ||
apache2_vhosts_proxy_pass | no | Maps remote servers into the local server URL-space. | ||
apache2_vhosts_proxy_pass_reverse | no | Adjusts the URL in HTTP response headers sent from a reverse proxied server. | ||
apache2_vhosts_proxy_preserve_host | yes |
|
Use incoming Host HTTP request header for proxy request. | |
apache2_vhosts_proxy_request | no |
|
Enables forward (standard) proxy requests. | |
apache2_vhosts_proxy_via | yes |
|
Information provided in the Via HTTP response header for proxied requests. | |
apache2_vhosts_redirect | no | defaults/main.yml | Sends an external redirect asking the client to fetch a different URL. | |
apache2_vhosts_server_admin | yes | defaults/main.yml | Email address that the server includes in error messages sent to the client. | |
apache2_vhosts_server_alias | no | [] |
|
Alternate names for a host used when matching requests to name-virtual hosts. |
apache2_vhosts_server_name | yes | Hostname and port that the server uses to identify itself. | ||
apache2_vhosts_ssl_certificate_chain_file | no | File of PEM-encoded Server CA Certificates. | ||
apache2_vhosts_ssl_certificate_file | no | defaults/main.yml | Server PEM-encoded X.509 certificate data file. | |
apache2_vhosts_ssl_certificate_key_file | no | defaults/main.yml | Server PEM-encoded private key file. | |
apache2_vhosts_ssl_engine | no |
|
SSL Engine Operation Switch. | |
apache2_vhosts_uid | no | Specifying the UID for shared storage. NOTE: This value should only be set once before deploying and then never changed. | ||
apache2_vhosts_user | yes | Username for virtual host user. |
No additional role dependencies.
- hosts: all
roles:
- role: hswong3i.apache2_vhosts
apache2_vhosts_hash_salt: "wi6Eereiwae7phae"
apache2_vhosts_id: "example"
apache2_vhosts_pass: "xaivoo9Z"
apache2_vhosts_server_name: "example.com"
apache2_vhosts_user: "example"
- Wong Hoi Sing Edison