More file refactoring (#40114)

* Set src in the state functions rather than the toplevel

A good API should only require passing one version of a piece of data
around so do that for src

* Move the rewriting of path into additional_parameter_handling

When the path is a directory we can rewrite the path to be a file inside
of the directory

* Emit a warning when src is used with a state where it should be ignored
This commit is contained in:
Toshio Kuratomi 2018-05-16 10:41:11 -07:00 committed by GitHub
commit 6227c2ac75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 20 deletions

View file

@ -134,7 +134,9 @@
- "file6_result.changed == true"
- name: touch a hard link
file: src={{output_file}} dest={{output_dir}}/hard.txt state=touch
file:
dest: '{{ output_dir }}/hard.txt'
state: 'touch'
register: file6_touch_result
- name: verify that the hard link was touched