Fixes and cleanup to file functions and module

- unified set attribute functions ... not sure why 2 identical functions
exist with diff names, now there are 3 while i repoint all modules to 1
- fixed issue with symlinks being created w/o existing src when force=no
- refactored conditionals, simplified where possible
- added tests for symlink to nonexistant source, with both force options
- made symlink on existing attomic (force)
This commit is contained in:
Brian Coca 2014-03-13 23:07:35 -04:00
commit 2d25577e11
3 changed files with 112 additions and 115 deletions

View file

@ -164,5 +164,24 @@
that:
- "file11_result.uid == 1235"
- name: fail to create soft link to non existant file
file: src=/noneexistant dest={{output_dir}}/soft2.txt state=link force=no
register: file12_result
ignore_errors: true
- name: verify that link was not created
assert:
that:
- "file12_result.failed == true"
- name: force creation soft link to non existant
file: src=/noneexistant dest={{output_dir}}/soft2.txt state=link force=yes
register: file13_result
- name: verify that link was created
assert:
that:
- "file13_result.changed == true"
- name: remote directory foobar
file: path={{output_dir}}/foobar state=absent