Skip to content

Commit d3d7faa

Browse files
committed
Support local path context mappings
1 parent 39aefb4 commit d3d7faa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ tomcat_enable_manager: false
8989
tomcat_manager_remoteaddr_allow: "127\\.0\\.0\\.1"
9090
tomcat_manager_password: 'SETME'
9191

92+
tomcat_local_mapping: {}
93+
9294
tomcat_rewrite_rules: []
9395

9496
tomcat_start_service: false

templates/catalina_base.conf.server.xml.j2

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@
5858
allow="{{ tomcat_manager_remoteaddr_allow }}" />
5959
</Context>
6060
{% endif %}
61-
61+
{% for mapping in tomcat_local_mapping %}
62+
<Context path="{{ mapping.path }}" docBase="{{ mapping.docbase }}">
63+
{% if mapping.limit_allow is defined %}
64+
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
65+
allow="{{ mapping.limit_allow }}" />
66+
{% endif %}
67+
</Context>
68+
{% endfor %}
6269
</Host>
6370
</Engine>
6471
</Service>

0 commit comments

Comments
 (0)