2017-12-04 4 views
-1

私は辞書変数ファイルとincludes_tasksを使用するプレイブックを持っています。私の問題は、実行時にプレイブックに変数が表示されることです。私はno_logを試しました:Trueとignore_errors:Trueですが違いはありません。私はここでansibleバージョン2.4.1.0playbookの出力からAnabilities-hide with_dict変数を呼び出す

を使用してい脚本作業です:

TASK [Install License and Remove Default Identifier] 

*************************************************************************** 
msg: All items completed 

results: [ 
    { 
    "item": { 
     "key": "vsrx-02", 
     "value": { 
     "Hostname": "vsrx-02", 
     "IP_Address": "192.168.1.211" 
     } 
    }, 
    "_ansible_item_result": true, 
    "include": "includes/junos_license.yml", 
    "include_variables": {} 
    }, 
    { 
    "item": { 
     "key": "vsrx-01", 
     "value": { 
     "Hostname": "vsrx-01", 
     "IP_Address": "192.168.1.209" 
     } 
    }, 
    "_ansible_item_result": true, 
    "include": "includes/junos_license.yml", 
    "include_variables": {} 
    } 
] 
included: /home/ansible/junos_base_config/includes/junos_license.yml for 
localhost 
included: /home/ansible/junos_base_config/includes/junos_license.yml for 
localhost 

答えて

1

使用loop_control

tasks: 
    - name: "Install License and Remove Default Identifier" 
    include_tasks: includes/junos_license.yml 
    with_dict: "{{ vsrx }}" 

ここで脚本を実行しているから出力され

tasks: 
    - name: "Install License and Remove Default Identifier" 
    include_tasks: includes/junos_license.yml 
    with_dict: "{{ vsrx }}" 
    loop_control: 
     label: "{{ item.key }}" 
+0

Un幸いにも、それはうまくいかなかった。ループ内でインクルード・タスクを使用している可能性があります。 – user3577012

関連する問題