summaryrefslogtreecommitdiff
path: root/manifests/ecdhforce.pp
blob: bdbd4c928caf9dd3c4d4575b36e3bdccf8aafb3e (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
class mumble::ecdhforce {
  vcsrepo { "/var/lib/mumble-server/ecdhforce":
    ensure   => present,
    provider => git,
    source   => 'https://github.com/ultramancool/ecdhforce.git',
    revision => '7b0d6564c21a1bc619307258b773da547842ebca',
    owner    => root,
    group    => mumble-server,
    require  => Package[ 'mumble-server' ],
  }

  package { [ 'gcc', 'libssl-dev' ]:
    ensure => present,
  }

  exec { 'ecdhforce-compile':
    cwd     => '/var/lib/mumble-server/ecdhforce',
    command => 'gcc -Wall -fPIC -DPIC -c ecdhforce.c',
    require => [ Vcsrepo['/var/lib/mumble-server/ecdhforce'], Package['gcc'], Package['libssl-dev'] ],
    creates => '/var/lib/mumble-server/ecdhforce/ecdhforce.o',
    user    => root,
    group   => root,
  }

  exec { 'ecdhforce-link':
    cwd     => '/var/lib/mumble-server/ecdhforce',
    command => 'ld -shared -o ecdhforce.so ecdhforce.o -ldl',
    require => Exec['ecdhforce-compile'],
    creates => '/var/lib/mumble-server/ecdhforce/ecdhforce.so',
    user    => root,
    group   => root,
  }

  file { '/etc/init.d/mumble-server':
    ensure  => present,
    owner   => root,
    group   => root,
    mode    => 0755,
    source  => "puppet:///modules/mumble/init.d/mumble-server.${::operatingsystem}",
    require => Exec['ecdhforce-link'],
    notify  => Service['mumble-server'],
  }
}