summaryrefslogtreecommitdiff
path: root/puppet/modules/site_obfsproxy/manifests/init.pp
blob: 6275ebeeab921b7481f5db8be8a0ab00320b8ce2 (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 site_obfsproxy {
  tag 'leap_service'
  Class['site_config::default'] -> Class['site_obfsproxy']

  $transport = 'scramblesuit'

  $obfsproxy    = hiera('obfsproxy')
  $scramblesuit = $obfsproxy['scramblesuit']
  $scram_pass   = $scramblesuit['password']
  $scram_port   = $scramblesuit['port']
  $dest_ip      = $obfsproxy['gateway_address']
  $dest_port    = '443'

  if member($::services, 'openvpn') {
    $openvpn      = hiera('openvpn')
    $bind_address = $openvpn['gateway_address']
  }
  elsif member($::services, 'obfsproxy') {
    $bind_address = hiera('ip_address')
  }

  include site_apt::preferences::twisted
  include site_apt::preferences::obfsproxy

  class { 'obfsproxy':
    transport    => $transport,
    bind_address => $bind_address,
    port         => $scram_port,
    param        => $scram_pass,
    dest_ip      => $dest_ip,
    dest_port    => $dest_port,
  }

  include site_shorewall::obfsproxy

}