标签:tab appdata set 安装 mod hosts task 推送 service
首先要准备的环境就是免密登录
这是要在ansible-playbook中所写的内容
---
- hosts: tomcat
tasks:
- name: 关闭防火墙
service: name=iptables state=stopped
- name: 关闭selinux
shell: setenforce 0
- name: 安装所需的软件
yum: name=tar,libselinux-python state=latest
- name: 推送jdk java环境
copy: src=jdk-8u131-linux-x64_.rpm dest=/root
- name: 创建文件夹
file: path=/opt/tomcat state=directory
- name: 推送tomcat的压缩包
unarchive: src=apache-tomcat-8.5.35.tar.gz dest=/opt/tomcat
- name: 安装jdk
yum: name=jdk-8u131-linux-x64_.rpm state=installed
- name: 启动tomcat
shell: nohup /opt/tomcat/apache-tomcat-8.5.35/bin/startup.sh &
标签:tab appdata set 安装 mod hosts task 推送 service
原文地址:https://www.cnblogs.com/leilei001/p/12067917.html