Skip to content

Instantly share code, notes, and snippets.

@krdlab
Created August 13, 2020 05:10
Show Gist options
  • Save krdlab/2c8dde9b43068a07c318efaa25a40b32 to your computer and use it in GitHub Desktop.
Save krdlab/2c8dde9b43068a07c318efaa25a40b32 to your computer and use it in GitHub Desktop.
Ansible を使ってリモートホスト上に指定のファイルが生成されるまで待つ
- hosts: targets
become: yes
tasks:
- name: Get UTC date
command: date -u '+%Y-%m-%d'
check_mode: no
changed_when: no
register: utc_date
- debug:
var: utc_date
- name: Wait for target started
wait_for:
path: "/var/log/target/foo.bar.{{ utc_date.stdout }}.log"
state: present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment