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" 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"), edit_template => "$(sys.inputdir)/templates/php/freebsd-php56-php-fpm.conf", classes => if_repaired("php56_php_fpm_conf_file_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): sshd service repaired" ifvarclass => "php_fpm_service_repaired"; "$(this.bundle): sshd service restarted" ifvarclass => "php_fpm_service_restarted"; }