Fix ssh LogLevel

* the directive can be present but commented
* the version comparison was wrong
This commit is contained in:
Jérémy Lecour 2017-07-19 13:49:08 +02:00 committed by Jérémy Lecour
parent 43e9f69314
commit adc3bd7a93

View file

@ -44,11 +44,11 @@
- name: Set log level to verbose (for Debian >= 9)
replace:
dest: /etc/ssh/sshd_config
regexp: '^LogLevel [A-Z]+'
regexp: '^#?LogLevel [A-Z]+'
replace: "LogLevel VERBOSE"
notify: reload sshd
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version | version_compare('9.0', '>=')
- ansible_distribution_major_version | version_compare('9', '>=')
- meta: flush_handlers