mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-24 17:20:22 -07:00
Fix when template paths contain non-ascii chars and using the path in ansible_managed
Fixes #27262
This commit is contained in:
parent
cca96b8c9d
commit
81b2529159
5 changed files with 26 additions and 5 deletions
2
test/integration/targets/template/ansible_managed.cfg
Normal file
2
test/integration/targets/template/ansible_managed.cfg
Normal file
|
@ -0,0 +1,2 @@
|
|||
[defaults]
|
||||
ansible_managed=ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
|
12
test/integration/targets/template/ansible_managed.yml
Normal file
12
test/integration/targets/template/ansible_managed.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
- hosts: testhost
|
||||
gather_facts: False
|
||||
tasks:
|
||||
- file:
|
||||
path: '{{ output_dir }}/café.txt'
|
||||
state: 'absent'
|
||||
# Smoketest that ansible_managed with non-ascii chars works:
|
||||
# https://github.com/ansible/ansible/issues/27262
|
||||
- template:
|
||||
src: 'templates/café.j2'
|
||||
dest: '{{ output_dir }}/café.txt'
|
|
@ -6,3 +6,6 @@ ANSIBLE_ROLES_PATH=../ ansible-playbook template.yml -i ../../inventory -e @../.
|
|||
|
||||
# Test for #35571
|
||||
ansible testhost -i testhost, -m debug -a 'msg={{ hostvars["localhost"] }}' -e "vars1={{ undef }}" -e "vars2={{ vars1 }}"
|
||||
|
||||
# Test for https://github.com/ansible/ansible/issues/27262
|
||||
ansible-playbook ansible_managed.yml -c ansible_managed.cfg -i ../../inventory -e @../../integration_config.yml -v "$@"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue