alaxli / ansible_ui

ansible web ui, more simple and better layout
331 stars 182 forks source link

亲 能否在requirements.txt中把你需求的版本指定一下 #15

Open kikiyou opened 8 years ago

kikiyou commented 8 years ago

由于没有指定详细的版本,安装的时候 各种报错 django-guardian 现在只支持 django 1.7+ 当我把django升级到1.7+的时候 South不能工作 说South只支持1.6 亲 请把详细版本需求说下,感谢

chenchen1750 commented 8 years ago

以下是我之前安装时整理的步骤,希望对你有帮助。

安装 ansible 开源 UI

基础信息

  1. 项目地址
  2. 操作文档
yum install -y mysql-server mysql-devel
yum install -y openldap-devel
yum install -y python-devel
yum install -y git
yum install -y libffi-devel

yum install -y gcc gcc-c++
yum install -y openssl-devel

yum install -y libjpeg-devel
yum install -y zlib-devel

安装 easy_install、pip、virtualenv

yum install -y python-setuptools
easy_install pip
pip install virtualenv

添加用户

useradd ansible
passwd ansible
su - ansible

配置virtualenv环境

virtualenv envansible
source envansible/bin/activate

安装 ansible_ui

下载源码

git clone https://github.com/alaxli/ansible_ui.git

安装依赖库

cd ansible_ui
pip install -r requirements.txt
pip install PIL --allow-external PIL --allow-unverified PIL --allow-external 出错后改用了 pip install Pillow
pip install django-guardian==1.3.0 如果初始化数据库失败,则使用pip install django-guardian==1.2.0
pip install ansible==1.9.6

配置

配置ldap、数据库和邮件信息

cd desktop/core/internal
vim settings_local.py
# 修改 LDAP Datebase Mail 和ansible_playbook命令位置(which ansible_playbook)配置
如果需要使用ldap,还需要修改settings.py,去掉下面行的注释
#'desktop.core.auth.backend.LdapBackend',

配置数据库

create database ansible CHARACTER SET utf8;
grant all on ansible.* to ansibleuser@'localhost' identified by '******';

初始化数据库

python manage.py schemamigration desktop.apps.account --init
python manage.py schemamigration desktop.apps.ansible --init
python manage.py syncdb
python manage.py migrate ansible
python manage.py migrate account
python manage.py migrate kombu.transport.django
python manage.py migrate djcelery
python manage.py migrate guardian

配置celery

修改celery-conf/supervisord.conf
[inet_http_server] #配置web管理supervisor
[program:ansible_celeryd] #修改command中 virtualenv 和 ansible_ui home

配置ansible

cp ansible-conf/ansible.cfg ~/.ansible.cfg

如果要使用密码验证,需要安装 sshpass

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:Strahlex/CentOS_CentOS-6/home:Strahlex.repo
yum install sshpass

启动

启动 celery

supervisord -c celery-conf/supervisord.conf

启动 ansible

python manage.py runserver 0.0.0.0:8000 (此方式用于测试是启动,需要稳定运行可以参照官网的启动方式)

[[分类:运维自动化]]

在 2016-05-25 16:10:07,"kikiyou" notifications@github.com 写道:

由于没有指定详细的版本,安装的时候 各种报错 django-guardian 现在只支持 django 1.7+ 当我把django升级到1.7+的时候 South不能工作 说South只支持1.6 亲 请把详细版本需求说下,感谢

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

Haitianisgood commented 8 years ago

执行pip install -r requirements.txt

  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c simplejson/_speedups.c -o build/temp.linux-x86_64-2.7/simplejson/_speedups.o
    simplejson/_speedups.c:2:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    ***************************************************************************
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Failure information, if any, is above.
    I'm retrying the build without the C extension now.
    ***************************************************************************

    ***************************************************************************
    WARNING: The C extension could not be compiled, speedups are not enabled.
    Plain-Python installation succeeded.
    ***************************************************************************
Compiling /home/ansible/envansible/build/pexpect/pexpect/async.py ...
  File "/home/ansible/envansible/build/pexpect/pexpect/async.py", line 16
    transport, pw = yield from asyncio.get_event_loop()\
                             ^
SyntaxError: invalid syntax

  Running setup.py install for django-guardian
    your setuptools is too old (<12)
    setuptools_scm functionality is degraded

building '_mysql' extension

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG

_mysql.c:29:20: fatal error: Python.h: No such file or directory

 #include "Python.h"

                    ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /home/ansible/envansible/bin/python -c "import setuptools, tokenize;__file__='/home/ansible/envansible/build/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NPl8Uu-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ansible/envansible/include/site/python2.7 failed with error code 1 in /home/ansibl
long1112 commented 8 years ago

requirement文件中已经有了django-guardian,ansible, 为何你还要自己再安装一遍? django==1.6 django-celery django-jsonfield django-auth-ldap python-magic South simplejson

pil

pexpect django-guardian celery MySQL-python python-ldap ansible supervisor threadpool uwsgi

vyu923 commented 7 years ago

大家安装后都能正常使用吗?现在部署密钥的时候不成功,一直报输入的参数是3个,只获得了2个。

xuhuigithub commented 7 years ago

大家安装后都能正常使用吗?现在部署密钥的时候不成功,一直报输入的参数是3个,只获得了2个。