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 @@ ...@@ -9,6 +9,7 @@
EDXAPP_OAUTH_ENFORCE_SECURE: false EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http EDXAPP_LMS_BASE_SCHEME: http
roles: roles:
- mysql
- edxlocal - edxlocal
- analytics_api - analytics_api
- analytics_pipeline - analytics_pipeline
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
- ecommerce - ecommerce
nginx_default_sites: nginx_default_sites:
- lms - lms
- mysql
- role: edxlocal - role: edxlocal
tags: edxlocal tags: edxlocal
- mongo - mongo
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
- ora - ora
nginx_default_sites: nginx_default_sites:
- lms - lms
- mysql
- edxlocal - edxlocal
- mongo - mongo
- edxapp - edxapp
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
- roles/xserver/defaults/main.yml - roles/xserver/defaults/main.yml
- roles/forum/defaults/main.yml - roles/forum/defaults/main.yml
roles: roles:
- mysql
- edxlocal - edxlocal
- mongo - mongo
- browsers - browsers
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
- xqueue - xqueue
nginx_default_sites: nginx_default_sites:
- lms - lms
- mysql
- edxlocal - edxlocal
- mongo - mongo
- { role: 'edxapp', celery_worker: True } - { role: 'edxapp', celery_worker: True }
......
--- ---
edxlocal_debian_pkgs: 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 - postfix
- libjpeg-dev - libjpeg-dev
......
# Installs packages to run edx locally on a single instance # 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 # TODO: Add a test to make sure mysql is running.
- 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
- name: create databases - name: create databases
mysql_db: 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 @@ ...@@ -17,6 +17,7 @@
EDXAPP_LMS_BASE_SCHEME: http EDXAPP_LMS_BASE_SCHEME: http
roles: roles:
- edx_ansible - edx_ansible
- mysql
- edxlocal - edxlocal
- mongo - mongo
- edxapp - edxapp
...@@ -27,4 +28,4 @@ ...@@ -27,4 +28,4 @@
- analytics_api - analytics_api
- analytics_pipeline - analytics_pipeline
- insights - insights
- local_dev - local_dev
\ No newline at end of file
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
EDXAPP_LMS_BASE_SCHEME: http EDXAPP_LMS_BASE_SCHEME: http
roles: roles:
- edx_ansible - edx_ansible
- mysql
- edxlocal - edxlocal
- mongo - mongo
- edxapp - edxapp
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
nginx_default_sites: nginx_default_sites:
- lms - lms
- cms - cms
- mysql
- edxlocal - edxlocal
- mongo - mongo
- edxapp - 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