2017-09-15 60 views
-1

我試圖尋找「命令」和「殼」 ansible模塊,但一直沒能成功地使用它。如何使用輸入參數作爲變量Ansible劇本

我使用的腳本是未定製的,並且必須使用變量「RESPONSE_FILE =」作爲標準輸入。

我的代碼是:

- host: all 
    gather_facts: no 
    tasks: 
    - name: Run Config Tool 
    environment: 
    response_file: /opt/config/cfg.properties 
    shell: /apps/opt/configtool {{ response_file }} 
+1

如果你的腳本需要'RESPONSE_FILE'(大寫)你爲什麼要設置'response_file'(小寫)?你的腳本是尋找一個環境變量,還是一個命令行參數,或者......? – larsks

+0

我試過upper/lower_cases,沒有工作。是的,它尋找一個VAR =

回答

0
  • 主持人:所有 gather_facts:沒有 任務:
    • 名稱:運行配置工具 殼:/應用/選擇/ configtool response_file =「/選擇/配置/ cfg.properties」