I want to enable logging of an fstp server like this: https://serverfault.com/a/74234/90324
But salt does nothing. I reduced it to this:
enable_logging_of_sftp:
file.replace:
- name: /etc/ssh/sshd_config
- pattern: Sxxxxubsystem
- repl: Syyyubsystem
- ignore_if_missing: False
Still, salt says:
ID: enable_logging_of_sftp
Function: file.replace
Name: /etc/ssh/sshd_config
Result: True
Comment: No changes needed to be made
Started: 11:09:24.356010
Duration: 15.231 ms
Changes:
I don't understand this. Of course Sxxxxubsystem
and Syyyubsystem
are not in /etc/ssh/sshd_config
.
Since ignore_if_missing is missing is False (which is the default any way), I think I should get an error message.
Why is there no error message if pattern
and repl
are not in the file?
Above question arose since I misread the docs. Here is the follow-up question which handles my use case: Salt: Raise Error if file.replace did not find anything to replace