18 lines
454 B
YAML
18 lines
454 B
YAML
---
|
|
# Check if a file exists at the destination already, copy it if not.
|
|
- name: "Check if {{ destination | basename }} exists."
|
|
ansible.builtin.stat:
|
|
path: "{{ destination }}"
|
|
register: filestat
|
|
tags:
|
|
- always
|
|
|
|
- name: "Copy {{ source }} file to {{ destination }}."
|
|
ansible.builtin.copy:
|
|
src: "{{ source }}"
|
|
dest: "{{ destination }}"
|
|
mode: "{{ mode | default('0600') }}"
|
|
when: not filestat.stat.exists
|
|
tags:
|
|
- always
|