make it work on debian, restore certificate management
This commit is contained in:
+11
-3
@@ -1,12 +1,13 @@
|
||||
---
|
||||
# tasks file for apache_vhost
|
||||
|
||||
- include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: create dedicated user
|
||||
user:
|
||||
name: "{{ apache_user }}"
|
||||
groups:
|
||||
- apache
|
||||
- "{{ apache_group }}"
|
||||
home: "{{ apache_base_dir }}"
|
||||
shell: /bin/bash
|
||||
when: apache_user_password is not defined and apache_user != 'apache'
|
||||
@@ -26,7 +27,7 @@
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: "{{ apache_user }}"
|
||||
group: apache
|
||||
group: "{{ apache_group }}"
|
||||
mode: 0750
|
||||
loop:
|
||||
- "{{ apache_base_dir }}"
|
||||
@@ -39,6 +40,13 @@
|
||||
include_tasks: dns.yml
|
||||
when: apache_use_dns
|
||||
|
||||
- name: remove default site
|
||||
ansible.builtin.file:
|
||||
path: /etc/apache2/sites-enabled/000-default.conf
|
||||
state: absent
|
||||
notify: restart apache
|
||||
when: ansible_os_family| lower == 'debian'
|
||||
|
||||
- name: create certificate
|
||||
include_tasks: certbot.yml
|
||||
when: apache_use_ssl
|
||||
@@ -46,7 +54,7 @@
|
||||
- name: vhost config file
|
||||
template:
|
||||
src: vhost.conf.jj
|
||||
dest: /etc/httpd/conf.d/{{ apache_server_name }}.conf
|
||||
dest: "{{ apache_config_dir }}/{{ apache_server_name }}.conf"
|
||||
mode: 0644
|
||||
notify: restart apache
|
||||
|
||||
|
||||
Reference in New Issue
Block a user