summaryrefslogtreecommitdiff
path: root/services/applications/bareos_fd.cf
blob: 9286c9af9fce57fb4fb709575ebadcfe19b443ea (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
bundle agent bareos_fd
{
    vars:
        freebsd::
            "packages" slist => {
                "bareos-client",
            };
            "rc_conf_lines" slist => {
                "bareos_fd_enable=\"YES\"",
                "bareos_fd_config=\"/usr/local/etc/bareos/\"",
            };
        !freebsd::
            "packages" slist => {};
    classes:
        freebsd::
            "bareos_fd_service_running" expression => returnszero("/usr/sbin/service bareos-fd status", "noshell");
    methods:
        freebsd::
            "freebsd"  usebundle => install_package("$(this.bundle)", "$(bareos_fd.packages)");
            "freebsd"  usebundle => add_rc_conf_line("$(this.bundle)", "$(bareos_fd.rc_conf_lines)");
    files:
        freebsd::
            "/usr/local/etc/bareos/bareos-fd.d/client/myself.conf"
                edit_defaults => std_defs,
                perms => system_owned("444"),
                edit_line => replace_line_end("Name =", "$(sys.host)-fd"),
                classes => if_repaired("bareos_client_file_repaired");
    commands:
        freebsd.!bareos_fd_service_running::
            "/usr/sbin/service bareos-fd start" classes => if_repaired("bareos_fd_service_repaired");
        freebsd.bareos_client_file_repaired::
            "/usr/sbin/service bareos-fd restart" classes => if_repaired("bareos_fd_service_restarted");
    reports:
        any::
            "$(this.bundle): /usr/local/etc/bareos/bareos-fd.d/client/myself.conf repaired" ifvarclass => "bareos_client_file_repaired";
            "$(this.bundle): bareos-fd service repaired" ifvarclass => "bareos_fd_service_repaired";
            "$(this.bundle): bareos-fd service restarted" ifvarclass => "bareos_fd_service_restarted";
}