Fixes #173, gets it working on RHEL 8 and removes deprecated usage of bare variable.

This commit is contained in:
Jeff Geerling 2019-07-23 15:01:49 -05:00
parent ce47d61e3b
commit cf6003a500
4 changed files with 17 additions and 5 deletions

View file

@ -36,7 +36,7 @@
group: root
mode: 0644
notify: restart apache
when: apache_create_vhosts
when: apache_create_vhosts | bool
- name: Add vhost symlink in sites-enabled.
file:
@ -44,7 +44,7 @@
dest: "{{ apache_conf_path }}/sites-enabled/{{ apache_vhosts_filename }}"
state: link
notify: restart apache
when: apache_create_vhosts
when: apache_create_vhosts | bool
- name: Remove default vhost in sites-enabled.
file:

View file

@ -21,4 +21,16 @@
group: root
mode: 0644
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

View file

@ -16,4 +16,4 @@
group: root
mode: 0644
notify: restart apache
when: apache_create_vhosts
when: apache_create_vhosts | bool

View file

@ -21,4 +21,4 @@
group: root
mode: 0644
notify: restart apache
when: apache_create_vhosts
when: apache_create_vhosts | bool