2017-11-28 5 views
0

私は、ある辞書に少なくとも1つの 'false'値が含まれている場合にのみ、Ansibleタスクを実行する必要があるとします。可能性:辞書に少なくとも1つの指定された値があるかどうかを確認する方法?

例:

vars: 
    dict_fonts_installed: { font1: true, font2: true, font3: false } 

tasks: 
    - name: 'Run fc-cache only if at least one of the fonts isn't installed' 
    command: "fc-cache -f {{ fonts_dir }}" 
    when: <YOUR ANSWER> 

答えて

0

あなたが探している条件は次のとおりです。

when: false in dict_fonts_installed.values() 
関連する問題