summaryrefslogtreecommitdiff
path: root/puppet/modules/obfsproxy/manifests/init.pp
blob: 4deebb62b4e9c8512a6156b0945cffe6b435ab56 (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
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
class obfsproxy (
  $transport,
  $port,
  $param,
  $dest_ip,
  $dest_port
){

  user { obfsproxy:
    ensure => present,
    system => true,
    gid    => obfsproxy,
  }

  group { obfsproxy:
    ensure => present,
    system => true,
  }

#  file { '/etc/default/obfsproxy':
#    path    => '/etc/default/obfsproxy',
#    owner   => 'root',
#    group   => 'root',
#    mode    => '0750',
#    content => template('obfsproxy/etc_default_conf.erb'),
#  }

  file { '/etc/init.d/obfsproxy':
    path      => '/etc/init.d/obfsproxy',
    ensure    => present,
    source    => 'puppet:///modules/obfsproxy/obfsproxy_daemon',
    owner     => 'root',
    group     => 'root',
    mode      => '0755',
    require   => File['/etc/obfsproxy.conf'],
    subscribe => File['/etc/obfsproxy.conf'],
    #content  => template('obfsproxy/etc_init_d.erb'),
  }

  file { '/etc/obfsproxy.conf':
    path    => '/etc/obfsproxy.conf',
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0750',
    content => template('obfsproxy/etc_conf.erb'),
  }

  package { "obfsproxy":
    ensure => present,
  }

  service { "obfsproxy":
    ensure  => running,
    status  => '/usr/sbin/service obfsproxy status
                | grep "is running"',
    require => [
      Package["obfsproxy"],
      File["/etc/init.d/obfsproxy"] ]
  }


}