Add a check that tilde expansion with copy works

This commit is contained in:
Toshio Kuratomi 2014-12-04 11:35:03 -08:00
parent 1eb3124999
commit 57c77691ec
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1 @@
testing tilde expansion with sudo

View file

@ -19,6 +19,7 @@
- assert:
that:
- "results.stat.exists == True"
- "results.stat.path|dirname|basename == '{{ sudo_test_user }}'"
- name: tilde expansion honors sudo in template
sudo: True
@ -35,6 +36,24 @@
- assert:
that:
- "results.stat.exists == True"
- "results.stat.path|dirname|basename == '{{ sudo_test_user }}'"
- name: tilde expansion honors sudo in copy
sudo: True
sudo_user: "{{ sudo_test_user }}"
copy:
src: baz.txt
dest: "~/baz.txt"
- name: check that the path in the user's home dir was created
stat:
path: "~{{ sudo_test_user }}/baz.txt"
register: results
- assert:
that:
- "results.stat.exists == True"
- "results.stat.path|dirname|basename == '{{ sudo_test_user }}'"
- name: Remove test user and their home dir
user: