zoukankan      html  css  js  c++  java
  • ansible-playbook 进行批量安装tomcat8

    ansible-playbook 进行安装tomcat操作

    说明:

    get_url  中下载的内容直接到目的主机

    安装的时候需要指定copy: no,说明需直接从目标主机进行安装包


    [root@ansible-test ansible-yaml]# vim tomcat-install.yml
    ---
    - hosts: web
    vars:
    tomcat_version: 8.5.38
    tomcat_install_dir: /usr/local

    tasks:

    - name: install jdk1.8
    yum: name=java-1.8.0-openjdk
    state=present

    - name: download tomcat
    get_url: url=http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v{{tomcat_version}}/bin/apache-tomcat-{{tomcat_version}}.tar.gz dest=/usr/local/src

    - name: unarchive tomcat-{{tomcat_version}}.tar.gz
    unarchive:
    src: /usr/local/src/apache-tomcat-{{tomcat_version}}.tar.gz
    dest: "{{tomcat_install_dir}}"
    copy: no
    - name: star tomcat
    shell: cd {{tomcat_install_dir}} &&
    mv apache-tomcat-{{tomcat_version}} tomcat8 &&
    cd tomcat8/bin && nohup ./startup.sh &


  • 相关阅读:
    oracle 查看表空间使用率
    解决linux下vim中文乱码问题
    linux 时间同步
    oracle ho与mysql system命令
    mysql 重置root密码
    2020 10 26
    2020 10 24
    2020 10 23
    2020 10 22
    2020 10 21
  • 原文地址:https://www.cnblogs.com/qiangyuzhou/p/10577610.html
Copyright © 2011-2022 走看看