---
- name: Add MySQL repo
  sudo: yes
  yum: name=http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm state=present


- name: Install MySQL packages
  sudo: yes
  yum: pkg={{ item }} state=latest
  with_items: mysql.packages
  when: mysql.packages is defined

- name: Install python devel
  sudo: yes
  yum: pkg=python-devel

- name: Install pip
  sudo: yes
  yum: pkg=python-pip 

- name: Start MySQL manually
  sudo: yes
  shell: service mysqld start

- name: Install the Python MySQLB module
  sudo: yes
  pip: name=MySQL-python

- name: Update root password for all root accounts
  mysql_user: name=root host={{ item }} check_implicit_admin=yes password={{ mysql.root_password }} login_user=root login_password={{ mysql.mysql_old_root_password }}
  with_items: mysql.hosts
  when: mysql.hosts is defined 
---
- name: Add MySQL repo
  sudo: yes
  yum: name=http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm state=present


- name: Install MySQL packages
  sudo: yes
  yum: pkg={{ item }} state=latest
  with_items: mysql.packages
  when: mysql.packages is defined

- name: Install python devel
  sudo: yes
  yum: pkg=python-devel

- name: Install pip
  sudo: yes
  yum: pkg=python-pip

- name: Upgrade pip
  sudo: yes
  shell: pip install --upgrade pip

- name: Start MySQL manually
  sudo: yes
  shell: service mysqld start

- name: Install the Python MySQLB module
  sudo: yes
  pip: name=MySQL-python

- name: Create Database
  mysql_db: name={{ mysql.name }} state=present

- name: Update root password for all root accounts
  mysql_user: name=root host={{ item }} check_implicit_admin=yes password={{ mysql.root_password }} login_user=root login_password={{ mysql.mysql_old_root_password }}
  with_items: mysql.hosts
  when: mysql.hosts is defined 
Create database. Name set in all.yml
[Vagrant] Create database. Name set in all.yml
