Skip to content

Instantly share code, notes, and snippets.

@foxutech
Last active March 20, 2018 02:18
Show Gist options
  • Select an option

  • Save foxutech/7979060ba707af7d75b0291372addab9 to your computer and use it in GitHub Desktop.

Select an option

Save foxutech/7979060ba707af7d75b0291372addab9 to your computer and use it in GitHub Desktop.
---
- hosts: localhost
connection: local
- tasks:
- name: Creates directory
file: path=/test state=directory
- name: Download ZIP to server
command: wget <<artifectusrlor any zip path>> -O /test
- name: copyinng a file
copy: src='/test/any.zip' dest='ec2-user@targetserver:/tmp/any.zip'
- hosts: ec2server
become: yes
tasks:
- name: Unzip WAR file
unarchive: src=/tmp/any.zip dest=/var/lib/tomcat/webapps/ROOT/ copy=no mode=0755 owner=tomcat group=tomcat
notify:
- restart tomcat
- name: Delete remote war file
file: path={{ ec2RemotePath }}/{{ artifectName }} state=absent
handlers:
- name: Restart tomcat
service: name=tomcat state=restarted
[ec2server]
xy.yx.xy.yx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment