- name: Disrectory exists
hosts: all
tasks:
- name: Task name
stat:
path: [path to the file or directory you want to check]
register: register_dir
- name: Task name
debug:
msg: "The file or directory exists on {{ ansible_hostname }}"
when: register_dir.stat.exists
1条答案
按热度按时间vfh0ocws1#
简单的行动手册