###Ansible playbook to add an Apache virtual host and ftp user. On Debian the config is added to /etc/apache2/sites-available/ while on RHEL is added to /etc/httpd/conf.d/. See apache_dir variable for that. Does reload apache.
Usage:
ansible-playbook -i inventory vhost.yml
Explanation for each variable:
site_url ==> Self explanatory. Do not use www.
apache_port ==> Default 80.
log_format ==> Apache log format.
ftp_user ==> I hope I don't need to explain this.
ftp_home ==> FTP home. Also vhost DocumentRoot.
ftp_password ==> Same as above.
ftp_shell ==> Pretty clear, default is /bin/false
OS family variables:
apache_logs ==> Full path to apache log folder.
apache_dir ==> Full path to apache configuration folder.
apache_group ==> Apache group