| 1 |
.\" Generated by Mmark Markdown Processor - mmark.miek.nl |
| 2 |
.TH "IMPORT" 7 "August 2026" "atomdns handlers" "atomdns authors" |
| 3 |
|
| 4 |
.SH "NAME" |
| 5 |
.PP |
| 6 |
\fIimport\fP \- includes files or references snippets from a Conffile |
| 7 |
|
| 8 |
.SH "DESCRIPTION" |
| 9 |
.PP |
| 10 |
The \fIimport\fP handler can be used to include files into the main configuration. Another use is to |
| 11 |
reference predefined snippets. Both can help to avoid some duplication. |
| 12 |
|
| 13 |
.PP |
| 14 |
This is a unique handler in that \fIimport\fP can appear outside of a handler block. In other words, it |
| 15 |
can appear at the top of a Conffile where an address would normally be. |
| 16 |
|
| 17 |
.PP |
| 18 |
You can have a maximum of 1000 imports in the configuration, this is to prevent cycles. |
| 19 |
|
| 20 |
.SH "SYNTAX" |
| 21 |
.PP |
| 22 |
.RS |
| 23 |
|
| 24 |
.nf |
| 25 |
import PATTERN |
| 26 |
|
| 27 |
.fi |
| 28 |
.RE |
| 29 |
|
| 30 |
.IP \(bu 4 |
| 31 |
\fBPATTERN\fP is the file, glob pattern (\fB\fC*\fR) or snippet to include. Its contents will replace |
| 32 |
this line, as if that file's contents appeared here to begin with. |
| 33 |
|
| 34 |
|
| 35 |
.SH "FILES" |
| 36 |
.PP |
| 37 |
You can use \fIimport\fP to include a file or files. This file's location is relative to the |
| 38 |
Conffile's location. It is an error if a specific file cannot be found, but an empty glob pattern is |
| 39 |
not an error. |
| 40 |
|
| 41 |
.SH "SNIPPETS" |
| 42 |
.PP |
| 43 |
You can define snippets to be reused later in your Conffile by defining a block with a single\-token |
| 44 |
label surrounded by parentheses: |
| 45 |
|
| 46 |
.PP |
| 47 |
.RS |
| 48 |
|
| 49 |
.nf |
| 50 |
(mysnippet) { |
| 51 |
... |
| 52 |
} |
| 53 |
|
| 54 |
.fi |
| 55 |
.RE |
| 56 |
|
| 57 |
.PP |
| 58 |
Then you can invoke the snippet with \fIimport\fP: |
| 59 |
|
| 60 |
.PP |
| 61 |
.RS |
| 62 |
|
| 63 |
.nf |
| 64 |
import mysnippet |
| 65 |
|
| 66 |
.fi |
| 67 |
.RE |
| 68 |
|
| 69 |
.SH "EXAMPLES" |
| 70 |
.PP |
| 71 |
Import a shared configuration: |
| 72 |
|
| 73 |
.PP |
| 74 |
.RS |
| 75 |
|
| 76 |
.nf |
| 77 |
\&. { |
| 78 |
import config/common.conf |
| 79 |
} |
| 80 |
|
| 81 |
.fi |
| 82 |
.RE |
| 83 |
|
| 84 |
.PP |
| 85 |
Where \fB\fCconfig/common.conf\fR contains: |
| 86 |
|
| 87 |
.PP |
| 88 |
.RS |
| 89 |
|
| 90 |
.nf |
| 91 |
prometheus |
| 92 |
errors |
| 93 |
log |
| 94 |
|
| 95 |
.fi |
| 96 |
.RE |
| 97 |
|
| 98 |
.PP |
| 99 |
This imports files found in the zones directory: |
| 100 |
|
| 101 |
.PP |
| 102 |
.RS |
| 103 |
|
| 104 |
.nf |
| 105 |
import ../zones/* |
| 106 |
|
| 107 |
.fi |
| 108 |
.RE |
| 109 |
|
| 110 |
.SH "SEE ALSO" |
| 111 |
.PP |
| 112 |
See atomdns\-conffile(5). |