【发布时间】:2018-01-23 10:44:38
【问题描述】:
当一个任务根据条件被跳过并且寄存器的结果也不同时,另一个任务失败的原因是什么。
- name: Check if the partition is already mounted
shell: df | grep "{{item.partition}}" | wc -l
with_items:
- "{{ ebs_vol }}"
register: ebs_checked
when: ebs_vol is defined
- name: Make filesystem of the partition
filesystem: fstype=ext4 dev={{item.item.partition}} force=no
when: ( ebs_vol is defined and "{{item.stdout}} == True" )
changed_when: True
with_items:
- ebs_checked.results
【问题讨论】:
标签: ansible