Skip to content

Commit

Permalink
Add distro dependent stuff in templates too.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Oct 17, 2018
1 parent 330e41a commit 18ceb06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
To test this role locally please use [Molecule](https://github.com/metacloud/molecule):
```
pip install molecule
molecule test --scenario-name fedora-latest
molecule test
```
There are many scenarios available, please have a look in the `molecule/` directory.

Expand Down
4 changes: 1 addition & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

- name: install requirements
pip:
name: "{{ item }}"
name: "{{ httpd_requirements }}"
state: present
with_items:
- "{{ httpd_requirements }}"

- name: modify selinux settings
seboolean:
Expand Down
2 changes: 1 addition & 1 deletion templates/default_vhost.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
NameVirtualHost *:{{ httpd_port }}
<VirtualHost *:{{ httpd_port }}>
ServerName {{ httpd_servername }}
DocumentRoot "{{ httpd_data_directory }}"
DocumentRoot "{{ httpd_data_directory[ansible_distribution] | default(httpd_data_directory['default']) }}"
Redirect permanent / https://{{ httpd_servername }}
</VirtualHost>
6 changes: 3 additions & 3 deletions templates/ssl.conf.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ ansible_managed | comment }}
LoadModule ssl_module {{ httpd_mod_ssl }}
LoadModule ssl_module {{ httpd_mod_ssl[ansible_distribution] | default(httpd_mod_ssl['default']) }}

Listen {{ httpd_ssl_port }}
<VirtualHost *:{{ httpd_ssl_port }}>
ServerName {{ httpd_ssl_servername }}
SSLEngine on
SSLCertificateFile "{{ httpd_config_directory }}/ssl/{{ httpd_ssl_servername }}.crt"
SSLCertificateKeyFile "{{ httpd_config_directory }}/ssl/{{ httpd_ssl_servername }}.key"
SSLCertificateFile "{{ httpd_config_directory[ansible_distribution] | default(httpd_config_directory['default']) }}/ssl/{{ httpd_ssl_servername }}.crt"
SSLCertificateKeyFile "{{ httpd_config_directory[ansible_distribution] | default(httpd_config_directory['default']) }}/ssl/{{ httpd_ssl_servername }}.key"
</VirtualHost>

0 comments on commit 18ceb06

Please sign in to comment.