Prevented the expansion of parameters in run_command() (#1794) (#1797)

(cherry picked from commit 436bbb0077)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2021-02-12 13:01:47 +01:00 committed by GitHub
parent 248128f282
commit 451428af04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 7 deletions

View file

@ -24,5 +24,7 @@
- import_tasks: precedence_between_unset_and_value.yml
# testing state=absent with check mode
- import_tasks: unset_check_mode.yml
# testing for case in issue #1776
- import_tasks: set_value_with_tilde.yml
when: git_installed is succeeded and git_version.stdout is version(git_version_supporting_includes, ">=")
...

View file

@ -0,0 +1,33 @@
---
#- import_tasks: setup_no_value.yml
- name: setting value
git_config:
name: core.hooksPath
value: '~/foo/bar'
state: present
scope: global
register: set_result
- name: setting value again
git_config:
name: core.hooksPath
value: '~/foo/bar'
state: present
scope: global
register: set_result2
- name: getting value
git_config:
name: core.hooksPath
scope: global
register: get_result
- name: assert set changed and value is correct
assert:
that:
- set_result is changed
- set_result2 is not changed
- get_result is not changed
- get_result.config_value == '~/foo/bar'
...