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
4b09ed14
Commit
4b09ed14
authored
Dec 08, 2015
by
Edward Zarecor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ansible bootstrap script
parent
22af1bf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
0 deletions
+120
-0
Makefile
+14
-0
util/install/ansible-bootstrap.sh
+106
-0
No files found.
Makefile
0 → 100755
View file @
4b09ed14
help
:
@
echo
' '
@
echo
'Makefile for the edX Configuration '
@
echo
' '
@
echo
'Usage: '
@
echo
' make requirements install requirements '
@
echo
' '
requirements
:
pip install
-qr
pre-requirements.txt
--exists-action
w
pip install
-qr
requirements.txt
--exists-action
w
# Targets in a Makefile which do not produce an output file with the same name as the target name
.PHONY
:
help requirements
util/install/ansible-bootstrap.sh
0 → 100755
View file @
4b09ed14
#!/usr/bin/env bash
#
# Script for installing Ansible and the edX configuration repostory
# onto a host to enable running ansible to complete configuration.
# This script can be used by Docker, Packer or any other system
# for building images that requires having ansible available.
#
set
-xe
if
[[
-z
"
$ANSIBLE_REPO
"
]]
;
then
ANSIBLE_REPO
=
"https://github.com/edx/ansible.git"
fi
if
[[
-z
"
$ANSIBLE_VERSION
"
]]
;
then
ANSIBLE_VERSION
=
"master"
fi
if
[[
-z
"
$CONFIGURATION_REPO
"
]]
;
then
CONFIGURATION_REPO
=
"https://github.com/edx/configuration.git"
fi
if
[[
-z
"
$CONFIGURATION_VERSION
"
]]
;
then
CONFIGURATION_VERSION
=
"e0d/hacking"
fi
#
# Bootstrapping constants
#
VIRTUAL_ENV
=
"/tmp/bootstrap"
PYTHON_BIN
=
"
${
VIRTUAL_ENV
}
/bin"
ANSIBLE_DIR
=
"/tmp/ansible"
CONFIGURATION_DIR
=
"/tmp/configuration"
cat
<<
EOF
******************************************************************************
Running the edx-ansible bootstrap script with the following arguments:
ANSIBLE_REPO="
${
ANSIBLE_REPO
}
"
ANSIBLE_VERSION="
${
ANSIBLE_VERSION
}
"
CONFIGURATION_REPO="
${
CONFIGURATION_REPO
}
"
CONFIGURATION_VERSION="
${
CONFIGURATION_VERSION
}
"
******************************************************************************
EOF
if
[[
$(
id
-u
)
-ne
0
]]
;
then
"Please run as root"
;
exit
1
;
fi
if
!
grep
-q
'Precise Pangolin'
/etc/os-release
;
then
cat
<<
EOF
This script is only known to work on Ubuntu Precise, exiting.
If you are interested in helping make installation possible
on other platforms, let us know.
EOF
exit
1
;
fi
# Upgrade the OS
apt-get update
-y
apt-get upgrade
-y
# Required for add-apt-repository
apt-get install
-y
software-properties-common python-software-properties git
# Install python 2.7.10
add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt-get update
-y
apt-get install
-y
build-essential
sudo
python2.7 python2.7-dev python-pip python-apt python-yaml python-jinja2 libmysqlclient-dev
pip install
virtualenv
==
13.1.2
# create a new virtual env
/usr/local/bin/virtualenv
${
VIRTUAL_ENV
}
PATH
=
${
PYTHON_BIN
}
:
${
PATH
}
# Install the configuration repository to install
# edx-ansible role
git clone
${
CONFIGURATION_REPO
}
${
CONFIGURATION_DIR
}
cd
${
CONFIGURATION_DIR
}
git checkout
${
CONFIGURATION_VERSION
}
make requirements
cd
${
CONFIGURATION_DIR
}
/playbooks/edx-east
${
PYTHON_BIN
}
/ansible-playbook edx_ansible.yml
-i
'127.0.0.1,'
-c
local
-e
"configuration_version=
${
CONFIGURATION_VERSION
}
"
# cleanup
rm
-rf
${
ANSIBLE_DIR
}
rm
-rf
${
CONFIGURATION_DIR
}
rm
-rf
${
VIRTUAL_ENV
}
cat
<<
EOF
******************************************************************************
Done bootstrapping, edx-ansible is now installed in /edx/app/edx-ansible.
Time to run some plays.
******************************************************************************
EOF
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