diff --git a/defaults/main.yml b/defaults/main.yml index 22aca34..df99725 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,6 +14,9 @@ vhosts: [] # aliases: # - dest: my_page # src: /var/www/my_page + # scriptaliases: + # - dest: my_page + # src: /var/www/my_page # directories: # - path: /var/www/host.example.org/custom_dir # options: @@ -22,6 +25,14 @@ vhosts: [] # allow_override: None # require: 'all granted' # custom_code: "" + # directoriesmatches: + # - path: /var/www/host.example.org/custom_dir + # options: + # - '-Indexes' + # - '-FollowSymLinks' + # allow_override: None + # require: 'all granted' + # custom_code: "" # custom_code: "" # ldap: # url: ldap://ldap.example.org/ou=People,ou=Users,dc=example,dc=org?uid diff --git a/meta/main.yml b/meta/main.yml index 8d728a2..23d670c 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -17,6 +17,6 @@ galaxy_info: - focal - jammy - galaxy_tags: []# TODO + galaxy_tags: [] # TODO -dependencies: [] \ No newline at end of file +dependencies: [] diff --git a/templates/vhost.conf.j2 b/templates/vhost.conf.j2 index 5365fe5..534be7a 100644 --- a/templates/vhost.conf.j2 +++ b/templates/vhost.conf.j2 @@ -35,6 +35,9 @@ Alias /{{ alias.dest }} "{{ alias.src }}" {% endfor %}{% endif %} +{% if item.scriptaliases is defined %}{% for alias in item.scriptaliases %} + ScriptAlias /{{ alias.dest }} "{{ alias.src }}" +{% endfor %}{% endif %} {% if item.docroot is defined %} ## Vhost docroot DocumentRoot "{{ item.docroot | default("/var/www/" + item.vhostname ) }}/" @@ -64,6 +67,17 @@ {{ directory.custom_code | default("") }} {% endfor %}{% endif %} +{% if item.directoriesmatches is defined %}{% for directorymatch in item.directoriesmatches %} + +{% if directorymatch.options is defined %} + Options {% for option in directorymatch.options %}{{ option }} {% endfor %} +{% endif %} + + AllowOverride {{ directorymatch.allow_override | default("All") }} + Require {{ directorymatch.require | default("all granted") }} + {{ directorymatch.custom_code | default("") }} + {% endfor %}{% endif %} + ## Logging ErrorLog "/var/log/apache2/{{ item.vhostname }}_error_ssl.log" ServerSignature Off