2015-09-25 46 views
0

對於我的操作手冊,我需要運行一個初始化腳本,要求提供幾個提示(數據庫位置,管理員密碼,是或否的幾個)。我找不到這方面的例子。在ansible文檔中提供的例子,給我留下了一些問題(我?)例如:Ansible初始化腳本期望

- expect: 
    command: passwd username 
    responses: 
     (?i)password: "MySekretPa$$word" 

如何運行我的啓動腳本,並插入所需的變量爲多反應?

回答

0

您可以使用:

- expect: 
    command: 
    responses: 
     Question: 
     - response1 
     - response2 
     - response3