1 define onion::balance_service (
5 $onion_hn = onion_balance_service_hostname($name)
7 exec { "create-onionbalance-key-${name}":
8 command => "/bin/true && umask 0027 && openssl genrsa -out /etc/onionbalance/private_keys/${name}.key 1024 && chgrp onionbalance /etc/onionbalance/private_keys/${name}.key",
9 onlyif => "/bin/true && ! [ -e /etc/onionbalance/private_keys/${name}.key ]",
10 require => Package['onionbalance'],
14 concat::fragment { "onion::balance::service_header::${name}":
15 target => "/etc/onionbalance/config.yaml",
16 order => "50-${name}-10",
17 content => " - # ${name} via ${onion_hn}\n key: private_keys/${name}.key\n instances:\n",
20 Concat::Fragment <<| tag == "onion::balance::${name}" |>>