Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: all
- sudo: yes
- vars:
- tomcat:
- port: 9000
- tasks:
- - name: Install tomcat 7
- apt: name=tomcat7 state=present
- notify: restart tomcat
- - name: Install tomcat 7 admin
- apt: name=tomcat7-admin state=present
- notify: restart tomcat
- - name: Add tomcat config
- template: src=server.xml.j2 dest=/etc/tomcat7/server.xml
- notify: restart tomcat
- - name: Allow tomcat user to see monitoring page
- lineinfile: >
- dest=/etc/tomcat7/tomcat-users.xml
- state=present
- insertbefore='^</tomcat-users>$'
- line='<user username="tomcat" password="tomcat" roles="manager-gui,manager-script"/>'
- notify: restart tomcat
- - name: Link the manager
- file: src=/usr/share/tomcat7-admin/manager dest=/var/lib/tomcat7/webapps/manager state=link
- handlers:
- - name: restart tomcat
- service: name=tomcat7 state=restarted
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement