Skip to content

Commit

Permalink
Allow to not create neutral default page. Add Context to server.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-clara committed Mar 31, 2021
1 parent 305f391 commit f5ee446
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ tomcat_instances:
access_log_pattern: "{{ tomcat_access_log_pattern }}"
service_state: "{{ tomcat_service_state }}"
service_enabled: "{{ tomcat_service_enabled }}"
neutral_default_page: "{{ tomcat_neutral_default_page }}"

# Deploy a neutral default page
tomcat_neutral_default_page: yes

# The explicit version to use when referring to the short name.
tomcat_version7: 7.0.107
Expand All @@ -80,3 +84,4 @@ _tomcat_unarchive_urls:
url: "{{ tomcat_mirror }}/dist/tomcat/tomcat-9/v{{ tomcat_version9 }}/bin/apache-tomcat-{{ tomcat_version9 }}.tar.gz"

tomcat_unarchive_url: "{{ _tomcat_unarchive_urls[tomcat_version].url }}"

2 changes: 2 additions & 0 deletions tasks/instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
owner: "{{ instance.user | default(tomcat_user) }}"
group: "{{ instance.group | default(tomcat_group) }}"
mode: "0640"
when:
- instance.neutral_default_page

- name: loop over config_files
ansible.builtin.include: config_file.yml
Expand Down
7 changes: 6 additions & 1 deletion templates/server.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@
</Realm>

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
unpackWARs="true" autoDeploy="{{ instance.autodeploy|default("true") }}">

{% if instance.context is defined %}
<Context path="{{ instance.context.path }}" docBase="{{ instance.context.docBase }}"
debug="{{ instance.context.debug|default("0") }}" reloadable="{{ instance.context.reloadable|default("true") }}" />
{% endif %}

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
Expand Down

0 comments on commit f5ee446

Please sign in to comment.