Append Managed by SaltStack comment to port setting

* Regex modified:
  - Ensure whitespace before comment is maintained
  - Consistent with surrounding lines in the file
* Used YAML pipe `>-` due to the colon-space (`: `) in the comment
This commit is contained in:
Imran Iqbal 2018-06-10 23:07:44 +01:00
parent 06e5944133
commit 0d9a5ba239

View file

@ -198,8 +198,9 @@ postgresql-running:
postgresql-port:
file.replace:
- name: {{ postgres.conf_dir }}/postgresql.conf
- pattern: ^#*\s*(port)\s*=\s*\d{4,5}(.*)$
- repl: \1 = {{ postgres.port }}\2
- pattern: ^#*\s*(port)\s*=\s*\d{4,5}(\s*).*$
- repl: >-
\1 = {{ postgres.port }}\2# Managed by SaltStack: please do not edit
- flags: 8 # ['MULTILINE']
- show_changes: True
- append_if_not_found: True