Ansible flask教程无法安装

时间:2015-08-11 03:44:53

标签: python flask ansible

我正在关注本教程: http://mattupstate.com/python/devops/2012/08/07/flask-wsgi-application-deployment-with-ubuntu-ansible-nginx-supervisor-and-uwsgi.html

我在EC2上安装了Ubuntu图像并尝试运行playbook,我收到以下错误:

  

任务:[安装python应用程序开发所需的常用包] *****
      失败:[54.173.67.23] => (项目= libpq的-dev的,的libmysqlclient-dev的,的libxml2-dev的,中的libjpeg62,中的libjpeg62-dev的,libfreetype6,libfreetype6-dev的,的zlib1g-dev的,MySQL的客户端,蟒-dev的,蟒-setuptools的,蟒成像,蟒-MySQLdb的,python-psycopg2,git-core,nginx)=> {“failed”:true,“item”:“libpq-dev,libmysqlclient-dev,libxml2-dev,libjpeg62,libjpeg62-dev,libfreetype6,libfreetype6-dev,zlib1g-dev,mysql-client,python-dev,python- setuptools的,蟒成像,蟒-MySQLdb的,蟒-psycopg2,GIT中核,nginx的“}
      msg:没有匹配'$ item'的包可用       致命:所有主机都已经失败 - 中止

不确定是什么问题?

1 个答案:

答案 0 :(得分:1)

您引用的教程已过期。 Ansible手册使用的语法现在无效。试试这个

- name: Install python packages
  connection: local
  hosts: 127.0.0.1
  tasks: 
  - name: add nginx ppa
    apt_repository: 
      repo: "ppa:nginx/stable"

  - name: install common packages needed for python application development
    apt: 
      name: "{{ item }}"
    with_items:
      - libpq-dev
      - libmysqlclient-dev
      - libxml2-dev
      - libjpeg62
      - libjpeg62-dev
      - libfreetype6
      - libfreetype6-dev
      - zlib1g-dev
      - mysql-client
      - python-dev
      - python-setuptools
      - python-imaging
      - python-mysqldb
      - python-psycopg2
      - git-core
      - nginx

  - name: install pip
    easy_install: 
      name: pip

  - name: install various libraries with pip
    pip: 
      name: "{{ item }}"
    with_items:
      - virtualenv
      - supervisor
      - uwsgi