ansible-role-apache/tomcat-standalone/roles/tomcat/tasks/main.yml
Maikel Alderhout 4fcd20c431 Update main.yml
2013-08-31 10:33:32 +02:00

42 lines
1.4 KiB
YAML

---
- name: Install Java 1.7
yum: name=java-1.7.0-openjdk state=present
- name: Download Tomcat
get_url: url=http://mirror.symnds.com/software/Apache/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz dest=/opt/apache-tomcat-7.0.42.tar.gz
- name: Extract archive
command: chdir=/usr/share /bin/tar xvf /opt/apache-tomcat-7.0.42.tar.gz -C /usr/share/ creates=/usr/share/tomcat
- name: Symlink install directory
file: src=/usr/share/apache-tomcat-7.0.42 path=/usr/share/tomcat state=link
- name: Add group "tomcat"
group: name=tomcat
- name: Add user "tomcat"
user: name=tomcat group=tomcat home=/usr/share/tomcat
- name: Change ownership of Tomcat installation
file: path=/usr/share/tomcat/ owner=tomcat group=tomcat state=directory recurse=yes
- name: Configure Tomcat server
template: src=server.xml dest=/usr/share/tomcat/conf/
notify: restart tomcat
- name: Configure Tomcat users
template: src=tomcat-users.xml dest=/usr/share/tomcat/conf/
notify: restart tomcat
- name: Install Tomcat init script
copy: src=tomcat-initscript.sh dest=/etc/init.d/tomcat mode=0755
- name: Start Tomcat
service: name=tomcat state=started enabled=yes
- name: deploy iptables rules
template: src=iptables-save dest=/etc/sysconfig/iptables
notify: restart iptables
- name: wait for tomcat to start
wait_for: port={{http_port}}