ansible-playbook批量部署tomcat
下文为使用ansible-playbook批量部署tomcat
---
- hosts: websvs
tasks:
- name: 推送jdk安装包
copy: src=jdk-8u131-linux-x64_.rpm dest=/root/
- name: 安装jdk
yum: name=jdk-8u131-linux-x64_.rpm state=installed
- name: 推动tomcat安装包
unarchive: src=apache-tomcat-8.5.35.tar_2.gz dest=/opt/
- name: 关闭防火墙
shell: setenforce 0
- name: 关闭防火墙
service: name=firewalld state=stopped
- name: 启动tomcat
shell: nohup /opt/apache-tomcat-8.5.35/bin/startup.sh