aboutsummaryrefslogtreecommitdiff
path: root/manifests/role/yacy.pp
blob: d047c83b54e8f873659510d319a35bec0860416d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class nodo::role::yacy inherits nodo::base::virtual {
  class { 'onion': }

  package { 'yacy':
    ensure => installed,
  }

  $yacy_status = hiera('nodo::role::yacy::status', 'running')

  service { 'yacy':
    ensure  => $yacy_status,
    require => Package['yacy'],
  }

  # Gracefully restart yacy everyday
  cron { "yacy-restart":
    command  => "/etc/init.d/yacy restart > /dev/null 2>&1",
    user     => root,
    hour     => "*/4",
    minute   => "0",
    ensure   => $yacy_status ? {
      'running' => present,
       default  => absent,
    },
    require  => Service['yacy'],
  }

  tor::daemon::hidden_service { 'yacy':
    ports    => [ '8090 127.0.0.1:8090', '80 127.0.0.1:8090' ],
    data_dir => "$tor::daemon::data_dir/hidden",
    ensure   => present,
  }

  # Why they don't sign their releases?
  apt::sources_list { "yacy.net.list":
    content => "deb http://debian.yacy.net ./\n",
    ensure  => absent,
  }
}