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
90f720c2
Commit
90f720c2
authored
Mar 10, 2014
by
Sef Kloninger
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #861 from edx/sef/edx-west/parameterize-machines-in-playbooks-master
Parameterize machine names in edx-west playbooks
parents
13baf1b5
41514f35
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
56 deletions
+63
-56
playbooks/edx-west/README.md
+9
-3
playbooks/edx-west/carnegie-prod-app.yml
+6
-6
playbooks/edx-west/carnegie-prod-worker.yml
+8
-4
playbooks/edx-west/cme-prod-app.yml
+6
-10
playbooks/edx-west/cme-prod-worker.yml
+7
-4
playbooks/edx-west/prod-app.yml
+6
-14
playbooks/edx-west/prod-worker.yml
+7
-4
playbooks/edx-west/stage-app.yml
+6
-7
playbooks/edx-west/stage-worker.yml
+8
-4
No files found.
playbooks/edx-west/README.md
View file @
90f720c2
...
@@ -31,13 +31,19 @@ sure that the stanford-deploy-20130415 ssh key is in your ssh agent.
...
@@ -31,13 +31,19 @@ sure that the stanford-deploy-20130415 ssh key is in your ssh agent.
Some specifics:
Some specifics:
*
To hit multiple machines the -e parameter would look like this:
```"machine=app(1|2|4)"```
.
*
To do database migrations, include this:
```-e "migrate_db=yes"```
. The default
behavior is to not do migrations.
*
To hit multiple machines the use this:
```-e "machine=app(1|2|4)"```
.
Use multiple separate "-e" options to specify multiple vars on the
command line.
*
Usually I do with the
```--list-hosts```
option first to verify that I'm
*
Usually I do with the
```--list-hosts```
option first to verify that I'm
doing something sane before actually running.
doing something sane before actually running.
*
To do the utility machines, use
```prod-worker.yml```
. Those also
*
To install the utility machines, substitute
```prod-worker.yml```
. Those
take the machine variable.
are also parameterized on the take the machine variable (util1, util(1|2),
and so forth).
## Ansible Commands - Stage
## Ansible Commands - Stage
...
...
playbooks/edx-west/carnegie-prod-app.yml
View file @
90f720c2
-
hosts
:
~tag_Name_app(10|20)_carn
# 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}}_carn
pre_tasks
:
-
fail
:
msg="This playbook only runnable on 'app' machines"
when
:
"
'app'
not
in
machine"
sudo
:
True
sudo
:
True
vars_prompt
:
-
name
:
"
migrate_db"
prompt
:
"
Should
this
playbook
run
database
migrations?
(Type
'yes'
to
run,
anything
else
to
skip
migrations)"
default
:
"
no"
private
:
no
vars
:
vars
:
secure_dir
:
'
../../../configuration-secure/ansible'
secure_dir
:
'
../../../configuration-secure/ansible'
# this indicates the path to site-specific (with precedence)
# this indicates the path to site-specific (with precedence)
...
...
playbooks/edx-west/carnegie-prod-worker.yml
View file @
90f720c2
# this gets all running prod webservers
-
name
:
Basic util setup on carnegie workers
-
hosts
:
tag_environment_prod_carn:&tag_function_util
# This uses variable expansion so you can select machine(s) from the command line
# or we can get subsets of them by name
# using the -e flag. See README for instructions on how to use.
#- hosts: ~tag_Name_util(10)_carn
hosts
:
~tag_Name_{{machine}}_carn
pre_tasks
:
-
fail
:
msg="This playbook only runnable on 'util' machines"
when
:
"
'util'
not
in
machine"
sudo
:
True
sudo
:
True
gather_facts
:
True
vars
:
vars
:
secure_dir
:
'
../../../edx-secret/ansible'
secure_dir
:
'
../../../edx-secret/ansible'
# this indicates the path to site-specific (with precedence)
# this indicates the path to site-specific (with precedence)
...
...
playbooks/edx-west/cme-prod-app.yml
View file @
90f720c2
...
@@ -9,17 +9,13 @@
...
@@ -9,17 +9,13 @@
# - apt: pkg=libzmq-dev,python-zmq state=present
# - apt: pkg=libzmq-dev,python-zmq state=present
# - action: fireball
# - action: fireball
# This uses variable expansion so you can select machine(s) from the command line
# this gets all running prod webservers
# using the -e flag. See README for instructions on how to use.
#- hosts: tag_environment_prod:&tag_function_webserver
-
hosts
:
~tag_Name_{{machine}}_cme
# or we can get subsets of them by name
pre_tasks
:
-
hosts
:
~tag_Name_app(10|20)_cme
-
fail
:
msg="This playbook only runnable on 'app' machines"
when
:
"
'app'
not
in
machine"
sudo
:
True
sudo
:
True
vars_prompt
:
-
name
:
"
migrate_db"
prompt
:
"
Should
this
playbook
run
database
migrations?
(Type
'yes'
to
run,
anything
else
to
skip
migrations)"
default
:
"
no"
private
:
no
vars
:
vars
:
secure_dir
:
'
../../../edx-secret/ansible'
secure_dir
:
'
../../../edx-secret/ansible'
# this indicates the path to site-specific (with precedence)
# this indicates the path to site-specific (with precedence)
...
...
playbooks/edx-west/cme-prod-worker.yml
View file @
90f720c2
# this gets all running prod webservers
-
name
:
Basic util setup on cme hosts
-
hosts
:
tag_environment_prod_cme:&tag_function_util
# This uses variable expansion so you can select machine(s) from the command line
# or we can get subsets of them by name
# using the -e flag. See README for instructions on how to use.
#- hosts: ~tag_Name_util(10)_cme
hosts
:
~tag_Name_{{machine}}_cme
pre_tasks
:
-
fail
:
msg="This playbook only runnable on 'util' machines"
when
:
"
'util'
not
in
machine"
sudo
:
True
sudo
:
True
vars
:
vars
:
secure_dir
:
'
../../../edx-secret/ansible'
secure_dir
:
'
../../../edx-secret/ansible'
...
...
playbooks/edx-west/prod-app.yml
View file @
90f720c2
# this gets all running prod webservers
# This uses variable expansion so you can select machine(s) from the command line
#- hosts: tag_environment_prod:&tag_function_webserver
# using the -e flag. See README for instructions on how to use.
# or we can get subsets of them by name
-
hosts
:
~tag_Name_{{machine}}_prod
#- hosts: ~tag_Name_app(10|20)_prod
pre_tasks
:
-
hosts
:
~tag_Name_app(11|21)_prod
-
fail
:
msg="This playbook only runnable on 'app' machines"
## this is the test box
when
:
"
'app'
not
in
machine"
#- hosts: ~tag_Name_app4_prod
## you can also do security group, but don't do that
#- hosts: security_group_edx-prod-EdxappServerSecurityGroup-NSKCQTMZIPQB
sudo
:
True
sudo
:
True
vars_prompt
:
-
name
:
"
migrate_db"
prompt
:
"
Should
this
playbook
run
database
migrations?
(Type
'yes'
to
run,
anything
else
to
skip
migrations)"
default
:
"
no"
private
:
no
vars
:
vars
:
secure_dir
:
'
../../../configuration-secure/ansible'
secure_dir
:
'
../../../configuration-secure/ansible'
# this indicates the path to site-specific (with precedence)
# this indicates the path to site-specific (with precedence)
...
...
playbooks/edx-west/prod-worker.yml
View file @
90f720c2
# For all util machines
-
name
:
Basic util setup on all hosts
-
hosts
:
tag_environment_prod:&tag_function_util
# This uses variable expansion so you can select machine(s) from the command line
# or we can get subsets of them by name
# using the -e flag. See README for instructions on how to use.
#- hosts: ~tag_Name_util(1|2)_prod
hosts
:
~tag_Name_{{machine}}_prod
pre_tasks
:
-
fail
:
msg="This playbook only runnable on 'util' machines"
when
:
"
'util'
not
in
machine"
sudo
:
True
sudo
:
True
vars
:
vars
:
secure_dir
:
'
../../../configuration-secure/ansible'
secure_dir
:
'
../../../configuration-secure/ansible'
...
...
playbooks/edx-west/stage-app.yml
View file @
90f720c2
-
hosts
:
tag_environment_stage:&tag_function_webserver
# This uses variable expansion so you can select machine(s) from the command line
#- hosts: tag_Name_app1_stage
# using the -e flag. See README for instructions on how to use.
-
hosts
:
~tag_Name_{{ machine }}_stage
pre_tasks
:
-
fail
:
msg="This playbook only runnable on 'app' machines"
when
:
"
'app'
not
in
machine"
sudo
:
True
sudo
:
True
vars_prompt
:
-
name
:
"
migrate_db"
prompt
:
"
Should
this
playbook
run
database
migrations?
(Type
'yes'
to
run,
anything
else
to
skip
migrations)"
default
:
"
no"
private
:
no
vars
:
vars
:
not_prod
:
true
not_prod
:
true
secure_dir
:
../../../edx-secret/ansible
secure_dir
:
../../../edx-secret/ansible
...
...
playbooks/edx-west/stage-worker.yml
View file @
90f720c2
# this gets all running stage util machiens
---
-
hosts
:
tag_environment_stage:&tag_function_util
-
name
:
Basic util setup on all hosts
# or we can get subsets of them by name
# This uses variable expansion so you can select machine(s) from the command line
#- hosts: ~tag_Name_util(1|2)_stage
# using the -e flag. See README for instructions on how to use.
hosts
:
~tag_Name_{{machine}}_stage
pre_tasks
:
-
fail
:
msg="This playbook only runnable on 'util' machines"
when
:
"
'util'
not
in
machine"
sudo
:
True
sudo
:
True
vars
:
vars
:
secure_dir
:
../../../edx-secret/ansible
secure_dir
:
../../../edx-secret/ansible
...
...
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