X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fonion%2Fmanifests%2Fbalance.pp;h=d3f5ba8f0748e8b3646315b9c50e758170a4acfc;hb=HEAD;hp=1c0f9d3f3b8c66e49d0420e1c13602ea157ab051;hpb=8d9666e63a8876fa5e85964fe5c1de8d849a9fe3;p=mirror%2Fdsa-puppet.git diff --git a/modules/onion/manifests/balance.pp b/modules/onion/manifests/balance.pp index 1c0f9d3f3..d3f5ba8f0 100644 --- a/modules/onion/manifests/balance.pp +++ b/modules/onion/manifests/balance.pp @@ -8,25 +8,46 @@ class onion::balance { ensure => running, require => Package['onionbalance'], } + dsa_systemd::override { 'onionbalance': + ensure => $ensure, + content => @(EOT) + [Unit] + BindsTo=tor.service + | EOT + } file { '/usr/local/bin/tor-onion-name': mode => '0555', source => 'puppet:///modules/onion/tor-onion-name', } + file { '/usr/local/bin/create-onionbalance-config': + mode => '0555', + source => 'puppet:///modules/onion/create-onionbalance-config', + notify => Exec['create-onionbalance-config'], + } concat::fragment { 'onion::torrc_control_header': target => "/etc/tor/torrc", - order => 10, + order => '10', content => "ControlPort 9051\n\n", } - concat { '/etc/onionbalance/config': - notify => Service['onionbalance'], - require => Package['onionbalance'], + @@concat::fragment { "onion::balance::onionbalance-services.yaml": + target => "/srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml", + content => "${onion_balance_service_hostname}\n", + tag => "onionbalance-services.yaml", } - concat::fragment { 'onion::balance::config_header': - target => "/etc/onionbalance/config", - order => 05, - content => "service:\n", + + concat { '/etc/onionbalance/config-dsa-snippet.yaml': + notify => Exec['create-onionbalance-config'], + require => File['/usr/local/bin/create-onionbalance-config'] + } + Concat::Fragment <<| tag == "onion::balance::dsa-snippet" |>> + + exec { "create-onionbalance-config": + command => "/usr/local/bin/create-onionbalance-config", + refreshonly => true, + require => [ File['/usr/local/bin/create-onionbalance-config'], Package['onionbalance'] ], + notify => Service['onionbalance'], } }