<%- | Optional[String]  $log_file,
      Optional[String]  $log_level,
      Optional[String]  $connection,
      Optional[Array]   $subscriptions,
      Optional[String]  $client_name,
      Optional[String]  $client_address,
      Optional[Integer] $keepalive_interval,
      Optional[String]  $tmp_base_dir,
      Optional[String]  $shell_path,
      Optional[Integer] $worker_count,
      Optional[String]  $checks,
      Optional[String]  $amqp_host,
      Optional[Integer]  $amqp_port,
      Optional[String]  $amqp_user,
      Optional[String]  $amqp_password,
      Optional[String]  $results_format,
      Optional[String]  $results_channel,
      Variant[Enum['sensu','amqp1']]  $transport
| -%>

[default]
<% unless $log_file =~ Undef { -%>
log_file=<%=$log_file%>
<%- } -%>
<% unless $log_level =~ Undef { -%>
log_level=<%=$log_level%>
<%- } -%>

[sensu]
<% if $transport == 'sensu' { -%>
<% unless $connection =~ Undef { -%>
connection=<%=$connection%>
<%- } -%>
<% unless $subscriptions =~ Undef { -%>
subscriptions=<%=$subscriptions.join(',')%>
<%- } -%>
<% unless $client_name =~ Undef { -%>
client_name=<%=$client_name%>
<%- } -%>
<% unless $client_address =~ Undef { -%>
client_address=<%=$client_address%>
<%- } -%>
<%- } -%>
<% unless $keepalive_interval =~ Undef { -%>
keepalive_interval=<%=$keepalive_interval%>
<%- } -%>
<% unless $tmp_base_dir =~ Undef { -%>
tmp_base_dir=<%=$tmp_base_dir%>
<%- } -%>
<% unless $shell_path =~ Undef { -%>
shell_path=<%=$shell_path%>
<%- } -%>
<% unless $worker_count =~ Undef { -%>
worker_count=<%=$worker_count%>
<%- } -%>
<% unless $checks =~ Undef { -%>
checks=<%=$checks%>
<%- } -%>

[amqp1]
<% if $transport == 'amqp1' { -%>
<% unless $client_address =~ Undef and $amqp_port =~ Undef { -%>
connection=amqp://<%=$client_address%>:<%=$amqp_port%>
<%- } -%>
<% unless $results_channel =~ Undef { -%>
results_channel=<%=$results_channel%>
<%- } -%>
<% unless $client_name =~ Undef { -%>
client_name=<%=$client_name%>
<%- } -%>
<% unless $results_format =~ Undef { -%>
results_format=<%=$results_format%>
<%- } -%>
<%- } -%>
