main.yml 420 Bytes
Newer Older
1
---
2
- name: stat
3
  stat: path={{ dest }}
4
  register: stat_r
5

Chris Hines's avatar
updates    
Chris Hines committed
6
7
8
9

- name: debug1
  debug: var=stat_r

10
- name: mv
11
12
  command: mv "{{ dest }}" "{{ dest }}_old"
  when: stat_r.stat.exists and stat_r.stat.isdir
13
14
  sudo: true

15
16
17
18
- name: stat 
  stat: path={{ dest }}
  register: stat_r

Chris Hines's avatar
updates    
Chris Hines committed
19
20
- name: debug2
  debug: var=stat_r
21

22
23
- name: link
  file: src="{{ src }}" dest="{{ dest }}" state=link
24
  when: not stat_r.stat.exists
25
  sudo: true