-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Is there an existing issue for this?
- There are no existing issues.
Bug description
I am getting unneeded trailing spaces when using zos_lineinfiles with backrefs: true to modify line.
As an example I tested the following task to add # before the line starting with B:
- name: test
zos_lineinfile:
src: /tmp/test22.txt
regexp: ^(B.+)$
state: present
line: '# \1'
backrefs: true
register: result
test22.txt is a simple test file IBM-1047 encoded.
A 11
B 22
C 33
D 44
After successful running the playbook, the file was modified as follows:
A 11
# B 22
C 33
D 44
IBM z/OS Ansible core Version
v1.15.0
IBM Z Open Automation Utilities
v1.3.6
IBM Enterprise Python
v3.13.x
ansible-version
v2.17.x
z/OS version
v2.5
Ansible module
zos_lineinfile
Playbook verbosity output.
ok: [xxx] => {
"msg": {
"backup_name": "",
"changed": true,
"cmd": "dsedhelper -d -c IBM-1047 -r /^(B.+)$/c\# \1/$ /tmp/test22.txt ",
"failed": false,
"found": 1,
"return_content": "{"cmd": "dsedhelper -d -c IBM-1047 -r /^(B.+)$/c\\# \1/$ /tmp/test22.txt ", "found": 1, "changed": true}",
"stdout": "{"cmd": "dsedhelper -d -c IBM-1047 -r /^(B.+)$/c\\# \1/$ /tmp/test22.txt ", "found": 1, "changed": true}",
"stdout_lines": [
"{"cmd": "dsedhelper -d -c IBM-1047 -r /^(B.+)$/c\\# \1/$ /tmp/test22.txt ", "found": 1, "changed": true}"
]
}
}
Ansible configuration.
Contents of the inventory
Contents of group_vars or host_vars
Metadata
Metadata
Assignees
Labels
Type
Projects
Status