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
parent cab0f21564
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

@ -51,6 +51,18 @@ Noteworthy module changes
* The ``win_iis_webapppool`` module no longer accepts a string for the ``atributes`` module option; use the free form dictionary value instead
* The ``name`` module option for ``win_package`` has been removed; this is not used anywhere and should just be removed from your playbooks
* The ``win_regedit`` module no longer automatically corrects the hive path ``HCCC`` to ``HKCC``; use ``HKCC`` because this is the correct hive path
* The :ref:`file_module` now emits a deprecation warning when ``src`` is specified with a state
other than ``hard`` or ``link`` as it is only supposed to be useful with those. This could have
an effect on people who were depending on a buggy interaction between src and other state's to
place files into a subdirectory. For instance::
$ ansible localhost -m file -a 'path=/var/lib src=/tmp/ state=directory'
Would create a directory named ``/tmp/lib``. Instead of the above, simply spell out the entire
destination path like this::
$ ansible localhost -m file -a 'path=/tmp/lib state=directory'
Plugins
=======