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"; }