Add no_args parameter on defined own services to allow create also

internal services without 'user= argv='.
This commit is contained in:
Dimitrij Hilt 2019-01-08 09:26:27 +01:00
parent 097d149322
commit dada652f3e
3 changed files with 24 additions and 0 deletions

View File

@ -43,6 +43,23 @@ provisioner:
postfix.sls:
postfix:
manage_master_config: True
master_config:
services:
relay1:
wrap: True
command: smtp
chroot: false
type: unix
extras: '-o smtp_bind_address=127.0.0.1 -o syslog_name=relay1'
no_args: True
relay2:
wrap: True
command: smtp
chroot: false
type: unix
extras: '-o smtp_bind_address=127.0.0.2 -o syslog_name=relay2'
no_args: True
verifier:
name: inspec

View File

@ -45,6 +45,9 @@ postfix:
user: mail
# Wrap the output in master.cf at 78 chars for better readability
wrap: True
# Avoid user and arvg settings to allow define internal processes
# needed for randomizing relay IP (randmap functionality)
no_args: True
# Backwards compatible definition of dovecot delivery in master.cf
enable_dovecot: False

View File

@ -130,6 +130,9 @@ y
service_param(service, service_name, 'wakeup'),
service_param(service, service_name, 'maxproc'),
service_param(service, service_name, 'command', service_name)) }}
{%- if 'no_args' in service -%}
{%- set parameter_str = "%s %s" | format(comment,service_param(service, service_name, 'extras', '')) -%}
{%- else -%}
{%- if 'flags' in service or 'flags' in postfix_master_services.defaults[service_name] -%}
{%- set parameter_str = "%s flags=%s user=%s argv=%s %s" | format(comment,
service_param(service, service_name, 'flags'),
@ -142,6 +145,7 @@ y
service_param(service, service_name, 'argv'),
service_param(service, service_name, 'extras', '')) -%}
{%- endif -%}
{%- endif -%}{# if 'no_args' in service #}
{%- if wrap %}
{{ parameter_str | wordwrap(width=wrap, break_long_words=False, wrapstring='\n%s ' | format(comment)) }}
{%- else %}