Skip to content

Commit d672302

Browse files
authored
Merge pull request #116 from myii/feat/support-new-platforms
feat: support new platforms (`ubuntu-20.04` & `fedora-32`)
2 parents 91e57b5 + 2fd6f92 commit d672302

File tree

10 files changed

+446
-10
lines changed

10 files changed

+446
-10
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ jobs:
5959
# Make sure the instances listed below match up with
6060
# the `platforms` defined in `kitchen.yml`
6161
- env: INSTANCE=default-debian-10-master-py3
62-
# - env: INSTANCE=default-ubuntu-2004-master-py3
63-
- env: INSTANCE=default-ubuntu-1804-master-py3
62+
- env: INSTANCE=default-ubuntu-2004-master-py3
63+
# - env: INSTANCE=default-ubuntu-1804-master-py3
6464
# - env: INSTANCE=default-centos-8-master-py3
65-
# - env: INSTANCE=default-fedora-32-master-py3
66-
- env: INSTANCE=default-fedora-31-master-py3
67-
- env: INSTANCE=default-opensuse-leap-152-master-py3
65+
- env: INSTANCE=default-fedora-32-master-py3
66+
# - env: INSTANCE=default-fedora-31-master-py3
67+
# - env: INSTANCE=default-opensuse-leap-152-master-py3
6868
# - env: INSTANCE=default-amazonlinux-2-master-py3
6969
# - env: INSTANCE=default-debian-10-3000-3-py3
7070
# - env: INSTANCE=default-debian-9-3000-3-py3
7171
# - env: INSTANCE=default-ubuntu-1804-3000-3-py3
7272
# - env: INSTANCE=default-centos-8-3000-3-py3
7373
# - env: INSTANCE=default-centos-7-3000-3-py3
7474
# - env: INSTANCE=default-fedora-31-3000-3-py3
75-
# - env: INSTANCE=default-opensuse-leap-152-3000-3-py3
75+
- env: INSTANCE=default-opensuse-leap-152-3000-3-py3
7676
- env: INSTANCE=default-amazonlinux-2-3000-3-py3
7777
# - env: INSTANCE=default-ubuntu-1804-3000-3-py2
7878
# - env: INSTANCE=default-ubuntu-1604-3000-3-py2

test/integration/default/controls/config_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
conf_dir = '/etc/tomcat8'
2323
server_xml_user_and_group = 'tomcat8'
2424
case platform_finger
25-
when 'debian-10'
25+
when 'debian-10', 'ubuntu-20'
2626
main_config_file = '/etc/default/tomcat9'
2727
catalina_tmpdir = '/var/cache/tomcat9/temp'
2828
catalina_tmpdir_user_and_group = 'tomcat'
@@ -48,6 +48,7 @@
4848
end
4949
when 'fedora'
5050
case platform_finger
51+
when 'fedora-32'
5152
when 'fedora-31'
5253
when 'fedora-30'
5354
end

test/integration/default/controls/packages_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
case platform[:family]
1212
when 'debian'
1313
case platform_finger
14-
when 'debian-10'
14+
when 'debian-10', 'ubuntu-20'
1515
%w[tomcat9 haveged]
1616
when 'debian-9', 'ubuntu-18', 'ubuntu-16'
1717
%w[tomcat8 haveged]

test/integration/default/controls/services_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
case platform[:family]
1313
when 'debian'
1414
case platform_finger
15-
when 'debian-10'
15+
when 'debian-10', 'ubuntu-20'
1616
%w[tomcat9 haveged]
1717
when 'debian-9', 'ubuntu-18', 'ubuntu-16'
1818
%w[tomcat8 haveged]

