Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能简单讲讲ansible-api原理吗? #10

Closed
ppabc opened this issue Jun 26, 2017 · 4 comments
Closed

能简单讲讲ansible-api原理吗? #10

ppabc opened this issue Jun 26, 2017 · 4 comments

Comments

@ppabc
Copy link

ppabc commented Jun 26, 2017

能简单讲讲ansible-api原理吗?

@ppabc
Copy link
Author

ppabc commented Jun 28, 2017

Ansible API主要是通Ansible的plugins插件方式,把请求传递给Ansible去执行,对吧?
Ansible API主要是通Ansible的plugins插件方式,把请求传递给Ansible去执行,对吧?

@lfbear
Copy link
Owner

lfbear commented Jun 29, 2017

不完全是这样,ansible-api实现了ansible和ansbile-playbook的基本功能(重新用多线程模式把ansible的cli写了一次),然后通过借助他的task和callback机制来获取结构化返回数据。最后把这些操作封装成了http api

@leoomo
Copy link

leoomo commented Aug 29, 2017

我通过官方的api,用两个线程同时跑两个playbook,第一次能正常运行(playbook按照设置的步骤失败),再次跑的时候就出现了 ' NoneType' object has no attribute 'name'的问题。总之要隔一段时间才能正常多线程跑,请问您遇到过这种问题吗?

@lfbear
Copy link
Owner

lfbear commented Oct 9, 2017

@leoomo 是起了2个进程么 如果起了一个进程是没有问题的 ansible-api会使用线程池自己来控制多线程运行的 几百台server累计运行1年多 没有发现这个错误。从报错内容看,猜测是playbook的name属性没有了,如果传参没有问题,那很有可能就是你开了多个进程(不是线程)导致的

@lfbear lfbear closed this as completed Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants