-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ansible Deployment. #54
base: develop
Are you sure you want to change the base?
Changes from all commits
1b1160d
55ea3d3
5f0c4f4
3be8594
1ab658d
c671447
cf06a50
82849a5
877e9a7
5470254
da726b4
df5ca6e
214ffc4
7a3a15e
54a12ed
830a439
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- hosts: barmaglot | ||
|
||
vars_prompt: | ||
|
||
- name: app_dir | ||
prompt: "Please enter the app_dir" | ||
private: no | ||
|
||
tasks: | ||
|
||
- debug: | ||
msg: "Running playbook as {{ lookup('env', 'USER') }} ..." | ||
|
||
- name: Install Python | ||
sudo: yes | ||
sudo_user: "{{ lookup('env', 'USER') }}" | ||
command: chdir={{ app_dir }} sh bin/install_python3_5.sh >> dev_build.log | ||
register: install_stdout | ||
|
||
- debug: | ||
msg: "{{ install_stdout.stdout }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- hosts: barmaglot | ||
tasks: | ||
- name: Install NGINX | ||
sudo: yes | ||
apt: pkg=nginx state=installed update_cache=true | ||
notify: | ||
- Start Nginx | ||
|
||
- name: Install Supervisor | ||
sudo: yes | ||
apt: pkg=supervisor state=installed update_cache=true | ||
|
||
handlers: | ||
- name: Start Nginx | ||
service: name=nginx state=started |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
- hosts: barmaglot | ||
|
||
vars_prompt: | ||
|
||
- name: virtualenv_dir | ||
prompt: "Please enter the virtualenv_dir" | ||
private: no | ||
|
||
- name: app_dir | ||
prompt: "Please enter the app_dir" | ||
private: no | ||
|
||
tasks: | ||
|
||
- name: Install Git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. small issue - you will not be able to install git from ansible playbook because at that moment you should already have git as you clone this repo :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
sudo: yes | ||
apt: pkg=git state=installed update_cache=true | ||
|
||
- name: Install Python-Pip | ||
sudo: yes | ||
apt: pkg=python-pip state=installed update_cache=true | ||
|
||
- name: Install GNU Readline Library | ||
sudo: yes | ||
apt: pkg=libreadline-dev state=installed update_cache=true | ||
|
||
- name: Install System-Packages | ||
sudo: yes | ||
action: apt pkg={{item}} state=installed | ||
with_items: | ||
- make | ||
- build-essential | ||
- libssl-dev | ||
- zlib1g-dev | ||
- libbz2-dev | ||
- libsqlite3-dev | ||
|
||
- name: Install Python-System-Packages | ||
sudo: yes | ||
action: apt pkg={{item}} state=installed | ||
with_items: | ||
- build-essential | ||
- python-dev | ||
- python-setuptools | ||
- python-pip | ||
- python-smbus | ||
|
||
- name: Install Foreign Function Interface library | ||
sudo: yes | ||
apt: pkg=libffi-dev state=installed update_cache=true | ||
|
||
- name: Install Virtual Env | ||
sudo: yes | ||
apt: pkg=virtualenv state=installed update_cache=true | ||
notify: | ||
- Initiate virtualenv | ||
- Install requirements | ||
|
||
- name: Install NodeJS | ||
sudo: yes | ||
apt: pkg=nodejs state=installed update_cache=true | ||
|
||
- name: Install NPM | ||
sudo: yes | ||
apt: pkg=npm state=installed update_cache=true | ||
notify: | ||
- Install NPM packages | ||
- Building Webpack Dev build | ||
|
||
handlers: | ||
- name: Initiate virtualenv | ||
command: virtualenv {{ virtualenv_dir }} -p python3.5 creates="{{ virtualenv_dir }}" | ||
|
||
- name: Install requirements | ||
pip: | ||
requirements={{ app_dir }}/requirements.txt | ||
executable={{ virtualenv_dir }}/bin/pip3 | ||
|
||
- name: Install NPM packages | ||
npm: | ||
path={{ app_dir }} | ||
|
||
- name: Building Webpack Dev build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think build output log files should be added to gitignore |
||
shell: cd {{ app_dir }}; sh {{ app_dir }}/build_js.sh >> dev_build_js.log |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ntodosiychuk btw:I found out that we can completely replace bash with ansible, at least for Python installation:)
something in this style |
||
|
||
./ | ||
|
||
PYTHON_ARCHIVE=Python-3.5.1.tar.xz | ||
PYTHON_DIR=Python-3.5.1 | ||
FTP_SOURCE=https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz | ||
|
||
echo "Starting install python 3.5..." | ||
|
||
|
||
if [ ! -f $PYTHON_ARCHIVE ] | ||
# skip downloading if archive already exists | ||
then | ||
echo "$PYTHON_ARCHIVE not found! Will try to download..." | ||
echo "Downloading..." | ||
wget $FTP_SOURCE | ||
[ $CODE -ne 0 ] && exit $CODE | ||
fi | ||
|
||
|
||
echo "Unpacking $PYTHON_ARCHIVE package..." | ||
tar xf $PYTHON_ARCHIVE | ||
[ $CODE -ne 0 ] && exit $CODE | ||
|
||
echo "Installion..." | ||
|
||
|
||
cd $PYTHON_DIR | ||
./configure | ||
sudo make | ||
sudo make altinstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
bin/install_python3_5.sh
file that is requires for this playbook is missing from this branchThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you are right!