1
我想通過多行格式化下面的命令任務。如何通過多行格式化一個長的Ansible命令模塊任務?
tasks:
...
- name: Run the python file
command: "{{ lookup('env','HOME') }}/bin/pythonfile.py \"{{ cmd_status.stdout }}\" {{ test_number }}"
無格式化。 pythonfile
正確執行。我試着用>
格式:
tasks:
...
- name: Run the python file
command: >
"{{ lookup('env','HOME') }}/bin/pythonfile.py \"{{ cmd_status.stdout }}\" {{ test_number }}"
,它給:
「味精」: 「[錯誤2]沒有這樣的文件或目錄」,
Debug:
"invocation": {
"module_args": {
"_raw_params": "\"/home/bin/pythonfile.py
任何建議在多行上格式化命令行。
該問題在'-vvv'結果中仍然可見,但該值被剝離。爲了清楚起見,你應該包含整個'_raw_params'。 – techraf