forked from robipozzi/windfire-restaurants-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove.yaml
More file actions
28 lines (28 loc) · 942 Bytes
/
remove.yaml
File metadata and controls
28 lines (28 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- # Ansible Playbook to automate application removal from AWS in a consistent and repeatable way
- hosts: backend
remote_user: "{{ user }}"
become: yes
vars:
src_dir: "{{ playbook_dir }}"
nodejs_src_dir: "{{ lookup('env', 'PWD') }}/app"
service_name: windfire-restaurants-node
mode: u=rwx
vars_files:
- "{{ src_dir }}/conf/aws-config.yml"
tasks:
- name: Install pm2 process manager for Node.js
npm:
name: pm2
global: yes
production: yes
state: present
- name: Stop Node.js application service {{ service_name }}
shell: pm2 stop {{ service_name }}
ignore_errors: yes
- name: Delete Node.js application service {{ service_name }}
shell: pm2 delete {{ service_name }}
ignore_errors: yes
- name: Clean Node.js application folder {{ remote_nodejs_dest_dir }}
file:
path: "{{ remote_nodejs_dest_dir }}"
state: absent