aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
blob: 0a38297ea40b4ee55b53b31bd20b80370eb9eda5 (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
# Class: tftp
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Usage:
#
class tftp (
  $username  = $tftp::params::username,
  $directory = $tftp::params::directory,
  $address   = $tftp::params::address,
  $port      = $tftp::params::port,
  $options   = $tftp::params::options
) inherits tftp::params {
  package { 'tftpd-hpa':
    ensure => present,
  }

  file { '/etc/default/tftpd-hpa':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template('tftp/tftpd-hpa.erb'),
    require => Package['tftpd-hpa'],
  }

  service { 'tftpd-hpa':
    ensure    => running,
    provider  => $tftp::params::provider,
    hasstatus => $tftp::params::hasstatus,
    pattern   => '/usr/sbin/in.tftpd',
    subscribe => File['/etc/default/tftpd-hpa'],
  }
}