Skip to content

Commit

Permalink
Use Debians sites-available, sites-enabled structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Jan 7, 2025
1 parent 2fe78ad commit c627db8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- role: robertdebock.epel
- role: robertdebock.buildtools
- role: robertdebock.python_pip
python_pip_update: false
- role: robertdebock.openssl
openssl_items:
- name: apache-httpd
Expand Down
13 changes: 13 additions & 0 deletions tasks/vhosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,16 @@
notify:
- Test httpd configuration validity
- Restart httpd

- name: vhosts | Enable vhosts
ansible.builtin.command:
cmd: "a2ensite {{ item.name }}"
creates: "{{ httpd_vhosts_enabled_directory }}/{{ item.name }}.conf"
loop: "{{ httpd_vhosts }}"
loop_control:
label: "{{ item.name }}"
when:
- ansible_os_family == 'Debian'
notify:
- Test httpd configuration validity
- Restart httpd
4 changes: 3 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ httpd_config_dest: "{{ _httpd_config_dest[ansible_os_family] }}"
_httpd_vhosts_directory:
default: "{{ httpd_server_root }}/conf.d"
Alpine: "{{ httpd_server_root }}/conf.d"
Debian: "{{ httpd_server_root }}/sites-enabled"
Debian: "{{ httpd_server_root }}/sites-available"
Suse: "{{ httpd_server_root }}/conf.d"

httpd_vhosts_directory: "{{ _httpd_vhosts_directory[ansible_os_family] | default(_httpd_vhosts_directory['default']) }}"

httpd_vhosts_enabled_directory: "{{ httpd_server_root }}/sites-enabled"

# Some distributions have the "Listen" parameters somewhere else.
_httpd_ports_conf:
Debian: ports.conf
Expand Down

0 comments on commit c627db8

Please sign in to comment.