summaryrefslogtreecommitdiff
path: root/services/applications/php56.cf
blob: 99e76a7c44c790cf9b68ab406db3860ee813b390 (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
40
41
bundle agent php56
{
    methods:
        freebsd::
            "freebsd"  usebundle => install_package("$(this.bundle)", "php56");
            "freebsd"  usebundle => add_rc_conf_line("$(this.bundle)", "php_fpm_enable=\"YES\"");
    files:
        freebsd::
            "/usr/local/etc/php.ini-production"
                edit_line => regex_replace(";date.timezone.*", "date.timezone = Europe/Paris"),
                classes => if_repaired("php56_php_ini_file_repaired");
            "/usr/local/etc/php.ini"
                link_from => ln_s("/usr/local/etc/php.ini-production"),
                move_obstructions => "true",
                classes => if_repaired("php56_php_ini_file_repaired");
            "/usr/local/etc/php-fpm.conf"
                create => "true",
                edit_defaults => empty,
                perms => system_owned("444"),
                copy_from => local_dcp("$(sys.inputdir)/templates/php/freebsd-php56-php-fpm.conf"),
                classes => if_repaired("php56_php_fpm_conf_file_repaired");
            "/var/run/php-fpm/."
                create => "true",
                perms => system_owned("444"),
                classes => if_repaired("php56_php_run_dir_repaired");
    classes:
        freebsd::
            "php_fpm_service_running" expression => returnszero("/usr/sbin/service php-fpm status", "noshell");
    commands:
        freebsd.!php_fpm_service_running::
            "/usr/sbin/service php-fpm start" classes => if_repaired("php_fpm_service_repaired");
        freebsd.(php56_php_fpm_conf_file_repaired|php56_php_ini_file_repaired)::
            "/usr/sbin/service php-fpm restart" classes => if_repaired("php_fpm_service_restarted");
    reports:
        any::
            "$(this.bundle): /usr/local/etc/php.ini repaired" ifvarclass => "php56_php_ini_file_repaired";
            "$(this.bundle): /usr/local/etc/php-fpm.conf repaired" ifvarclass => "php56_php_fpm_conf_file_repaired";
            "$(this.bundle): /var/run/php-fpm/ directory repaired" ifvarclass => "php56_php_run_dir_repaired";
            "$(this.bundle): php-fpm service repaired" ifvarclass => "php_fpm_service_repaired";
            "$(this.bundle): php-fpm service restarted" ifvarclass => "php_fpm_service_restarted";
}