summaryrefslogtreecommitdiff
path: root/cfengine/watchdog.cf
blob: f1fec418f34ca31e3ec6df4c8138cf5c42725fdd (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
bundle agent cfengine_watchdog
{
    vars:
        systemd::
            "data" string => '{"systemd": true}';
        !systemd::
            "data" string => '{"systemd": false}';
    files:
        !alpinelinux::
            "/etc/cron.d/cfengine_watchdog"
                create => "true",
                perms => system_owned("444"),
                edit_template => "$(sys.inputdir)/templates/cfengine/cfengine_watchdog.cftpl",
                template_method => "mustache",
                template_data => parsejson("$(data)"),
                classes => if_repaired("cfengine_watchdog_repaired");
        alpinelinux::
            "/etc/crontabs/root"
                create => "false",
                perms => system_owned("400"),
                edit_line => append_if_no_line("* * * * * [ -x \"/var/lib/cfengine/bin/cf-execd\" ] && if ! /usr/bin/pgrep cf-execd > /dev/null; then \"/var/lib/cfengine/bin/cf-execd\"; fi"),
                classes => if_repaired("cfengine_watchdog_repaired");
    reports:
        any::
            "$(this.bundle): /etc/cron.d/cfengine_watchdog repaired" ifvarclass => "cfengine_watchdog_repaired";
}