summaryrefslogtreecommitdiffstats
path: root/doc/04-FileShipping.md
blob: 757b784f63849a459898bca173564c4572c856ae (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
<a id="FileShipping"></a>Plain config file shipping
===================================================

Icinga 2 offers a very powerful configuration format. By definition, it isn't
a configuration format at all, it's a DSL, a Domain Specific Language. There is
no chance to implement all of it's feature in a config tool like Icinga Director,
that would make as much sense as trying to create a GUI for Ruby or Perl.

So, sometimes one might want to ship additional hand-crafted Icinga 2 config
files not generated by the Director. Sadly, that way you loose a lot of it's
features like tracking changes, keeping deployment history and more. That's what
this part of fileshipper has been designed for. It allows you to tell Director
to deploy additional config files without even trying to understand them.

To enable this, please create a `directories.ini` in this modules config dir,
usually `/etc/icingaweb2/modules/fileshipper`:

```ini
[custom-rules]
source = /usr/local/src/custom-rules.git
target = zones.d/director-global/custom-rules

[test]
source = /tmp/replication-test
target = zones.d/director-global/having-fun
extensions = .conf .md
```

In this example all local files from `source` will be deployed to the given target
directory. Please take care, use of this module requires advanced understanding of
Icinga2 configuration. Per default only `.conf` files are synced, you can override
this with a custom space-separated list for the `extensions` parameter.

In case you want to trigger specific actions like re-rendering or deploying the
config on changes you might want to have a look at our sample GIT hook in
[contrib/git-hooks/post-merge](../contrib/git-hooks/post-merge).

When working with Puppet or similar, please consider notifying an `exec` resource
with `refreshonly` set to `true` instead.