Ansible和MariaDB。无法通过playbook安装MariaDB

时间:2014-01-09 05:19:42

标签: ubuntu vagrant mariadb ansible

对不起我的英语很差。

我坚持将MariaDB服务器安装到vagrant机器上。我有以下内容:

- name: install mariadb addons
  apt: pkg=software-properties-common state=latest
  sudo: yes

- name: add mariadb key
  apt_key: url=http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xcbcb082a1bb943db
  sudo: yes

- name: add mariadb repository
  apt_repository: repo='deb http://mirror.timeweb.ru/mariadb/repo/10.0/ubuntu precise main'
  sudo: yes
  notify:
    - update repositories

vagrant provision之后我得到以下内容:

TASK: [install mariadb addons] ************************************************ 
ok: [192.168.0.3]

TASK: [add mariadb key] ******************************************************* 
ok: [192.168.0.3]

TASK: [add mariadb repository] ************************************************ 
failed: [192.168.0.3] => {"failed": true}
msg: Could not import python modules: pycurl. Please install python-pycurl package.

FATAL: all hosts have already failed -- aborting

我做错了什么?如何在不安装python-pycurl包的情况下安装mariaDB?

1 个答案:

答案 0 :(得分:7)

将以下内容添加到ansible playbook文件的顶部

- name: install python-pycurl
  apt: pkg=python-pycurl state=latest
  sudo: yes

或者如果您安装了python-pip

- name: install curl-config
  apt: pkg=libcurl4-openssl-dev state=latest
  sudo: yes

- name: install python-pycurl
  pip: name=pycurl state=latest
  sudo: yes