Make .log.config modifications respect whitespace

A `.log.config` file may be generated with a different
level of indentation depending on which (Docker image, etc.)
generates it.

With this patch, we tolerate different levels of indentation
(2 spaces, 4 spaces, etc.) and don't break the configuration.
development
Slavi Pantaleev 7 years ago
parent 67a98e51d9
commit 3af3ef48fc

@ -61,10 +61,11 @@
args: args:
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
line: '{{ item.line }}' line: '{{ item.line }}'
backrefs: '{{ item.backrefs }}'
with_items: with_items:
- {"regexp": "^ filename:", "line": ' filename: /matrix-run/homeserver.log'} - {"regexp": '^(\s+)filename:', "line": '\1filename: /matrix-run/homeserver.log', backrefs: yes}
- {"regexp": "^ maxBytes:", "line": ' maxBytes: {{ matrix_max_log_file_size_mb * 1024 * 1024 }}'} - {"regexp": '^(\s+)maxBytes:', "line": '\1maxBytes: {{ matrix_max_log_file_size_mb * 1024 * 1024 }}', backrefs: yes}
- {"regexp": "^ backupCount:", "line": ' backupCount: {{ matrix_max_log_files_count }}'} - {"regexp": '^(\s+)backupCount:', "line": '\1backupCount: {{ matrix_max_log_files_count }}', backrefs: yes}
- name: Augment Matrix config - name: Augment Matrix config
lineinfile: "dest={{ matrix_synapse_config_dir_path }}/homeserver.yaml" lineinfile: "dest={{ matrix_synapse_config_dir_path }}/homeserver.yaml"

Loading…
Cancel
Save