Skip to content

Commit

Permalink
test: add for openSUSE Tumbleweed
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Feb 18, 2021
1 parent 39d7c2a commit 3b2a979
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/integration/default/controls/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
end
when 'suse'
case platform_finger
when 'opensuse-15'
when 'opensuse-15', 'opensuse-tumbleweed'
server_xml_user_and_group = 'root'
end
when 'linux'
Expand Down
176 changes: 176 additions & 0 deletions test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# yamllint disable rule:indentation rule:line-length
# openSUSE Tumbleweed-yyyymmdd
---
values:
arch: amd64
authbind: 'no'
catalina_base: /usr/share/tomcat
catalina_home: /usr/share/tomcat
catalina_pid: /var/run/tomcat.pid
catalina_tmpdir: /var/cache/tomcat/temp
cluster:
simple: true
common_pkg: tomcat-common
conf_dir: /etc/tomcat
connectors:
example_connector:
SSLEnabled: 'false'
URIEncoding: UTF-8
acceptCount: 100
clientAuth: 'false'
connectionTimeout: 20000
disableUploadTimeout: 'true'
enableLookups: 'false'
keystoreFile: /path/to/keystoreFile
keystorePass: somerandomtext
maxHttpHeaderSize: 8192
maxThreads: 150
minSpareThreads: 25
port: 8443
protocol: org.apache.coyote.http11.Http11Protocol
redirectPort: 8443
scheme: https
secure: 'true'
sslProtocol: TLS
context:
Environment:
env.first:
name: env.first
override: true
type: java.lang.String
value: first.text
env.second:
name: env.second
override: false
type: some.other.type
value: second.value
Listener:
first:
className: org.apache.catalina.security.SecurityListener
second:
SSLEngine: 'on'
className: org.apache.catalina.core.AprLifecycleListener
Resource:
jdbc:
auth: Container
driverClassName: org.postgresql.Driver
maxActive: 20
maxIdle: 10
maxWait: -1
name: jdbc/__postgres
password: aycaramba!
type: javax.sql.DataSource
url: jdbc:postgresql://db.server/dbname
user: dbuser
ResourceLink:
any_name_here_will_be_ignored:
global: simpleValue
name: linkToGlobalResource
type: java.lang.Integer
expires_when: 2 weeks
group: tomcat
haveged_enabled: false
id:
- example.com
- example.net
java_home: /usr/lib/jvm/jre
java_opts:
- Djava.awt.headless=true
- Xmx128m
- XX:MaxPermSize=256m
- Dlog4j.configuration=file:/tmp/log4j.properties
- Dlogback.configurationFile=/tmp/logback.xml
jsp_compiler: javac
jvm_tmp: /tmp/tomcat
limit:
hard: 64000
soft: 64000
logfile_compress: 1
logfile_days: 14
main_config: /etc/sysconfig/tomcat
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template
manager:
roles:
- manager-gui
- manager-script
- manager-jmx
- manager-status
users:
saltuser1:
passwd: RfgpE2iQwD
roles: manager-gui,manager-script,manager-jmx,manager-status
saltuser2:
passwd: RfgpE2iQwD
roles:
- manager-gui
- manager-script
- manager-jmx
- manager-status
manager_pkg: tomcat-admin-webapps
native_pkg: libtcnative-1-0
other_contexts:
other-contexts:
elements:
Resource:
jdbc:
auth: Container
driverClassName: org.postgresql.Driver
maxActive: 20
maxIdle: 10
maxWait: -1
name: jdbc/__postgres
password: aycaramba!
type: javax.sql.DataSource
url: jdbc:postgresql://db.server/dbname
user: dbuser
Resources:
PostResources:
base: /var/lib/tomcat8/appconfig
className: org.apache.catalina.webresources.DirResourceSet
webAppMount: /WEB-INF/classes
params:
crossContext: 'true'
debug: 1
docBase: /path/to/webapp
reloadable: 'true'
pkg: tomcat
resources: {}
security: 'no'
service: tomcat
service_enabled: true
service_running: false
sites:
example.com:
alias: www.example.com
appBase: ../webapps/myapp
debug: 0
docBase: ../webapps/myapp
host_parameters:
autoDeploy: 'true'
deployXML: 'false'
unpackWARs: 'true'
name: tomcat-server
path: ''
reloadable: 'true'
example.net:
alias: www.example.net
appBase: ../webapps/myapp2
debug: 0
docBase: ../webapps/myapp2
host_parameters:
autoDeploy: 'true'
unpackWARs: 'true'
path: ''
reloadable: 'true'
valves:
- className: org.apache.catalina.valves.AccessLogValve
directory: logs
fileDateFormat: yyyy-MM-dd-HH
pattern: '%h %l %u %t "%m http://%v%U %H" %s %b "%{Referer}i"
"%{User-Agent}i" %D'
prefix: localhost_access_log.
suffix: .log
- className: org.apache.catalina.authenticator.SingleSignOn
user: tomcat
ver: 8
with_haveged: false
67 changes: 67 additions & 0 deletions test/integration/default/files/main_config/opensuse-tumbleweed
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This file is managed by salt. Manual changes risk being overwritten.
# # Modify the values passed to the tomcat pillar instead.

