forked from RayCrafter/ansible-raycrafter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/crafternode' into develop
- Loading branch information
Showing
55 changed files
with
1,257 additions
and
668 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
|
||
- name: Common base role | ||
hosts: [masterservers, crafternodes] | ||
sudo: yes | ||
sudo_user: root | ||
remote_user: vagrant | ||
vars_files: | ||
- env_vars/secret.yml | ||
- env_vars/base.yml | ||
roles: | ||
- base |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
|
||
# Add masterservers to hosts but disable all roles | ||
# This is necessary for gathering facts | ||
# So we can set the right hostname for rabbitmq and the db | ||
- name: Create RayCrafter crafter node | ||
hosts: [crafternodes, masterservers] | ||
become: yes | ||
become_user: root | ||
remote_user: vagrant | ||
vars_files: | ||
- env_vars/secret.yml | ||
- env_vars/base.yml | ||
- env_vars/crafternode.yml | ||
roles: | ||
- {role: supervisor, when: "'crafternodes' in group_names"} | ||
- {role: web, when: "'crafternodes' in group_names"} | ||
- {role: celery, when: "'crafternodes' in group_names"} | ||
- {role: gridftp, when: "'crafternodes' in group_names"} | ||
tasks: | ||
- name: Create .ssh key dir | ||
become_user: "{{ web_user}}" | ||
file: path="~/.ssh" state=directory | ||
when: "'crafternodes' in group_names" | ||
- name: Copy private ssh key of crafternodes | ||
become_user: "{{ web_user }}" | ||
copy: src="{{playbook_dir}}/files/ssh/id_rsa" dest="~/.ssh/id_rsa" | ||
owner={{ web_user }} mode=0700 | ||
when: "'crafternodes' in group_names" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
========= | ||
Celerycam | ||
========= | ||
|
||
Dependencies: | ||
|
||
- web | ||
- supervisor | ||
|
||
Copies the startup and supervisor scripts. Will start the celerycam service. | ||
Celerycam is a monitoring service for celery workers and tasks. | ||
Create log dirs and files. | ||
Notifies supervisor to restart the celerycam service. | ||
|
||
--------- | ||
Variables | ||
--------- | ||
|
||
========================== ======================================================= ================================================== | ||
Name Default Description | ||
========================== ======================================================= ================================================== | ||
celerycam_user {{ web_user }} The user which executes celery workers | ||
celerycam_group {{ web_group }} The usergroup | ||
celerycam_scripts_dir {{ virtualenv_path }}/scripts/celerycam Path to the celery executable | ||
celerycam_template_file "celerycam_start.j2" The template to use for celerycam. A monitor | ||
service. | ||
celerycam_log_dir {{ virtualenv_path }}/logs Dir for the log files | ||
celerycam_log_file "{{ celery_log_dir }}/celerycam.log" Full path to the celery cam log file | ||
========================== ======================================================= ================================================== | ||
|
||
---- | ||
Tags | ||
---- | ||
===================== ========================================================================== | ||
Name Description | ||
===================== ========================================================================== | ||
celerycam Tag for all tasks | ||
supervisor All supervisor related tasks, like copying the config or | ||
restarting the app | ||
===================== ========================================================================== | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
======== | ||
Gunicorn | ||
======== | ||
|
||
Dependencies: | ||
|
||
- supervisor | ||
|
||
Create user and usergroup for gunicorn. | ||
Create a virtualenv for gunicorn. | ||
Install gunicorn. | ||
|
||
Create gunicorn start script and logging files. | ||
Create supervisor config files. | ||
Make the gunicorn user owner of the virtual env path. | ||
|
||
--------- | ||
Variables | ||
--------- | ||
|
||
========================== ======================================================================================================================== ================================================== | ||
Name Default Description | ||
========================== ======================================================================================================================== ================================================== | ||
application_name "gunicorn" Name of the application that gunicorn serves | ||
virtualenv_root "/webapps" Location for where to create virtual env | ||
virtualenv_path "{{ virtualenv_root }}/{{ application_name }}" Path to the virtual env | ||
application_log_dir "{{ virtualenv_path }}/logs" Path to the log dir | ||
application_log_file "{{ application_log_dir }}/gunicorn_supervisor.log" Path to the log file | ||
gunicorn_user "{{ application_name }}" Username for the user running gunicorn | ||
gunicorn_group webapps Groupname for the gunicorn user | ||
gunicorn_num_workers 3 Numer of gunicorn workers | ||
gunicorn_max_requests 0 Maximum requests before gunicorn restarts. 0 for | ||
no limit. | ||
gunicorn_timeout_seconds 30 Maximum timeout for requests. | ||
gunicorn_workdir / Workdir for executing gunicorn | ||
gunicorn_wsgi_file ~ Path to the wsgi file. Has to be importable. | ||
========================== ======================================================================================================================== ================================================== | ||
|
||
---- | ||
Tags | ||
---- | ||
|
||
===================== ========================================================================== | ||
Name Description | ||
===================== ========================================================================== | ||
virtualenv Install packages | ||
supervisor Create configs and restart supervisor | ||
gunicorn Tag for all tasks | ||
===================== ========================================================================== | ||
|
Oops, something went wrong.