-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
36 lines (36 loc) · 1000 Bytes
/
playbook.yml
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
29
30
31
32
33
34
35
36
- hosts: devoops
remote_user: ubuntu
become: yes
tasks:
#Locale Fixes for Mongodb
- name: Set Locale
command: locale-gen en_US.UTF-8
- name: Update Locale
command: update-locale
# Install Packages
- name: Install the packages
apt:
name: ["python-pip", "python-dev", "nginx", "gunicorn", "locales", "mongodb"]
state: present
# Nginx Configuration
- name: Copy NGINX
copy:
src: ./nginx/conf/default
dest: /etc/nginx/sites-available/
- name: Ensure NGINX is running
service:
name: nginx
state: started
# Install Flask
- name: Pip install Flask
pip:
name: flask
state: present
#Start Gunicorn
- name: Spinup Gunicorn
command: gunicorn --daemon --bind 0.0.0.0:5000 wsgi:app
args:
chdir: '/var/www/html'
#Start Mongodb
- name: Start Mongo
command: mongod --fork --logpath=/var/log/mongodb/mongo.log --logappend