saltstack-formulas / openssh-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
90 stars 297 forks source link

fix(config_ini): added quotes to regex tabs pattern #208

Open nunesvn opened 1 year ago

nunesvn commented 1 year ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

With Salt-Master 3005.1 and Salt-Minion on 3006.1, both on Debian 11, the unquoted tab was being parsed as part of the yaml structure and throwing the following error:

local:
    Data failed to compile:
----------
    Rendering SLS 'base:openssh.config_ini' failed: Illegal tab character; line 8

---
[...]
include:
  - openssh sshd_config-with-ini:
  file.replace:
    - name: /etc/ssh/sshd_config
    - pattern: ^(\w+)   +(\w)    <======================
    - repl: '\1 \2'
    - show_changes: True
    - require_in:
      - ini: sshd_config-with-ini

[...]
---

Pillar / config required to test the proposed changes

Pillar:

sshd_config:
    Banner: /etc/issue.net
    PermitRootLogin: "no"
    PasswordAuthentication: "yes"
    PermitEmptyPasswords: "no"
    HostbasedAuthentication: "no"
    MaxSessions: 10
    MaxStartups: "10:30:60"

Testing checklist

Additional context