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
3cf9ed1d
Commit
3cf9ed1d
authored
Nov 18, 2016
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Vagrantfiles less hard-coded, and more uniformly configurable
parent
7b48b008
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
60 deletions
+65
-60
vagrant/base/devstack/Vagrantfile
+25
-28
vagrant/release/devstack/Vagrantfile
+40
-32
No files found.
vagrant/base/devstack/Vagrantfile
View file @
3cf9ed1d
...
@@ -13,6 +13,22 @@ if ENV["VAGRANT_GUEST_IP"]
...
@@ -13,6 +13,22 @@ if ENV["VAGRANT_GUEST_IP"]
vm_guest_ip
=
ENV
[
"VAGRANT_GUEST_IP"
]
vm_guest_ip
=
ENV
[
"VAGRANT_GUEST_IP"
]
end
end
# These are versioning variables in the roles. Each can be overridden, first
# with OPENEDX_RELEASE, and then with a specific environment variable of the
# same name but upper-cased.
VERSION_VARS
=
[
'edx_platform_version'
,
'configuration_version'
,
'certs_version'
,
'forum_version'
,
'xqueue_version'
,
'demo_version'
,
'NOTIFIER_VERSION'
,
'ECOMMERCE_VERSION'
,
'ECOMMERCE_WORKER_VERSION'
,
'PROGRAMS_VERSION'
,
]
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
# Creates a devstack from a base Ubuntu 12.04 image for virtualbox
# Creates a devstack from a base Ubuntu 12.04 image for virtualbox
...
@@ -70,34 +86,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
...
@@ -70,34 +86,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
ansible
.
verbose
=
"vvvv"
ansible
.
verbose
=
"vvvv"
ansible
.
extra_vars
=
{}
ansible
.
extra_vars
=
{}
if
ENV
[
'OPENEDX_RELEASE'
]
VERSION_VARS
.
each
do
|
var
|
ansible
.
extra_vars
=
{
if
ENV
[
'OPENEDX_RELEASE'
]
edx_platform_version:
ENV
[
'OPENEDX_RELEASE'
],
ansible
.
extra_vars
[
var
]
=
ENV
[
'OPENEDX_RELEASE'
]
configuration_version:
ENV
[
'OPENEDX_RELEASE'
],
end
certs_version:
ENV
[
'OPENEDX_RELEASE'
],
env_var
=
var
.
upcase
forum_version:
ENV
[
'OPENEDX_RELEASE'
],
if
ENV
[
env_var
]
xqueue_version:
ENV
[
'OPENEDX_RELEASE'
],
ansible
.
extra_vars
[
var
]
=
ENV
[
env_var
]
demo_version:
ENV
[
'OPENEDX_RELEASE'
],
end
NOTIFIER_VERSION
:
ENV
[
'OPENEDX_RELEASE'
],
ECOMMERCE_VERSION
:
ENV
[
'OPENEDX_RELEASE'
],
ECOMMERCE_WORKER_VERSION
:
ENV
[
'OPENEDX_RELEASE'
],
PROGRAMS_VERSION
:
ENV
[
'OPENEDX_RELEASE'
],
}
end
if
ENV
[
'CONFIGURATION_VERSION'
]
ansible
.
extra_vars
[
'configuration_version'
]
=
ENV
[
'CONFIGURATION_VERSION'
]
end
if
ENV
[
'EDX_PLATFORM_VERSION'
]
ansible
.
extra_vars
[
'edx_platform_version'
]
=
ENV
[
'EDX_PLATFORM_VERSION'
]
end
if
ENV
[
'ECOMMERCE_VERSION'
]
ansible
.
extra_vars
[
'ECOMMERCE_VERSION'
]
=
ENV
[
'ECOMMERCE_VERSION'
]
end
if
ENV
[
'ECOMMERCE_WORKER_VERSION'
]
ansible
.
extra_vars
[
'ECOMMERCE_WORKER_VERSION'
]
=
ENV
[
'ECOMMERCE_WORKER_VERSION'
]
end
if
ENV
[
'PROGRAMS_VERSION'
]
ansible
.
extra_vars
[
'PROGRAMS_VERSION'
]
=
ENV
[
'PROGRAMS_VERSION'
]
end
end
end
end
end
end
vagrant/release/devstack/Vagrantfile
View file @
3cf9ed1d
...
@@ -8,37 +8,21 @@ VAGRANTFILE_API_VERSION = "2"
...
@@ -8,37 +8,21 @@ VAGRANTFILE_API_VERSION = "2"
MEMORY
=
4096
MEMORY
=
4096
CPU_COUNT
=
2
CPU_COUNT
=
2
$script
=
<<
SCRIPT
# These are versioning variables in the roles. Each can be overridden, first
if [ ! -d /edx/app/edx_ansible ]; then
# with OPENEDX_RELEASE, and then with a specific environment variable of the
echo "Error: Base box is missing provisioning scripts." 1>&2
# same name but upper-cased.
exit 1
VERSION_VARS
=
[
fi
'edx_platform_version'
,
OPENEDX_RELEASE=$1
'configuration_version'
,
export PYTHONUNBUFFERED=1
'certs_version'
,
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
'forum_version'
,
cd /edx/app/edx_ansible/edx_ansible/playbooks
'xqueue_version'
,
'demo_version'
,
# Did we specify an openedx release?
'NOTIFIER_VERSION'
,
if [ -n "$OPENEDX_RELEASE" ]; then
'ECOMMERCE_VERSION'
,
EXTRA_VARS="-e edx_platform_version=$OPENEDX_RELEASE \
'ECOMMERCE_WORKER_VERSION'
,
-e certs_version=$OPENEDX_RELEASE \
'PROGRAMS_VERSION'
,
-e forum_version=$OPENEDX_RELEASE \
]
-e xqueue_version=$OPENEDX_RELEASE \
-e demo_version=$OPENEDX_RELEASE \
-e NOTIFIER_VERSION=$OPENEDX_RELEASE \
-e ECOMMERCE_VERSION=$OPENEDX_RELEASE \
-e ECOMMERCE_WORKER_VERSION=$OPENEDX_RELEASE \
-e PROGRAMS_VERSION=$OPENEDX_RELEASE \
"
CONFIG_VER=$OPENEDX_RELEASE
else
CONFIG_VER="master"
fi
ansible-playbook -i localhost, -c local run_role.yml -e role=edx_ansible -e configuration_version=$CONFIG_VER $EXTRA_VARS
ansible-playbook -i localhost, -c local vagrant-devstack.yml -e configuration_version=$CONFIG_VER $EXTRA_VARS
SCRIPT
MOUNT_DIRS
=
{
MOUNT_DIRS
=
{
:edx_platform
=>
{
:repo
=>
"edx-platform"
,
:local
=>
"/edx/app/edxapp/edx-platform"
,
:owner
=>
"edxapp"
},
:edx_platform
=>
{
:repo
=>
"edx-platform"
,
:local
=>
"/edx/app/edxapp/edx-platform"
,
:owner
=>
"edxapp"
},
...
@@ -84,6 +68,30 @@ openedx_releases.default = "eucalyptus-devstack-2016-09-01"
...
@@ -84,6 +68,30 @@ openedx_releases.default = "eucalyptus-devstack-2016-09-01"
rel
=
ENV
[
'OPENEDX_RELEASE'
]
rel
=
ENV
[
'OPENEDX_RELEASE'
]
extra_vars_lines
=
""
if
rel
VERSION_VARS
.
each
do
|
var
|
extra_vars_lines
+=
"-e
#{
var
}
=
#{
rel
}
\\\n
"
end
end
$script
=
<<
SCRIPT
if [ ! -d /edx/app/edx_ansible ]; then
echo "Error: Base box is missing provisioning scripts." 1>&2
exit 1
fi
export PYTHONUNBUFFERED=1
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
cd /edx/app/edx_ansible/edx_ansible/playbooks
EXTRA_VARS="
#{
extra_vars_lines
}
"
CONFIG_VER="
#{
rel
||
'master'
}
"
ansible-playbook -i localhost, -c local run_role.yml -e role=edx_ansible -e configuration_version=$CONFIG_VER $EXTRA_VARS
ansible-playbook -i localhost, -c local vagrant-devstack.yml -e configuration_version=$CONFIG_VER $EXTRA_VARS
SCRIPT
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
reldata
=
openedx_releases
[
rel
]
reldata
=
openedx_releases
[
rel
]
...
@@ -153,5 +161,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
...
@@ -153,5 +161,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Assume that the base box has the edx_ansible role installed
# Assume that the base box has the edx_ansible role installed
# We can then tell the Vagrant instance to update itself.
# We can then tell the Vagrant instance to update itself.
config
.
vm
.
provision
"shell"
,
inline:
$script
,
args:
rel
config
.
vm
.
provision
"shell"
,
inline:
$script
end
end
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