city-of-bloomington / ansible-role-tomcat Goto Github PK
View Code? Open in Web Editor NEWMaintain Tomcat on Ubuntu
License: GNU General Public License v3.0
Maintain Tomcat on Ubuntu
License: GNU General Public License v3.0
We are starting to want to run CentOS on servers. We need to update our Ansible roles to work with RPM based distros as well as DEB.
Playbooks need to know some things about the Tomcat install in order to deploy applications.
We need to declare a variable for the webapps path. Not only because people put it in different places; but also because web application playbooks need to know where to put their WAR files.
We need to declare a few variables for Tomcat in the role. These could still be overridden in the group_vars; but keep in mind, we're using the distro version of Tomcat. So changing directory paths or the tomcat user require quite a bit of custom code to alter Tomcat's configuration files. It's probably best just to use the defaults from Ubuntu.
For several years we've been changing the default location to /srv/webapps. However, it requires some complicated XML and ini file configuration changes, which are hard to do in Ansible (or docker).
We should just start using the default location set by Ubuntu
/var/lib/tomcatX/webapps
We still need to declare {{ tomcat_webapps }} as a variable, so application playbooks know where to install themselves.
The old way of doing apt with-items is deprecated. The new way is to declare a variable for all the package names.
- name: "Install Dependencies"
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- "postgis"
- name: "Install Dependencies"
apt:
name: "{{ item }}"
state: present
with_items:
- "postgis"
Ubuntu 14.xx, 16.xx, and 18.xx all used Tomcat 8. This is hard coded in the ansible role. It should not have been. Now that Ubuntu 20.04 uses Tomcat 9, we have to rewrite the ansible role.
We tackled this problem in the Postgres role with distribution vars.
We set up a consistent place on the hard drive for all our webapps to write data. Rather than each application playbook dealing with granting ReadWrite permission to Tomcat in systemd, we should grant Tomcat permission to the base data directory. Then, all the web applications we install on that server will be able to write data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.