Projet

Général

Profil

Révision 331b8d85

ID331b8d85f7c38b6dbfe602f75d6c9831b1534694
Parent 753540f1
Enfant 77503f49

Ajouté par Steve Traylen il y a plus de 2 ans

New nftables::file type to include raw file

For example:

```puppet
nftables::file{'geoip':
content => "include \"/files/geoipsets/dbip/*.ipv4\"\n",
}
```

will right a file or content into the nftables configuration.

The file written will be included in configuration.

Fixes #146

Voir les différences:

REFERENCE.md
78 78

  
79 79
* [`nftables::chain`](#nftableschain): manage a chain
80 80
* [`nftables::config`](#nftablesconfig): manage a config snippet
81
* [`nftables::file`](#nftablesfile): Insert a file into the nftables configuration
81 82
* [`nftables::rule`](#nftablesrule): Provides an interface to create a firewall rule
82 83
* [`nftables::rules::dnat4`](#nftablesrulesdnat4): manage a ipv4 dnat rule
83 84
* [`nftables::rules::masquerade`](#nftablesrulesmasquerade): masquerade all outgoing traffic
......
1233 1234

  
1234 1235
Default value: `'custom-'`
1235 1236

  
1237
### <a name="nftablesfile"></a>`nftables::file`
1238

  
1239
Insert a file into the nftables configuration
1240

  
1241
#### Examples
1242

  
1243
##### Include a file that includes other files
1244

  
1245
```puppet
1246
nftables::file{'geoip':
1247
  content => @(EOT)
1248
    include "/var/local/geoipsets/dbip/nftset/ipv4/*.ipv4"
1249
    include "/var/local/geoipsets/dbip/nftset/ipv6/*.ipv6"
1250
    |EOT,
1251
}
1252
```
1253

  
1254
#### Parameters
1255

  
1256
The following parameters are available in the `nftables::file` defined type:
1257

  
1258
* [`label`](#label)
1259
* [`content`](#content)
1260
* [`source`](#source)
1261
* [`prefix`](#prefix)
1262

  
1263
##### <a name="label"></a>`label`
1264

  
1265
Data type: `String[1]`
1266

  
1267
Unique name to include in filename.
1268

  
1269
Default value: `$title`
1270

  
1271
##### <a name="content"></a>`content`
1272

  
1273
Data type: `Optional[String]`
1274

  
1275
The content to place in the file.
1276

  
1277
Default value: ``undef``
1278

  
1279
##### <a name="source"></a>`source`
1280

  
1281
Data type: `Optional[Variant[String,Array[String,1]]]`
1282

  
1283
A source to obtain the file content from.
1284

  
1285
Default value: ``undef``
1286

  
1287
##### <a name="prefix"></a>`prefix`
1288

  
1289
Data type: `String`
1290

  
1291
Prefix of file name to be created, if left as `file-` it will be
1292
auto included in the main nft configuration
1293

  
1294
Default value: `'file-'`
1295

  
1236 1296
### <a name="nftablesrule"></a>`nftables::rule`
1237 1297

  
1238 1298
Provides an interface to create a firewall rule

Formats disponibles : Unified diff