Commit 0c939db5 by Feanil Patel

Separate installing mysql for configuring apps that use it.

edxlocal is too generic and does a lot of things.  This is the beginning
of separating it into roles that are more single purpose and easier to
understand.
parent 2f4d2b56
......@@ -9,6 +9,7 @@
EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http
roles:
- mysql
- edxlocal
- analytics_api
- analytics_pipeline
......
......@@ -19,6 +19,7 @@
- ecommerce
nginx_default_sites:
- lms
- mysql
- role: edxlocal
tags: edxlocal
- mongo
......
......@@ -24,6 +24,7 @@
- ora
nginx_default_sites:
- lms
- mysql
- edxlocal
- mongo
- edxapp
......
......@@ -18,6 +18,7 @@
- roles/xserver/defaults/main.yml
- roles/forum/defaults/main.yml
roles:
- mysql
- edxlocal
- mongo
- browsers
......
......@@ -30,6 +30,7 @@
- xqueue
nginx_default_sites:
- lms
- mysql
- edxlocal
- mongo
- { role: 'edxapp', celery_worker: True }
......
---
edxlocal_debian_pkgs:
# Note that mysql 5.6 is installed from a non standard PPA in tasks/main.yml
# It is not listed here because of non-standard steps required to install
# mysql 5.6 on 12.04
- python-mysqldb
- postfix
- libjpeg-dev
......
# Installs packages to run edx locally on a single instance
# requires:
# - group_vars/all
# - common/tasks/main.yml
#
# This installs mysql-server-5.5 though
# in production we use mysql-5.1.62.
#
# We could install from source instead:
# http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.62.tar.gz
#
---
# Install PPA for installing MySQL 5.6 on Ubuntu 12.04LTS
- name: install ppa key
apt_key:
id=E5267A6C
url='{{ COMMON_UBUNTU_APT_KEYSERVER }}0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C'
state=present
- name: install apt repository
apt_repository:
repo='deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu precise main'
update_cache=yes
- name: look for mysql 5.5
shell: dpkg -L mysql-server-5.5
ignore_errors: true
register: mysql_55_installed
- include: remove_mysql_55.yml
when: mysql_55_installed.rc != 1
- name: install mysql 56 and dependencies
apt: pkg={{ item }} install_recommends=yes force=yes state=present
with_items:
- software-properties-common
- mysql-server
- name: start mysql
service: name=mysql state=started
- name: install packages needed for single server
apt: pkg={{','.join(edxlocal_debian_pkgs)}} install_recommends=yes state=present
# TODO: Add a test to make sure mysql is running.
- name: create databases
mysql_db:
......
---
mysql_debian_pkgs:
# Note that mysql 5.6 is installed from a non standard PPA in tasks/main.yml
# It is not listed here because of non-standard steps required to install
# mysql 5.6 on 12.04
- python-mysqldb
---
dependencies:
- common
# Installs packages to run edx locally on a single instance
# requires:
# - group_vars/all
# - common/tasks/main.yml
#
# This installs mysql-server-5.5 though
# in production we use mysql-5.1.62.
#
# We could install from source instead:
# http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.62.tar.gz
#
---
# Install PPA for installing MySQL 5.6 on Ubuntu 12.04LTS
- name: install ppa key
apt_key:
id=E5267A6C
url='{{ COMMON_UBUNTU_APT_KEYSERVER }}0x14AA40EC0831756756D7F66C4F4EA0AAE5267A6C'
state=present
- name: install apt repository
apt_repository:
repo='deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu precise main'
update_cache=yes
- name: look for mysql 5.5
shell: dpkg -L mysql-server-5.5
ignore_errors: true
register: mysql_55_installed
- include: remove_mysql_55.yml
when: mysql_55_installed.rc != 1
- name: install mysql 56 and dependencies
apt: pkg={{ item }} install_recommends=yes force=yes state=present
with_items:
- software-properties-common
- mysql-server
- name: start mysql
service: name=mysql state=started
- name: install packages needed for single server
apt: pkg={{','.join(mysql_debian_pkgs)}} install_recommends=yes state=present
......@@ -17,6 +17,7 @@
EDXAPP_LMS_BASE_SCHEME: http
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
......@@ -27,4 +28,4 @@
- analytics_api
- analytics_pipeline
- insights
- local_dev
\ No newline at end of file
- local_dev
......@@ -17,6 +17,7 @@
EDXAPP_LMS_BASE_SCHEME: http
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
......
......@@ -27,6 +27,7 @@
nginx_default_sites:
- lms
- cms
- mysql
- edxlocal
- mongo
- edxapp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment