Remove trailing new line while including vars (#57605)

While including var files using _raw_params adds additional new line
character, which makes Ansible to fail to include that file in.
This fix removes extraneous new line character while parsing the var file.

Fixes: #57593

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2019-06-10 20:53:39 +05:30 committed by Brian Coca
commit 3bee49a3bb
3 changed files with 16 additions and 5 deletions

View file

@ -50,7 +50,7 @@ class ActionModule(ActionBase):
self.source_dir = self._task.args.get('dir', None)
self.source_file = self._task.args.get('file', None)
if not self.source_dir and not self.source_file:
self.source_file = self._task.args.get('_raw_params')
self.source_file = self._task.args.get('_raw_params').rstrip('\n')
self.depth = self._task.args.get('depth', None)
self.files_matching = self._task.args.get('files_matching', None)