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
edx
configuration
Commits
276cd811
Commit
276cd811
authored
Sep 24, 2013
by
Sef Kloninger
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #275 from edx/sef/notifier-west
Notifier install fixes / seen while installing at Stanford
parents
0823ff88
d9f4c00a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
101 deletions
+57
-101
playbooks/edx-west/carnegie-prod-app.yml
+2
-5
playbooks/edx-west/prod-worker.yml
+17
-1
playbooks/edx-west/stage-worker.yml
+18
-0
playbooks/roles/notifier/defaults/main.yml
+2
-0
playbooks/roles/notifier/files/git_ssh.sh
+0
-2
playbooks/roles/notifier/files/opt/notifier/bin/forums_digest.sh
+0
-8
playbooks/roles/notifier/tasks/deploy.yml
+11
-64
playbooks/roles/notifier/tasks/main.yml
+7
-21
No files found.
playbooks/edx-west/carnegie-prod-app.yml
View file @
276cd811
# we never want to migrate from these machines, so note no vars_prompt
# section like other appservers
-
hosts
:
~tag_Name_app(10|20)_carn
sudo
:
True
vars_prompt
:
...
...
@@ -9,7 +6,7 @@
default
:
"
no"
private
:
no
vars
:
secure_dir
:
'
../../../
edx-secret
/ansible'
secure_dir
:
'
../../../
configuration-secure
/ansible'
# this indicates the path to site-specific (with precedence)
# things like nginx template files
#local_dir: '../../../edx-secret/ansible/local'
...
...
@@ -21,7 +18,7 @@
-
"
{{
secure_dir
}}/vars/edxapp_prod_users.yml"
roles
:
-
common
-
{
'
role'
:
'
nginx'
,
'
nginx_conf'
:
true
}
-
{
'
role'
:
'
nginx'
,
'
nginx_conf'
:
true
}
-
{
'
role'
:
'
edxapp'
,
'
openid_workaround'
:
true
,
'
template_subdir'
:
'
carnegie'
}
# run this role last
# - in_production
playbooks/edx-west/prod-worker.yml
View file @
276cd811
#
this gets all running prod webserver
s
#
For all util machine
s
-
hosts
:
tag_environment_prod:&tag_function_util
# or we can get subsets of them by name
#- hosts: ~tag_Name_util(1|2)_prod
...
...
@@ -17,3 +17,19 @@
roles
:
-
common
-
{
role
:
'
edxapp'
,
celery_worker
:
True
}
# run the notifier on the first util machine only
-
hosts
:
~tag_Name_util10_prod
sudo
:
True
vars
:
secure_dir
:
'
../../../configuration-secure/ansible'
migrate_db
:
"
no"
vars_files
:
-
"
{{
secure_dir
}}/vars/edxapp_prod_vars.yml"
-
"
{{
secure_dir
}}/vars/notifier_prod_vars.yml"
roles
:
-
role
:
virtualenv
virtualenv_user
:
"
notifier"
virtualenv_user_home
:
"
/opt/wwc/notifier"
virtualenv_name
:
"
notifier"
-
notifier
playbooks/edx-west/stage-worker.yml
View file @
276cd811
...
...
@@ -5,6 +5,8 @@
sudo
:
True
vars
:
secure_dir
:
../../../edx-secret/ansible
# this indicates the path to site-specific (with precedence)
# things like nginx template files
local_dir
:
../../../edx-secret/ansible/local
migrate_db
:
"
no"
vars_files
:
...
...
@@ -14,3 +16,19 @@
roles
:
-
common
-
{
role
:
'
edxapp'
,
celery_worker
:
True
}
# run the notifier on the first util machine only
-
hosts
:
~tag_Name_util10_stage
sudo
:
True
vars
:
secure_dir
:
'
../../../configuration-secure/ansible'
migrate_db
:
"
no"
vars_files
:
-
"
{{
secure_dir
}}/vars/edxapp_stage_vars.yml"
-
"
{{
secure_dir
}}/vars/notifier_stage_vars.yml"
roles
:
-
role
:
virtualenv
virtualenv_user
:
"
notifier"
virtualenv_user_home
:
"
/opt/wwc/notifier"
virtualenv_name
:
"
notifier"
-
notifier
playbooks/roles/notifier/defaults/main.yml
View file @
276cd811
...
...
@@ -41,6 +41,8 @@ notifier_supervisor_log_dest: "/mnt/logs/supervisor"
notifer_requests_ca_bundle
:
"
/etc/ssl/certs/ca-certificates.crt"
notifier_dd_api_key
:
"
NOT_USED"
# data dog
notifier_debian_pkgs
:
-
apparmor-utils
-
build-essential
...
...
playbooks/roles/notifier/files/git_ssh.sh
deleted
100644 → 0
View file @
0823ff88
#!/bin/sh
exec
/usr/bin/ssh
-o
StrictHostKeyChecking
=
no
-i
/etc/git-identity
"
$@
"
playbooks/roles/notifier/files/opt/notifier/bin/forums_digest.sh
deleted
100644 → 0
View file @
0823ff88
#!/bin/bash
.
$HOME
/.bashrc
minutes
=
$1
digest_date
=
`
date
--utc
'+%Y-%m-%dT%H:%MZ'
`
cd
/opt/wwc/notifier/src
&&
/opt/wwc/notifier/virtualenvs/notifier/bin/python /opt/wwc/notifier/src/manage.py forums_digest
--to_datetime
=
${
digest_date
}
--minutes
=
${
minutes
}
playbooks/roles/notifier/tasks/deploy.yml
View file @
276cd811
#
# TODO: Needed while this repo is private
#
-
name
:
notifier | upload ssh script
copy
:
src=git_ssh.sh dest=/tmp/git_ssh.sh
force=yes owner=root group=adm mode=750
notify
:
-
notifier | restart notifier
tags
:
-
notifier
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
notifier | install read-only ssh key required for checkout
copy
:
src={{ notifier_git_identity_path }} dest=/etc/git-identity
force=yes owner=ubuntu group=adm mode=60
tags
:
-
notifier
-
deploy
-
install
-
update
-
name
:
notifier | stop notifier-scheduler
supervisorctl
:
name=notifier-scheduler state=restarted
---
-
name
:
notifier | stop notifier-celery-beat
supervisorctl
:
name=notifier-celery-beat state=restarted
ignore_errors
:
yes
-
name
:
notifier | stop notifier-celery-workers
supervisorctl
:
name=notifier-celery-workers state=restarted
ignore_errors
:
yes
-
name
:
notifier | checkout code
git
:
dest={{ notifier_code_dir }} repo={{ notifier_source_repo }}
version={{ notifier_version }}
environment
:
GIT_SSH
:
/tmp/git_ssh.sh
notify
:
-
notifier | restart notifier
tags
:
...
...
@@ -46,40 +19,14 @@
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
notifier | update src permissions
-
name
:
notifier | source repo group perms
file
:
path={{ notifier_code_dir }} state=directory owner={{ notifier_user }}
group={{ notifier_user }} mode=2750 recurse=yes
tags
:
-
notifier
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
notifier | remove read-only ssh key for the content repo
file
:
path=/etc/git-identity state=absent
tags
:
-
notifier
-
deploy
-
install
-
update
#
# TODO: Needed while this repo is private
#
-
name
:
notifier | remove ssh script
file
:
path=/tmp/git_ssh.sh state=absent
path={{ notifier_source_repo }} mode=2775 state=directory
tags
:
-
notifier
-
deploy
-
install
-
update
-
notifier
-
deploy
-
install
-
update
-
name
:
notifier | install application requirements
pip
:
...
...
playbooks/roles/notifier/tasks/main.yml
View file @
276cd811
...
...
@@ -96,7 +96,6 @@
owner={{ notifier_user }}
group={{ notifier_user }}
-
name
:
notifier | ensure .bashrc exists
shell
:
touch {{ notifier_home }}/.bashrc
sudo
:
true
...
...
@@ -126,16 +125,17 @@
-
install
-
update
-
name
:
notifier | create notifier/
bin
directory
file
:
path="{{ notifier_home }}/
bin
" mode=2775 state=directory
-
name
:
notifier | create notifier/
db
directory
file
:
path="{{ notifier_home }}/
db
" mode=2775 state=directory
tags
:
-
notifier
-
install
-
update
-
name
:
notifier | make the script executable
file
:
path={{ notifier_home }}/bin/forums_digest.sh state=file mode=2755
-
name
:
notifier | create notifier/bin directory
file
:
path="{{ notifier_home }}/bin" mode=2775 state=directory
tags
:
-
notifier
-
install
...
...
@@ -168,17 +168,4 @@
-
install
-
update
-
name
:
notifier | add cron job
cron
:
name="forums digest" hour={{ notifier_cron_hour }}
minute="{{ notifier_cron_minute }}" job="$HOME/forums_digest.sh 1440"
state="absent"
sudo
:
true
sudo_user
:
"
{{
notifier_user
}}"
tags
:
-
notifier
-
install
-
update
-
clean
-
include
:
deploy.yml
\ No newline at end of file
-
include
:
deploy.yml
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