# Service-specific configuration file for tomcat. This will be sourced by
# the SysV init script after the global configuration file
# /etc/tomcat/tomcat.conf, thus allowing values to be overridden in
# a per-service manner.
#
# NEVER change the init script itself. To change values for all services make
# your changes in /etc/tomcat/tomcat.conf
#
# To change values for a specific service make your edits here.
# To create a new service create a link from /etc/init.d/<your new service> to
# /etc/init.d/tomcat (do not copy the init script) and make a copy of the
# /etc/sysconfig/tomcat file to /etc/sysconfig/<your new service> and change
# the property values so the two services won't conflict. Register the new
# service in the system as usual (see chkconfig and similars).
#

# Where your java installation lives
JAVA_HOME=/usr/lib/jvm/jre

CATALINA_BASE="/usr/share/tomcat"

CATALINA_HOME="/usr/share/tomcat"

CATALINA_TMPDIR="/var/cache/tomcat/temp"

CATALINA_PID="/var/run/tomcat.pid"


# You can pass some parameters to java here if you wish to
#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3"
JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml"

#if CLASSPATH is defined in JAVA_OPTS it may no longer munge with the default CLASSPATH
#replace and customize if necessary
#CLASSPATH=/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar

# Use JAVA_OPTS to set java.library.path for libtcnative.so
#JAVA_OPTS="-Djava.library.path=/usr/lib64"

# What user should run tomcat
TOMCAT_USER=tomcat

# What group should run tomcat
TOMCAT_GROUP=tomcat

# You can change your tomcat locale here
#LANG="en_US"

# Run tomcat under the Java Security Manager
SECURITY_MANAGER="false"


# Time to wait in seconds, before killing process
#SHUTDOWN_WAIT="30"

# Whether to annoy the user with "attempting to shut down" messages or not
#SHUTDOWN_VERBOSE="false"

# Connector port is 8080 for this tomcat instance
#CONNECTOR_PORT="8080"

# If you wish to further customize your tomcat environment,
# put your own definitions here
# (i.e. LD_LIBRARY_PATH for some jdbc drivers)
99 changes: 99 additions & 0 deletions test/integration/default/files/server_xml/opensuse-tumbleweed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?><!--
This file is managed/autogenerated by salt.
Manual changes risk being overwritten.
Modify the salt pillar for the tomcat formula
that generates this file instead.
--><!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
--><Server port="8005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->

<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>




<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>


<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<Connector SSLEnabled="false" URIEncoding="UTF-8" acceptCount="100" clientAuth="false" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" keystoreFile="/path/to/keystoreFile" keystorePass="somerandomtext" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8443" protocol="org.apache.coyote.http11.Http11Protocol" redirectPort="8443" scheme="https" secure="true" sslProtocol="TLS"/>


<Engine defaultHost="localhost" name="Catalina">

<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>



<Host autoDeploy="true" deployXML="false" name="tomcat-server" unpackWARs="true">
<Context debug="0" docBase="../webapps/myapp" path="" reloadable="true"/>

<Alias>www.example.com</Alias>

</Host>

<Host autoDeploy="true" name="example.net" unpackWARs="true">
<Context debug="0" docBase="../webapps/myapp2" path="" reloadable="true"/>

<Alias>www.example.net</Alias>

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" fileDateFormat="yyyy-MM-dd-HH" pattern="%h %l %u %t &quot;%m http://%v%U %H&quot; %s %b &quot;%{Referer}i&quot; &quot;%{User-Agent}i&quot; %D" prefix="localhost_access_log." suffix=".log"/>
<Valve className="org.apache.catalina.authenticator.SingleSignOn"/>

</Host>


</Engine>
</Service>
</Server>

0 comments on commit 3b2a979

Please sign in to comment.