Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing required variables to enable HTTPS #49

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
- ansible_facts.services is defined
- ansible_facts.services['tomcat.service'] is defined
- ansible_facts.services['tomcat.service']['state'] is defined
- ansible_facts.services["tomcat.service"]['state'] == 'running'
- ansible_facts.services['tomcat.service']['state'] == 'running'
quiet: true
fail_msg: "Service is not started."

Expand Down
2 changes: 2 additions & 0 deletions roles/jws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Role Defaults
|`tomcat_listen_http_bind_address`| Service bind address | `localhost` |
|`tomcat_listen_http_enabled`| Enable listening on http port | `yes` |
|`tomcat_listen_https_port`| Enable listening on https port | `8443` |
|`tomcat_listen_https_bind_address`| Bind address for https | `::1` |
|`tomcat_listen_https_enabled`| Enable listening on https port | `false` |
|`tomcat_listen_ajp_enabled`| Enable listening on ajp port | `False` |
|`tomcat_listen_ajp_address`| Bind address for ajp | `::1` |
|`tomcat_listen_ajp_port`| Tomcat ajp listen port | `8009` |
Expand Down
2 changes: 2 additions & 0 deletions roles/jws/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ tomcat_listen_http_port: '8080'
tomcat_listen_http_bind_address: 'localhost'
tomcat_listen_http_enabled: 'yes'
tomcat_listen_https_port: '8443'
tomcat_listen_https_bind_address: 'localhost'
tomcat_listen_https_enabled: 'False'

tomcat_listen_ajp_enabled: 'False'
tomcat_listen_ajp_address: '::1'
Expand Down
8 changes: 8 additions & 0 deletions roles/jws/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,19 @@ argument_specs:
default: "yes"
description: "Enable listening on http port"
type: "str"
tomcat_listen_https_enabled:
default: "false"
description: "Enable listening on https connector"
type: "str"
tomcat_listen_https_port:
# line 26 of jws/defaults/main.yml
default: "8443"
description: "Enable listening on https port"
type: "str"
tomcat_listen_https_bind_address:
default: "localhost"
description: "HTTPS Connector bind address"
type: "str"
tomcat_listen_ajp_enabled:
# line 28 of jws/defaults/main.yml
default: "False"
Expand Down
19 changes: 9 additions & 10 deletions roles/jws/templates/server.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,25 @@
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
{% if tomcat.listen.https.enabled is defined %}
{% if tomcat.listen.https.enabled is defined and tomcat.listen.https.enabled %}
<Connector port="{{ tomcat.listen.https.port }}"
protocol="org.apache.coyote.http11.Http11NioProtocol"
{% if tomcat.listen.https.bind_address is defined %}address="{{ tomcat.listen.https.bind_address }}"
{% if tomcat.listen.https.bind_address is defined %} address="{{ tomcat.listen.https.bind_address }}"
{% endif %}
maxThreads="150"
SSLEnabled="true"
sslProtocol="TLS"
allowTrace="false"
allowTrace="false"
scheme="https"
secure="true"
xpoweredBy="false"
server="My Server"
clientAuth="true"
connectionTimeout="6000"
maxHttpHeaderSize="8192">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
maxHttpHeaderSize="8192"
keystoreFile="keystore.jks"
keyAlias="alias"
keystorePass="password"
clientAuth="false"/>
{% endif %}
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
Expand Down
2 changes: 2 additions & 0 deletions roles/jws/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ tomcat:
enabled: "{{ tomcat_listen_http_enabled }}"
https:
port: "{{ tomcat_listen_https_port }}"
bind_address: "{{ tomcat_listen_https_bind_address }}"
enabled: "{{ tomcat_listen_https_enabled }}"
ajp:
enabled: "{{ tomcat_listen_ajp_enabled }}"
address: "{{ tomcat_listen_ajp_address }}"
Expand Down