From 0d9a5ba239c781d300b384356afade429f48e892 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 10 Jun 2018 23:07:44 +0100 Subject: [PATCH] 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 --- postgres/server/init.sls | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/postgres/server/init.sls b/postgres/server/init.sls index d41775b..35f385f 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -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