官网下载 http://mirrors.jenkins.io/war-stable/2.277.1/jenkins.war
[root@ansible-11 tomcat]# cat tomcat.yaml
---
- hosts: tom
vars:
remote_user: root
gather_facts: false
tasks:
- name: Install jdk1.8
yum: name=java-1.8.0-openjdk state=present
- name: Download tomcat
unarchive: src=pkg/apache-tomcat-8.5.54.tar.gz dest=/tmp
- name: mv tomcat
shell: mv /tmp/apache-tomcat-8.5.54 /usr/local/tomcat
- name: 修改日志格式
copy: src=conf/server.xml dest=/usr/local/tomcat/conf/server.xml
- name: 关闭服务器
shell: /usr/local/tomcat/bin/shutdown.sh
- name: Start tomcat
shell: cd /usr/local/tomcat/bin &&
nohup ./startup.sh &
- name: sleep
shell: sleep 10
- name: 查看状态并将结果注入到tomcat变量
shell: ss -nutlp |grep 8080
register: tomcat
- name: 将结果输出到控制台
debug: var=tomcat.stdout_lines
[root@git-ci-103 webapps]# pwd
/usr/local/tomcat/webapps
[root@git-ci-103 webapps]# ls
docs examples host-manager jenkins jenkins.war manager ROOT
加速 目录root
cd ./.jenkins/updates
sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' default.json
中文插件
Localization: Chinese (Simplified)