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
a9702805
Commit
a9702805
authored
Mar 06, 2014
by
Sef Kloninger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edx-west: parameterize machine names in playbooks
parent
d02339a8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
16 deletions
+70
-16
playbooks/edx-west/README.md
+49
-0
playbooks/edx-west/prod-app.yml
+5
-9
playbooks/edx-west/prod-worker.yml
+5
-3
playbooks/edx-west/stage-app.yml
+5
-2
playbooks/edx-west/stage-worker.yml
+6
-2
No files found.
playbooks/edx-west/README.md
0 → 100644
View file @
a9702805
# Stanford Ansible Configuration Files
This directory has the live playbooks that we use here at Stanford to
maintain our instance of OpenEdX at
[
class.stanford.edu
][
c
]
. We check
it in to this public repo since we think that others might benefit from
seeing how we are configured.
[
c
]:
https://class.stanford.edu/
That said, we haven't documented things in here well, so we have no
expectation that others will be able to make enough sense of this to
give us useful contributions back. Generally a PR affecting files in
here will be ignored / rejected.
This README is a useful proximate place to keep commands. But it is
a public repo so we shouldn't store anything confidential in here.
Other install docs:
-
Giulio's install doc
[
here
][
1
]
.
[
1
]:
https://docs.google.com/document/d/1ZDx51Jxa-zffyeKvHmTp_tIskLW9D9NRg9NytPTbnrA/edit#heading=h.iggugvghbcpf
## Ansible Commands - Prod
Generally we do installs as the "ubuntu" user. You want to make
sure that the stanford-deploy-20130415 ssh key is in your ssh agent.
ANSIBLE_CONFIG=prod-ansible.cfg ANSIBLE_EC2_INI=prod-ec2.ini ansible-playbook prod-app.yml -e "machine=app4" -u ubuntu -c ssh -i ./ec2.py
Some specifics:
*
To hit multiple machines the -e parameter would look like this:
```"machine=app(1|2|4)"```
.
*
Usually I do with the
```--list-hosts```
option first to verify that I'm
doing something sane before actually running.
*
To do the utility machines, use
```prod-worker.yml```
. Those also
take the machine variable.
## Ansible Commands - Stage
Command is:
ANSIBLE_CONFIG=stage-ansible.cfg ANSIBLE_EC2_INI=stage-ec2.ini ansible-playbook stage-app.yml -e "machine=app1" -u ubuntu -c ssh -i ./ec2.py
playbooks/edx-west/prod-app.yml
View file @
a9702805
# this gets all running prod webservers
# This uses variable expansion so you can select machine(s) from the command line
# using the -e flag. See README for instructions on how to use.
-
hosts
:
~tag_Name_{{machine}}_prod
#
# This alternative hits all running prod webservers. Left here as an example.
#- hosts: tag_environment_prod:&tag_function_webserver
# or we can get subsets of them by name
#- hosts: ~tag_Name_app1_prod
#- hosts: ~tag_Name_app2_prod
## this is the test box
-
hosts
:
~tag_Name_app4_prod
#- hosts: ~tag_Name_app(4|1|2)_prod
## you can also do security group, but don't do that
#- hosts: security_group_edx-prod-EdxappServerSecurityGroup-NSKCQTMZIPQB
sudo
:
True
vars_prompt
:
-
name
:
"
migrate_db"
...
...
playbooks/edx-west/prod-worker.yml
View file @
a9702805
-
name
:
Basic util setup on all hosts
# For all util machines
# This uses variable expansion so you can select machine(s) from the command line
# using the -e flag. See README for instructions on how to use.
hosts
:
~tag_Name_{{machine}}_prod
#
# This alternative hits all running prod webservers. Left here as an example.
# hosts: tag_environment_prod:&tag_function_util
# or we can get subsets of them by name
hosts
:
~tag_Name_util(1|2)_prod
sudo
:
True
gather_facts
:
True
vars
:
...
...
playbooks/edx-west/stage-app.yml
View file @
a9702805
# This uses variable expansion so you can select machine(s) from the command line
# using the -e flag. See README for instructions on how to use.
-
hosts
:
~tag_Name_{{machine}}_stage
#
# This alternative hits all running prod webservers. Left here as an example.
#- hosts: tag_environment_stage:&tag_function_webserver
#- hosts: ~tag_Name_app10_stage
-
hosts
:
~tag_Name_app1_stage
sudo
:
True
vars_prompt
:
-
name
:
"
migrate_db"
...
...
playbooks/edx-west/stage-worker.yml
View file @
a9702805
---
-
name
:
Basic util setup on all hosts
#- hosts: tag_environment_stage:&tag_function_util
hosts
:
~tag_Name_util1_stage
# This uses variable expansion so you can select machine(s) from the command line
# using the -e flag. See README for instructions on how to use.
hosts
:
~tag_Name_{{machine}}_stage
#
# This alternative hits all running prod webservers. Left here as an example.
# hosts: tag_environment_stage:&tag_function_util
sudo
:
True
gather_facts
:
True
vars
:
...
...
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