S
S
silentvick2016-04-21 17:40:59
MySQL
silentvick, 2016-04-21 17:40:59

Vagrant + Ansible: how to solve MariaDB installation problem?

I'm setting up a virtual environment with Vagrant and ansible_local. I'm trying to install MariaDB 10.0. The installation task looks like this:

- name: install essential system packages
  become: yes
  apt: pkg={{ item }} state=latest update_cache=yes
  with_items:
    - curl
    - software-properties-common

- name: mysql | add keyserver
  become: yes
  apt_key: keyserver=hkp://keyserver.ubuntu.com:80 id=0xcbcb082a1bb943db

- name: mysql | add repository
  become: yes
  apt_repository: repo='deb [arch=amd64,i386] http://mirror.mephi.ru/mariadb/repo/10.0/ubuntu trusty main'

- name: mysql | install packages
  apt: pkg={{ item }} state=latest update_cache=yes
  become: yes
  with_items:
    - mariadb-server-10.0

When installing MariaDB, an error occurs:
/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"   install 'mariadb-server-10.0' 
failed:  * Stopping MariaDB database server mysqld
   ...done.
   dpkg: error processing package mariadb-server-10.0 (--configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     mariadb-server-10.0
    E: Sub-process /usr/bin/dpkg returned an error code (1)

apt log:
/usr/bin/apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install mariadb-server-10.0
Install: libaio1:amd64 (0.3.109-4, automatic), libreadline5:amd64 (5.2+dfsg-2, automatic), libmariadbclient18:amd64 (10.0.24+maria-1~trusty, automatic), mariadb-client-core-10.0:amd64 (10.0.24+maria-1~trusty, automatic), mariadb-server-core-10.0:amd64 (10.0.24+maria-1~trusty, automatic), libhtml-template-perl:amd64 (2.95-1, automatic), mysql-common:amd64 (10.0.24+maria-1~trusty, automatic), libmysqlclient18:amd64 (10.0.24+maria-1~trusty, automatic), mariadb-common:amd64 (10.0.24+maria-1~trusty, automatic), mariadb-client-10.0:amd64 (10.0.24+maria-1~trusty, automatic), mariadb-server-10.0:amd64 (10.0.24+maria-1~trusty), libdbd-mysql-perl:amd64 (4.025-1, automatic), libdbi-perl:amd64 (1.630-1, automatic)
Error: Sub-process /usr/bin/dpkg returned an error code (1)

At the same time, if you connect via ssh to the guest machine and try to install MariaDB manually, then the installation proceeds normally.
I'm using: Vagrant 1.8.1 and Ansible 2.0.2.0
Has anyone encountered a similar problem? How to bypass it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question