英文:
In django, how can I pass the output of ansible_runner to the page through websocket?
问题
我想实时在页面上显示类似以下的输出,或在捕获后保存到数据库。我认为ansible_runner应该有这样的接口,但我找不到它。
2023年5月30日星期二 08:45:30 +0800 (0:00:00.059) 0:00:00.059 ***********
12.212.212.22 | 成功 => {
"ansible_facts": {
"ansible_memfree_mb": 258388,
"ansible_memtotal_mb": 515659,
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false
}
2023年5月30日星期二 08:45:33 +0800 (0:00:02.731) 0:00:02.790 ***********
===============================================================================
setup ------------------------------------------------------------------- 2.73秒
英文:
I want to display the output similar to the following on the page in real time, or save it to the database after being captured. I think ansible_runner should have such an interface, but I can't find it
Tuesday 30 May 2023 08:45:30 +0800 (0:00:00.059) 0:00:00.059 ***********
12.212.212.22 | SUCCESS => {
"ansible_facts": {
"ansible_memfree_mb": 258388,
"ansible_memtotal_mb": 515659,
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false
}
Tuesday 30 May 2023 08:45:33 +0800 (0:00:02.731) 0:00:02.790 ***********
===============================================================================
setup ------------------------------------------------------------------- 2.73s
答案1
得分: 2
A: ansible-runner 在被捕获后会创建持久化的文档。可以将这些文档视为您可能想要解析的数据库。请参阅示例。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论