Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openssh/config_ini.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sshd_config-with-ini:
{%- if salt['file.contains_regex'](openssh.sshd_config, regex_search_for_tabs) %}
file.replace:
- name: {{ openssh.sshd_config }}
- pattern: {{ regex_search_for_tabs }}
- pattern: '{{ regex_search_for_tabs }}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! But this implementation does not account for single quotes in the regular expression.

Suggested change
- pattern: '{{ regex_search_for_tabs }}'
- pattern: {{ regex_search_for_tabs | yaml_dquote }}

As documented in https://docs.saltproject.io/en/latest/topics/jinja/index.html#yaml-dquote.

Does this work for you? If it does, please update this PR. I'll merge it then.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @alxwr

I got the same issue today and your suggestion is working properly

Cheers

- repl: '\1 \2'
- show_changes: True
- require_in:
Expand Down