0
我編寫需要設置一些事實的Ansible模塊my_module。Ansible模塊如何返回事實
我在模塊定義了下面的代碼
....
response = {
"hello": "world",
"ansible_facts" : {
"my_data": "xjfdks"
}
}
module.exit_json(changed=False, meta=response)
現在執行my_module後的劇本我想獲得新的事實,但它沒有定義
- my_module
- debug: msg="My new fact {{ my_data }}"
是什麼做的正確方法?
不熟悉'ansible'但考慮到'response'對象結構不應該是「{{ansible_facts.my_data}}」精神中的東西嗎? – GillesC
不,我得到這個錯誤致命:[localhost]:失敗! => {「failed」:true,「msg」:「'ansible_facts'未定義」} – Shurik