Puppet Class: puppet_deluge::freebsd

Defined in:
manifests/freebsd.pp

Overview

Class: puppet_deluge::freebsd Lightweight deluge module to install a headless deluge server This module contains FreeBSD specific functions Module written by Rainbow <rainbow@hacker.horse> Released under the 2-clause BSD license. Depends on snonux/zfs



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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'manifests/freebsd.pp', line 8

class puppet_deluge::freebsd {
    package { 'deluge-cli':
    ensure  => latest,
    require => User['deluge'],
  }
  package { 'deluge-web':
    ensure  => absent,
    require => User['deluge'],
  }
  package { 'py27-service_identity':
    ensure => latest,
  }
  file { '/usr/local/etc/rc.d/deluged':
    owner   => 'root',
    group   => 'wheel',
    mode    => '0755',
    source  => 'puppet:///modules/freebsd_deluge_light/deluged_init.sh',
    require => User['deluge'],
  }
  exec { 'delfirstrun':
    command => '/usr/local/bin/deluged',
    path    => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
    user    => 'deluge',
    require => User['deluge'],
    before  => File['/home/deluge/.config/deluge/auth'],
    unless  => 'test -f /home/deluge/.config/',
  }
  service { 'deluge':
      ensure  => running,
      enable  => true,
      require => File['/usr/local/etc/rc.d/deluged'],
  }
  zfs::create { 'zroot/torrents':
    ensure     => present,
    filesystem => '/torrents',
  }
  zfs::create { 'zroot/torrents/downloading':
    ensure     => present,
    filesystem => '/torrents/downloading',
    require    => Zfs::Create['zroot/torrents'],
  }
  zfs::create { 'zroot/torrents/files':
    ensure     => present,
    filesystem => '/torrents/files',
    require    => Zfs::Create['zroot/torrents'],
  }
  zfs::create { 'zroot/torrents/completed':
    ensure     => present,
    filesystem => '/torrents/completed',
    require    => Zfs::Create['zroot/torrents'],
  }
  exec { 'zfsperms':
    command => 'chown -R deluge:deluge /torrents',
    path    => '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
    require => [Zfs::Create['zroot/torrents'], Zfs::Create['zroot/torrents/downloading'], Zfs::Create['zroot/torrents/files'], Zfs::Create['zroot/torrents/completed']],
  }
}