X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fonion%2Fmanifests%2Fbalance.pp;h=d3f5ba8f0748e8b3646315b9c50e758170a4acfc;hb=689a1da09e35835d4f266891eb30182a5d6b6018;hp=06ada88fc2b6aa549979c076062801ae73f67eea;hpb=8be357b77bd0bf55c61541f65e2728edaffa7998;p=mirror%2Fdsa-puppet.git diff --git a/modules/onion/manifests/balance.pp b/modules/onion/manifests/balance.pp index 06ada88fc..d3f5ba8f0 100644 --- a/modules/onion/manifests/balance.pp +++ b/modules/onion/manifests/balance.pp @@ -8,31 +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.yaml': - notify => Service['onionbalance'], - require => Package['onionbalance'], - } - concat::fragment { 'onion::balance::config_header': - target => "/etc/onionbalance/config.yaml", - order => 05, - content => "services:\n", - } - @@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 { '/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'], + } }