jenkins里用ansible发布代码常见的问题

1.stdout: Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

cd bin/
vi catalina.sh
头部加入以下信息:

export JAVA_HOME=/home/gongzi/http/jdk1.6.0_26
export JRE_HOME=/home/gongzi/http/jdk1.6.0_26/jre

2.tomcat 启动不了
碰到ansible无法起停tomcat的时候,有两个点需要关注
1)、环境变量,在startup.sh中添加source /etc/profile
2)、后台运行,加上nohup...&


3. 只发一次上线通知

run_once: true


- command: /opt/application/upgrade_db.py
run_once: true
delegate_to: web01.example.org

指定在"web01.example.org"上执行

原文地址:https://www.cnblogs.com/rutor/p/10784034.html