Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
265e222e
Commit
265e222e
authored
Feb 11, 2015
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary files
parent
57cf1bb6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
133 additions
and
174 deletions
+133
-174
playbooks/roles/insights/handlers/main.yml
+0
-24
playbooks/roles/insights/tasks/deploy.yml
+0
-136
playbooks/roles/insights/tasks/main.yml
+133
-3
playbooks/roles/insights/tasks/tag_ec2.yml
+0
-11
No files found.
playbooks/roles/insights/handlers/main.yml
deleted
100644 → 0
View file @
57cf1bb6
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role insights
#
# Overview:
#
#
-
name
:
"
restart
insights"
supervisorctl_local
:
>
name={{ insights_service_name }}
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=restarted
when
:
not disable_edx_services
playbooks/roles/insights/tasks/deploy.yml
deleted
100644 → 0
View file @
57cf1bb6
---
-
name
:
install read-only ssh key
copy
:
>
content="{{ INSIGHTS_GIT_IDENTITY }}" dest={{ insights_git_identity_file }}
owner={{ insights_user }} group={{ insights_user }} mode=0600
-
name
:
setup the insights env file
template
:
>
src="edx/app/insights/insights_env.j2"
dest="{{ insights_app_dir }}/insights_env"
owner={{ insights_user }}
group={{ insights_user }}
mode=0644
-
name
:
checkout code
git
:
>
dest={{ insights_code_dir }} repo={{ insights_source_repo }} version={{ INSIGHTS_VERSION }}
accept_hostkey=yes
ssh_opts="{{ insights_git_ssh_opts }}"
register
:
insights_code_checkout
notify
:
restart insights
sudo_user
:
"
{{
insights_user
}}"
-
name
:
write out app config file
template
:
>
src=edx/app/insights/insights.yaml.j2
dest={{ COMMON_CFG_DIR }}/{{ insights_service_name }}.yaml
mode=0644 owner={{ insights_user }} group={{ insights_user }}
notify
:
restart insights
-
name
:
install application requirements
pip
:
>
requirements="{{ insights_requirements_base }}/{{ item }}"
virtualenv="{{ insights_venv_dir }}" state=present
extra_args="--exists-action w"
sudo_user
:
"
{{
insights_user
}}"
notify
:
restart insights
with_items
:
insights_requirements
-
name
:
create nodeenv
shell
:
>
creates={{ insights_nodeenv_dir }}
{{ insights_venv_bin }}/nodeenv {{ insights_nodeenv_dir }}
sudo_user
:
"
{{
insights_user
}}"
-
name
:
install node dependencies
npm
:
executable={{ insights_nodeenv_bin }}/npm path={{ insights_code_dir }} production=yes
sudo_user
:
"
{{
insights_user
}}"
-
name
:
install bower dependencies
shell
:
>
chdir={{ insights_code_dir }}
. {{ insights_nodeenv_bin }}/activate && {{ insights_node_bin }}/bower install --production --config.interactive=false
sudo_user
:
"
{{
insights_user
}}"
-
name
:
migrate
shell
:
>
chdir={{ insights_code_dir }}
DB_MIGRATION_USER={{ COMMON_MYSQL_MIGRATE_USER }}
DB_MIGRATION_PASS={{ COMMON_MYSQL_MIGRATE_PASS }}
{{ insights_venv_bin }}/python {{ insights_manage }} migrate --noinput
sudo_user
:
"
{{
insights_user
}}"
environment
:
"
{{
insights_environment
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes"
-
name
:
run r.js optimizer
shell
:
>
chdir={{ insights_code_dir }}
. {{ insights_nodeenv_bin }}/activate && {{ insights_node_bin }}/r.js -o build.js
sudo_user
:
"
{{
insights_user
}}"
-
name
:
run collectstatic
shell
:
>
chdir={{ insights_code_dir }}
{{ insights_venv_bin }}/python {{ insights_manage }} {{ item }}
sudo_user
:
"
{{
insights_user
}}"
environment
:
"
{{
insights_environment
}}"
with_items
:
-
"
collectstatic
--noinput"
-
"
compress"
-
name
:
compile translations
shell
:
>
chdir={{ insights_code_dir }}/analytics_dashboard
. {{ insights_venv_bin }}/activate && i18n_tool generate -v
sudo_user
:
"
{{
insights_user
}}"
-
name
:
write out the supervisior wrapper
template
:
>
src=edx/app/insights/insights.sh.j2
dest={{ insights_app_dir }}/{{ insights_service_name }}.sh
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
notify
:
restart insights
-
name
:
write supervisord config
template
:
>
src=edx/app/supervisor/conf.d.available/insights.conf.j2
dest="{{ supervisor_available_dir }}/{{ insights_service_name }}.conf"
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
notify
:
restart insights
-
name
:
enable supervisor script
file
:
>
src={{ supervisor_available_dir }}/{{ insights_service_name }}.conf
dest={{ supervisor_cfg_dir }}/{{ insights_service_name }}.conf
state=link
force=yes
notify
:
restart insights
when
:
not disable_edx_services
-
name
:
update supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
when
:
not disable_edx_services
-
name
:
create symlinks from the venv bin dir
file
:
>
src="{{ insights_venv_bin }}/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.{{ insights_role_name }}"
state=link
with_items
:
-
python
-
pip
-
django-admin.py
-
name
:
create manage.py symlink
file
:
>
src="{{ insights_manage }}"
dest="{{ COMMON_BIN_DIR }}/manage.{{ insights_role_name }}"
state=link
-
name
:
remove read-only ssh key for the content repo
file
:
path={{ insights_git_identity_file }} state=absent
-
include
:
tag_ec2.yml tags=deploy
when
:
COMMON_TAG_EC2_INSTANCE
playbooks/roles/insights/tasks/main.yml
View file @
265e222e
...
...
@@ -21,7 +21,137 @@
#
#
-
fail
:
msg="You must provide a private key for the Insights repo"
when
:
not INSIGHTS_GIT_IDENTITY
-
name
:
install read-only ssh key
copy
:
>
content="{{ INSIGHTS_GIT_IDENTITY }}" dest={{ insights_git_identity_file }}
owner={{ insights_user }} group={{ insights_user }} mode=0600
-
include
:
deploy.yml tags=deploy
-
name
:
setup the insights env file
template
:
>
src="edx/app/insights/insights_env.j2"
dest="{{ insights_app_dir }}/insights_env"
owner={{ insights_user }}
group={{ insights_user }}
mode=0644
-
name
:
checkout code
git
:
>
dest={{ insights_code_dir }} repo={{ insights_source_repo }} version={{ INSIGHTS_VERSION }}
accept_hostkey=yes
ssh_opts="{{ insights_git_ssh_opts }}"
register
:
insights_code_checkout
notify
:
restart insights
sudo_user
:
"
{{
insights_user
}}"
-
name
:
write out app config file
template
:
>
src=edx/app/insights/insights.yaml.j2
dest={{ COMMON_CFG_DIR }}/{{ insights_service_name }}.yaml
mode=0644 owner={{ insights_user }} group={{ insights_user }}
notify
:
restart insights
-
name
:
install application requirements
pip
:
>
requirements="{{ insights_requirements_base }}/{{ item }}"
virtualenv="{{ insights_venv_dir }}" state=present
extra_args="--exists-action w"
sudo_user
:
"
{{
insights_user
}}"
notify
:
restart insights
with_items
:
insights_requirements
-
name
:
create nodeenv
shell
:
>
creates={{ insights_nodeenv_dir }}
{{ insights_venv_bin }}/nodeenv {{ insights_nodeenv_dir }}
sudo_user
:
"
{{
insights_user
}}"
-
name
:
install node dependencies
npm
:
executable={{ insights_nodeenv_bin }}/npm path={{ insights_code_dir }} production=yes
sudo_user
:
"
{{
insights_user
}}"
-
name
:
install bower dependencies
shell
:
>
chdir={{ insights_code_dir }}
. {{ insights_nodeenv_bin }}/activate && {{ insights_node_bin }}/bower install --production --config.interactive=false
sudo_user
:
"
{{
insights_user
}}"
-
name
:
migrate
shell
:
>
chdir={{ insights_code_dir }}
DB_MIGRATION_USER={{ COMMON_MYSQL_MIGRATE_USER }}
DB_MIGRATION_PASS={{ COMMON_MYSQL_MIGRATE_PASS }}
{{ insights_venv_bin }}/python {{ insights_manage }} migrate --noinput
sudo_user
:
"
{{
insights_user
}}"
environment
:
"
{{
insights_environment
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes"
-
name
:
run r.js optimizer
shell
:
>
chdir={{ insights_code_dir }}
. {{ insights_nodeenv_bin }}/activate && {{ insights_node_bin }}/r.js -o build.js
sudo_user
:
"
{{
insights_user
}}"
-
name
:
run collectstatic
shell
:
>
chdir={{ insights_code_dir }}
{{ insights_venv_bin }}/python {{ insights_manage }} {{ item }}
sudo_user
:
"
{{
insights_user
}}"
environment
:
"
{{
insights_environment
}}"
with_items
:
-
"
collectstatic
--noinput"
-
"
compress"
-
name
:
compile translations
shell
:
>
chdir={{ insights_code_dir }}/analytics_dashboard
. {{ insights_venv_bin }}/activate && i18n_tool generate -v
sudo_user
:
"
{{
insights_user
}}"
-
name
:
write out the supervisior wrapper
template
:
>
src=edx/app/insights/insights.sh.j2
dest={{ insights_app_dir }}/{{ insights_service_name }}.sh
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
notify
:
restart insights
-
name
:
write supervisord config
template
:
>
src=edx/app/supervisor/conf.d.available/insights.conf.j2
dest="{{ supervisor_available_dir }}/{{ insights_service_name }}.conf"
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
notify
:
restart insights
-
name
:
enable supervisor script
file
:
>
src={{ supervisor_available_dir }}/{{ insights_service_name }}.conf
dest={{ supervisor_cfg_dir }}/{{ insights_service_name }}.conf
state=link
force=yes
notify
:
restart insights
when
:
not disable_edx_services
-
name
:
update supervisor configuration
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
update"
when
:
not disable_edx_services
-
name
:
create symlinks from the venv bin dir
file
:
>
src="{{ insights_venv_bin }}/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.{{ insights_role_name }}"
state=link
with_items
:
-
python
-
pip
-
django-admin.py
-
name
:
create manage.py symlink
file
:
>
src="{{ insights_manage }}"
dest="{{ COMMON_BIN_DIR }}/manage.{{ insights_role_name }}"
state=link
-
name
:
remove read-only ssh key for the content repo
file
:
path={{ insights_git_identity_file }} state=absent
-
include
:
tag_ec2.yml tags=deploy
when
:
COMMON_TAG_EC2_INSTANCE
playbooks/roles/insights/tasks/tag_ec2.yml
deleted
100644 → 0
View file @
57cf1bb6
---
-
name
:
get instance information
action
:
ec2_facts
-
name
:
tag instance
ec2_tag
:
resource={{ ansible_ec2_instance_id }} region={{ ansible_ec2_placement_region }}
args
:
tags
:
"
version:insights"
:
"
{{
insights_source_repo
}}
{{
insights_code_checkout.after
|truncate(7,True,'')}}"
when
:
insights_code_checkout.after is defined
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment