File: tftp0.mcl

package info (click to toggle)
mgmt 0.0.26.git.2024.10.25.85e1d6c0e8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,364 kB
  • sloc: sh: 2,471; yacc: 1,285; makefile: 543; python: 196; lisp: 77
file content (44 lines) | stat: -rw-r--r-- 1,154 bytes parent folder | download
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
$root = "/tmp/tftproot/"
file $root {
	state => $const.res.file.state.exists,
}
file "${root}file0" {
	content => "i'm file0 in ${root}\n",
	state => $const.res.file.state.exists,
}

tftp:server ":1069" {	# by default tftp uses :69 but using :1069 avoids needing root!
	#address => ":1069",	# you can override the name like this
	timeout => 60,		# increase the timeout
	root => $root,		# add a tftproot (optional)
}

# you can add a raw file like this...
tftp:file "/file1" {
	data => "hello, world, i'm file1 and i don't exist on disk!\n",
}

# or if there's a file on disk you care about...
$f2 = "/tmp/some_file"
file $f2 {
	content => "i'm a cool file in /tmp\n",
	state => $const.res.file.state.exists,
}

# you can point to it directly...
tftp:file "/file2" {
	path => $f2,

	Depend => File[$f2],	# TODO: add autoedges
}

# here's a file in the middle of nowhere that still works...
tftp:file "/i/am/some/deeply/nested/file" {
	data => "how did you find me!\n",
}

# and this file won't autogroup with the main tftp server
tftp:file "/nope/noway" {
	data => "i won't be seen!\n",
	server => "someone else!",	# normally we don't use this this way
}