You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
606 B
YAML
31 lines
606 B
YAML
2 weeks ago
|
- hosts: taller
|
||
|
connection: local
|
||
|
vars:
|
||
|
example_file: /tmp/example.txt
|
||
|
tasks:
|
||
|
- name: ensure example file dont exist
|
||
|
file:
|
||
|
path: "{{ example_file }}"
|
||
|
state: absent
|
||
|
|
||
|
- name: create file after 30 seconds
|
||
|
shell: >
|
||
|
sleep 30 && touch {{ example_file }}
|
||
|
async: 60
|
||
|
poll: 0
|
||
|
|
||
|
- name: check result
|
||
|
stat:
|
||
|
path: "{{ example_file }}"
|
||
|
register: example_status
|
||
|
until: example_status.stat.exists
|
||
|
retries: 10
|
||
|
delay: 5
|
||
|
|
||
|
- debug: var=example_status
|
||
|
|
||
|
- name: update locate DB and forget
|
||
|
command: /usr/bin/updatedb
|
||
|
async: 3600
|
||
|
poll: 0
|