Integrate Ansible with Jenkins - jamongx/twitter-clone GitHub Wiki
Add Ansible-server to System
- Manage Jenkins -> System -> Publish over SSH -> SSH Servers -> Add
SSH Server Name: ansible-server
Hostname: 172.xxx.xxx.xxx -> ansible server private ip
Username: ansadmin
[V] Use password authentication, or use a different key
[V] Use password authentication, or use a different key
Password: xxxx
Create a new directory on ansible-server to build docker images
[ansadmin@ansible-server ~]$ cd /opt/
[ansadmin@ansible-server opt]$ sudo mkdir docker
[ansadmin@ansible-server opt]$ ll
drwxr-xr-x 2 root root 6 Sep 22 19:13 docker
[ansadmin@ansible-server opt]$ sudo chown -R ansadmin:ansadmin docker
After build, webapp.war was created in /opt/docker on ansible server
[ansadmin@ansible-server docker]$ ll
total 4
-rw-rw-r-- 1 ansadmin ansadmin 19043531 Sep 30 04:16 sample-0.0.1-SNAPSHOT.jar