aboutsummaryrefslogtreecommitdiffstats
path: root/roles/apache_vhost/tasks
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-02-04 01:23:43 -0500
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-02-04 01:52:13 -0500
commit0261e875679f1bf63c8d689da7fc7e014597885d (patch)
tree3f19cd74a0c1070944f75437f30b098d6ef2ffcb /roles/apache_vhost/tasks
downloadselfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.tar.gz
selfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.zip
initial commit
Diffstat (limited to 'roles/apache_vhost/tasks')
-rw-r--r--roles/apache_vhost/tasks/main.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/apache_vhost/tasks/main.yml b/roles/apache_vhost/tasks/main.yml
new file mode 100644
index 0000000..ebe6fe6
--- /dev/null
+++ b/roles/apache_vhost/tasks/main.yml
@@ -0,0 +1,18 @@
+- name: request https certificate
+ include_role:
+ name: '{{ "certbot" if apache_letsencrypt else "getcert_request" }}'
+ vars:
+ certificate_sans: '{{ [apache_server_name] + apache_server_aliases }}'
+ certificate_path: '{{ apache_certificate_path }}'
+ certificate_key_path: '{{ apache_certificate_key_path }}'
+ certificate_use_apache: yes
+ certificate_hook: systemctl reload httpd
+ when: apache_use_ssl
+
+- name: generate vhost configuration
+ template:
+ src: etc/httpd/conf.d/vhost.conf.j2
+ dest: /etc/httpd/conf.d/vhost-{{ '000-default' if apache_default_vhost else (apache_config_name | default(apache_server_name)) }}.conf
+ mode: 0640
+ lstrip_blocks: yes
+ notify: reload apache