推荐Ansible http库?

时间:2016-09-09 09:41:56

标签: module ansible

我正在编写一个Ansible模块,用于从网址上托管的文件中检索内容。 Ansible推荐使用什么http客户端库来执行这些类型的操作?

1 个答案:

答案 0 :(得分:2)

Ansible附带get_urluri个模块 您是否有需要自己的模块的原因?

ansible.module_utils.urls中有rsp, info = fetch_url(module, 'http://google.com') try: content = rsp.read() except AttributeError: # there was no content, but the error read() # may have been stored in the info as 'body' content = info.pop('body', '') 个功能 您可以在模块中使用它。简单的例子:

startActivity(i);
overridePendingTransition(R.anim.slide_out_top,R.anim.noanimate);

您可以查看uri's code了解详情。

相关问题