mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-05 01:20:18 +01:00
Fixes #173, gets it working on RHEL 8 and removes deprecated usage of bare variable.
This commit is contained in:
parent
ce47d61e3b
commit
cf6003a500
4 changed files with 17 additions and 5 deletions
|
@ -36,7 +36,7 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart apache
|
notify: restart apache
|
||||||
when: apache_create_vhosts
|
when: apache_create_vhosts | bool
|
||||||
|
|
||||||
- name: Add vhost symlink in sites-enabled.
|
- name: Add vhost symlink in sites-enabled.
|
||||||
file:
|
file:
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
dest: "{{ apache_conf_path }}/sites-enabled/{{ apache_vhosts_filename }}"
|
dest: "{{ apache_conf_path }}/sites-enabled/{{ apache_vhosts_filename }}"
|
||||||
state: link
|
state: link
|
||||||
notify: restart apache
|
notify: restart apache
|
||||||
when: apache_create_vhosts
|
when: apache_create_vhosts | bool
|
||||||
|
|
||||||
- name: Remove default vhost in sites-enabled.
|
- name: Remove default vhost in sites-enabled.
|
||||||
file:
|
file:
|
||||||
|
|
|
@ -21,4 +21,16 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart apache
|
notify: restart apache
|
||||||
when: apache_create_vhosts
|
when: apache_create_vhosts | bool
|
||||||
|
|
||||||
|
- name: Check if localhost cert exists (RHEL 8 and later).
|
||||||
|
stat:
|
||||||
|
path: /etc/pki/tls/certs/localhost.crt
|
||||||
|
register: localhost_cert
|
||||||
|
when: ansible_distribution_major_version >= 8
|
||||||
|
|
||||||
|
- name: Ensure httpd certs are installed (RHEL 8 and later).
|
||||||
|
command: /usr/libexec/httpd-ssl-gencerts
|
||||||
|
when:
|
||||||
|
- ansible_distribution_major_version >= 8
|
||||||
|
- not localhost_cert.stat.exists
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart apache
|
notify: restart apache
|
||||||
when: apache_create_vhosts
|
when: apache_create_vhosts | bool
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart apache
|
notify: restart apache
|
||||||
when: apache_create_vhosts
|
when: apache_create_vhosts | bool
|
||||||
|
|
Loading…
Reference in a new issue