Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sachin-slathia/22a920d54775139916e3eacc6d9d2817 to your computer and use it in GitHub Desktop.
Save sachin-slathia/22a920d54775139916e3eacc6d9d2817 to your computer and use it in GitHub Desktop.
---
- hosts: test-servers
become: yes
become_user: root
tasks:
- name: Check whether the executable file exists or not
stat:
path: /home/ec2-user/assignment-1.0-SNAPSHOT
register: stat_result
- name: "Unzip module"
unarchive: src=/home/knoldus/play/target/universal/assignment-1.0-SNAPSHOT.zip dest=/home/ec2-user
when: stat_result.stat.exists == False
- name: "Deploy website"
action: "shell sh /home/ec2-user/assignment-1.0-SNAPSHOT/bin/assignment >> /dev/null &"
async: 60
poll: 0
when: stat_result.stat.exists == False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment