---
- name: install tomcat7
sudo: True
apt: name=tomcat7 update_cache=yes cache_valid_time=3600
tags:
- wowza
- name: create directory structure for tomcat_1
sudo: True
file: path=/var/opt/tomcat_1/{{ item }} state=directory owner=tomcat7 group=nogroup
with_items:
- bin
- conf
- logs
- temp
- webapps
- work
tags:
- java_nodes
- name: create lib link
file: src=/usr/share/tomcat7/lib dest=/var/opt/tomcat_1/lib state=link
tags:
- java_nodes
- name: create deeper directory structure for tomcat_1
sudo: True
file: path=/var/opt/tomcat_1/conf/Catalina/localhost state=directory owner=tomcat7 group=nogroup
tags:
- java_nodes
- name: create symlink under tomcat_1/bin
sudo: True
file: src=/usr/share/tomcat7/bin/bootstrap.jar dest=/var/opt/tomcat_1/bin/bootstrap.jar owner=tomcat7 group=nogroup state=link
tags:
- java_nodes
- name: create file structure for tomcat_2
sudo: True
file: path=/var/opt/tomcat_2/{{ item }} state=directory owner=tomcat7 group=nogroup
with_items:
- bin
- conf
- logs
- temp
- webapps
- work
tags:
- java_nodes
- name: create lib link
file: src=/usr/share/tomcat7/lib dest=/var/opt/tomcat_2/lib state=link
tags:
- java_nodes
- name: create deeper directory structure for tomcat_2
sudo: True
file: path=/var/opt/tomcat_2/conf/Catalina/localhost state=directory owner=tomcat7 group=nogroup
tags:
- java_nodes
- name: create symlink under tomcat_2/bin
sudo: True
file: src=/usr/share/tomcat7/bin/bootstrap.jar dest=/var/opt/tomcat_2/bin/bootstrap.jar owner=tomcat7 group=nogroup state=link
tags:
- java_nodes
---
- name: Install Oracle Java 7 and tomcat
hosts: basic_java
sudo: True
roles:
- java
- { role: tomcat, tags: 'wowza' }
You may also apply tags to roles:
roles: - { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
{ role: tomcat, tags: 'wowza' }
{ role: tomcat, tags: 'wowza', skip-tags 'java_nodes' }
{ role: tomcat, skip-tags: 'java_nodes' }