serverapps:configmgmt:ansible:ansibletips
差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
serverapps:configmgmt:ansible:ansibletips [2017/04/14 05:21] – 外部編集 127.0.0.1 | serverapps:configmgmt:ansible:ansibletips [2020/01/28 01:58] – hayashi | ||
---|---|---|---|
行 1: | 行 1: | ||
====== AnsibleのTips ====== | ====== AnsibleのTips ====== | ||
+ | ===== DryRun時にスキップ ===== | ||
+ | スキップしたいTASKに以下の条件を付与する | ||
+ | |||
+ | when: not ansible_check_mode | ||
===== json形式のstdoutを利用する ===== | ===== json形式のstdoutを利用する ===== | ||
行 72: | 行 76: | ||
# task | # task | ||
- stat: path=/ | - stat: path=/ | ||
- | register: | + | register: |
- name: skip if file is found. | - name: skip if file is found. | ||
fail: msg=' | fail: msg=' | ||
- | when: is_exist.stat.md5 is not defined | + | when: checked_file.stat.md5 is not defined |
+ | |||
+ | ## OR | ||
+ | |||
+ | - name: skip if file is found. | ||
+ | fail: msg=' | ||
+ | when: not checked_file.stat.exists | ||
</ | </ | ||
serverapps/configmgmt/ansible/ansibletips.txt · 最終更新: 2020/01/28 02:33 by hayashi