有以下兩種方式向目標機器上運行腳本:哪一個更好?直接從控制機執行腳本或複製並在本地執行?
1. - name: run the script from the control machine directly.
script: "{{path_to_scripts}}/script.sh"
2. - name: Copying the script from target machine.
copy: src="{{path_to_scripts}}/script.sh" dest="{{path_to_scripts}}/script.sh" mode=0777
- name: Execute script locally.
command: /bin/sh {{path_to_scripts}}/script.sh
,因爲我對運行超過30臺目標機器的劇本。我想知道哪一個會是更好的選擇?
如果我比其他人更喜歡一個,那麼性能會受到什麼影響?
注意「運行性能」問題最好通過運行代碼來解決。 – tedder42