test/integration/default/controls/yaml_dump_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
case platform[:family]
1212
when 'debian'
1313
case platform_finger
14-
when 'debian-10'
14+
when 'debian-10', 'ubuntu-20'
1515
conf_dir = '/etc/tomcat9'
1616
group = 'tomcat'
1717
main_config = '/etc/default/tomcat9'
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This file is managed by salt. Manual changes risk being overwritten.
2+
# # Modify the values passed to the tomcat pillar instead.
3+
4+
# Service-specific configuration file for tomcat. This will be sourced by
5+
# the SysV init script after the global configuration file
6+
# /etc/tomcat/tomcat.conf, thus allowing values to be overridden in
7+
# a per-service manner.
8+
#
9+
# NEVER change the init script itself. To change values for all services make
10+
# your changes in /etc/tomcat/tomcat.conf
11+
#
12+
# To change values for a specific service make your edits here.
13+
# To create a new service create a link from /etc/init.d/<your new service> to
14+
# /etc/init.d/tomcat (do not copy the init script) and make a copy of the
15+
# /etc/sysconfig/tomcat file to /etc/sysconfig/<your new service> and change
16+
# the property values so the two services won't conflict. Register the new
17+
# service in the system as usual (see chkconfig and similars).
18+
#
19+
20+
# Where your java installation lives
21+
JAVA_HOME=/usr/lib/jvm/jre
22+
23+
CATALINA_BASE="/usr/share/tomcat"
24+
25+
CATALINA_HOME="/usr/share/tomcat"
26+
27+
CATALINA_TMPDIR="/var/cache/tomcat/temp"
28+
29+
CATALINA_PID="/var/run/tomcat.pid"
30+
31+
32+
# You can pass some parameters to java here if you wish to
33+
#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3"
34+
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml"
35+
36+
#if CLASSPATH is defined in JAVA_OPTS it may no longer munge with the default CLASSPATH
37+
#replace and customize if necessary
38+
#CLASSPATH=/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar
39+
40+
# Use JAVA_OPTS to set java.library.path for libtcnative.so
41+
#JAVA_OPTS="-Djava.library.path=/usr/lib64"
42+
43+
# What user should run tomcat
44+
TOMCAT_USER=tomcat
45+
46+
# What group should run tomcat
47+
TOMCAT_GROUP=tomcat
48+
49+
# You can change your tomcat locale here
50+
#LANG="en_US"
51+
52+
# Run tomcat under the Java Security Manager
53+
SECURITY_MANAGER="false"
54+
55+
56+
# Time to wait in seconds, before killing process
57+
#SHUTDOWN_WAIT="30"
58+
59+
# Whether to annoy the user with "attempting to shut down" messages or not
60+
#SHUTDOWN_VERBOSE="false"
61+
62+
# Connector port is 8080 for this tomcat instance
63+
#CONNECTOR_PORT="8080"
64+
65+
# If you wish to further customize your tomcat environment,
66+
# put your own definitions here
67+
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This file is managed by salt. Manual changes risk being overwritten.
2+
# Modify the values in the tomcat pillar instead.
3+
4+
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
5+
# default of tomcat8.
6+
TOMCAT9_USER=tomcat
7+
8+
# Run Tomcat as this group ID. Not setting this or leaving it blank will use
9+
# the default of tomcat8.
10+
TOMCAT9_GROUP=tomcat
11+
12+
# The home directory of the Java development kit (JDK). You need at least
13+
# JDK version 7. If JAVA_HOME is not set, some common directories for
14+
# OpenJDK and the Oracle JDK are tried.
15+
JAVA_HOME=/usr/lib/jvm/default-java
16+
17+
CATALINA_BASE="/var/lib/tomcat9"
18+
CATALINA_HOME="/usr/share/tomcat9"
19+
CATALINA_TMPDIR="/var/cache/tomcat9/temp"
20+
CATALINA_PID="/var/run/tomcat9.pid"
21+
22+
23+
# You may pass JVM startup parameters to Java here. If unset, the default
24+
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
25+
#
26+
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
27+
# response time). If you use that option and you run Tomcat on a machine with
28+
# exactly one CPU chip that contains one or two cores, you should also add
29+
# the "-XX:+CMSIncrementalMode" option.
30+
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml"
31+
32+
# To enable remote debugging uncomment the following line.
33+
# You will then be able to use a java debugger on port 8000.
34+
#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
35+
36+
# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
37+
# compilers that are accepted by Ant's build.compiler property.
38+
JSP_COMPILER=javac
39+
40+
41+
# Use the Java security manager? (yes/no, default: no)
42+
TOMCAT9_SECURITY=no
43+
44+
45+
# Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days.
46+
#LOGFILE_DAYS=14
47+
# Whether to compress logfiles older than today's
48+
#LOGFILE_COMPRESS=1
49+
50+
# Location of the JVM temporary directory
51+
# WARNING: This directory will be destroyed and recreated at every startup !
52+
JVM_TMP=/tmp/tomcat
53+
54+
55+
# If you run Tomcat on port numbers that are all higher than 1023, then you
56+
# do not need authbind. It is used for binding Tomcat to lower port numbers.
57+
# (yes/no, default: no)
58+
AUTHBIND=no
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<!--
3+
4+
This file is managed/autogenerated by salt.
5+
Manual changes risk being overwritten.
6+
7+
Modify the salt pillar for the tomcat formula
8+
that generates this file instead.
9+
10+
-->
11+
<!--
12+
Licensed to the Apache Software Foundation (ASF) under one or more
13+
contributor license agreements. See the NOTICE file distributed with
14+
this work for additional information regarding copyright ownership.
15+
The ASF licenses this file to You under the Apache License, Version 2.0
16+
(the "License"); you may not use this file except in compliance with
17+
the License. You may obtain a copy of the License at
18+
19+
http://www.apache.org/licenses/LICENSE-2.0
20+
21+
Unless required by applicable law or agreed to in writing, software
22+
distributed under the License is distributed on an "AS IS" BASIS,
23+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
See the License for the specific language governing permissions and
25+
limitations under the License.
26+
-->
27+
<!-- Note: A "Server" is not itself a "Container", so you may not
28+
define subcomponents such as "Valves" at this level.
29+
Documentation at /docs/config/server.html
30+
-->
31+
<Server port="8005" shutdown="SHUTDOWN">
32+
<!-- Security listener. Documentation at /docs/config/listeners.html
33+
<Listener className="org.apache.catalina.security.SecurityListener" />
34+
-->
35+
36+
<!--APR library loader. Documentation at /docs/apr.html -->
37+
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
38+
39+
40+
41+
42+
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
43+
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
44+
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
45+
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
46+
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
47+
48+
<!-- Global JNDI resources
49+
Documentation at /docs/jndi-resources-howto.html
50+
-->
51+
<GlobalNamingResources>
52+
53+
54+
<!-- Editable user database that can also be used by
55+
UserDatabaseRealm to authenticate users
56+
-->
57+
<Resource name="UserDatabase" auth="Container"
58+
type="org.apache.catalina.UserDatabase"
59+
description="User database that can be updated and saved"
60+
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
61+
pathname="conf/tomcat-users.xml" />
62+
</GlobalNamingResources>
63+
64+
<!-- A "Service" is a collection of one or more "Connectors" that share
65+
a single "Container" Note: A "Service" is not itself a "Container",
66+
so you may not define subcomponents such as "Valves" at this level.
67+
Documentation at /docs/config/service.html
68+
-->
69+
<Service name="Catalina">
70+
<Connector
71+
72+
port="8443"
73+
protocol="org.apache.coyote.http11.Http11Protocol"
74+
connectionTimeout="20000"
75+
URIEncoding="UTF-8"
76+
redirectPort="8443"
77+
maxHttpHeaderSize="8192"
78+
maxThreads="150"
79+
minSpareThreads="25"
80+
enableLookups="false"
81+
disableUploadTimeout="true"
82+
acceptCount="100"
83+
scheme="https"
84+
secure="true"
85+
clientAuth="false"
86+
sslProtocol="TLS"
87+
SSLEnabled="false"
88+
keystoreFile="/path/to/keystoreFile"
89+
keystorePass="somerandomtext"
90+
/>
91+
92+
93+
<Engine name="Catalina" defaultHost="localhost">
94+
95+
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
96+
via a brute-force attack -->
97+
<Realm className="org.apache.catalina.realm.LockOutRealm">
98+
<!-- This Realm uses the UserDatabase configured in the global JNDI
99+
resources under the key "UserDatabase". Any edits
100+
that are performed against this UserDatabase are immediately
101+
available for use by the Realm. -->
102+
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
103+
resourceName="UserDatabase"/>
104+
</Realm>
105+
106+
107+
108+
<Host name="tomcat-server"
109+
unpackWARs="true"
110+
autoDeploy="true"
111+
deployXML="false">
112+
<Context path=""
113+
docBase="../webapps/myapp"
114+
debug="0"
115+
reloadable="true"
116+
/>
117+
118+
<Alias>www.example.com</Alias>
119+
120+
</Host>
121+
122+
<Host name="example.net"
123+
unpackWARs="true"
124+
autoDeploy="true">
125+
<Context path=""
126+
docBase="../webapps/myapp2"
127+
debug="0"
128+
reloadable="true"
129+
/>
130+
131+
<Alias>www.example.net</Alias>
132+
133+
<Valve
134+
className="org.apache.catalina.valves.AccessLogValve"
135+
directory="logs"
136+
prefix="localhost_access_log."
137+
fileDateFormat="yyyy-MM-dd-HH"
138+
suffix=".log"
139+
pattern="%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; %D" />
140+
<Valve
141+
className="org.apache.catalina.authenticator.SingleSignOn" />
142+
143+
</Host>
144+
145+
146+
</Engine>
147+
</Service>
148+
</Server>

0 commit comments

Comments
 (0)