Last active
March 20, 2018 02:18
-
-
Save foxutech/7979060ba707af7d75b0291372addab9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ec2server] | |
| xy.yx.xy.yx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment