Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Apache Tomcat packages, files, and services


In this recipe, we will learn how to install Tomcat packages, configure the appropriate files needed for Tomcat to function, and configure the Tomcat service.

How to do it...

We will use the same minion as in the previous recipe.

  1. Create and edit /opt/salt-cookbook/development/tomcat/init.sls to have the following entries:

    include:
      - tomcat.java
    
    tomcat-server:
      archive:
        - extracted
        - name: /opt/
        - source: http://mirror.nus.edu.sg/apache/tomcat/tomcat- 6/v6.0.43/bin/apache-tomcat-6.0.43.tar.gz
        - source_hash: md5=0abbb1852a608c8b4ccb7003c700337b
        - archive_format: tar
        - if_missing: /opt/apache-tomcat-6.0.43/
        - require:
          - alternatives: set_java_alternative
    
    tomcat_symlink:
      file.symlink:
        - name: /opt/tomcat
        - target: apache-tomcat-6.0.43
        - require:
          - archive: tomcat-server
    
    tomcat_init_script:
      file.managed:
        - name: /etc/init.d/tomcat
        - source: salt://tomcat/files/tomcat_init_script
        ...