Skip to content

Commit

Permalink
Provide default configuration values
Browse files Browse the repository at this point in the history
This is useful if you generally want to keep the default setting of a
configuration option, only adding an additional value to it.
  • Loading branch information
georgeto committed Apr 9, 2022
1 parent 4ab8c08 commit 08d9276
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tasks/postfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
tags:
- apt

- name: discover default configuration values
command: postconf -d
register: _postfix_config_defaults
changed_when: False
check_mode: no

- set_fact:
postfix_config_defaults: "{{ dict( _postfix_config_defaults.stdout_lines
| map('regex_replace', '^(\\w+ =)$', '\\1 ')
| map('split', ' = ', 1)) }}"

- name: instanciate config files
template: dest=/etc/postfix/{{ item }} src=postfix/{{ item }} lstrip_blocks=yes
with_items:
Expand Down

0 comments on commit 08d9276

Please sign in to comment.