Commit bcebcfc8 by Ben Patterson

Revert "OPS-241 Ansible: MySql 5.6 installs should remove the 'test' database"

parent bb4b7a8c
- name: Deploy MySQL
hosts: all
sudo: True
gather_facts: True
roles:
- mysql
---
mysql_debian_pkgs:
- software-properties-common
# 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
- mysql-server
......@@ -3,43 +3,43 @@
# - group_vars/all
# - common/tasks/main.yml
#
# This installs mysql-server-5.6
# 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
#
---
- name: Install PPA for installing MySQL 5.6 on Ubuntu 12.04LTS
# 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
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
repo='deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu precise main'
update_cache=yes
- name: install mysql 56 and dependencies
apt:
name: "{{ item }}"
install_recommends: yes
force: yes
state: present
with_items: mysql_debian_pkgs
- name: look for mysql 5.5
shell: dpkg -L mysql-server-5.5
ignore_errors: true
register: mysql_55_installed
- name: Ensure Anonymous user(s) does not exist
mysql_user:
name: ''
host: "{{ item }}"
state: absent
- 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:
- localhost
- "{{ ansible_hostname }}"
- software-properties-common
- mysql-server
- name: Remove the test database
mysql_db:
name: test
state: absent
- name: install mysql debian packages
apt: pkg={{ item }} install_recommends=yes state=present
with_items: mysql_debian_pkgs
- name: start mysql
service:
name: mysql
state: started
service: name=mysql state=started
---
#
# Tasks for fully removing mysql 5.5 from environments
# conditionally included when 5.5 is installed on the
# target system
#
- name: stop mysql
service: name=mysql state=stopped
- name: remove prior version of mysql
apt: pkg='{{ item }}' state='absent' purge='yes'
with_items:
- mysql-server-5.5
- mysql-server
\ No newline at end of file
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