diff options
author | Julien Dessaux | 2017-09-06 14:16:34 +0200 |
---|---|---|
committer | Julien Dessaux | 2017-09-06 14:18:19 +0200 |
commit | dd4d4a9d9d26c22b3600ff459b292ba6840daab4 (patch) | |
tree | ab6af82098db9d9bee8ea3aea2b348c142b82c20 /services/applications | |
parent | Updated usebundle system to include caller information un report (diff) | |
download | masterfiles-dd4d4a9d9d26c22b3600ff459b292ba6840daab4.tar.gz masterfiles-dd4d4a9d9d26c22b3600ff459b292ba6840daab4.tar.bz2 masterfiles-dd4d4a9d9d26c22b3600ff459b292ba6840daab4.zip |
Added php56 management for nagios policies
Diffstat (limited to '')
-rw-r--r-- | services/applications.cf | 1 | ||||
-rw-r--r-- | services/applications/nagios.cf | 2 | ||||
-rw-r--r-- | services/applications/php56.cf | 33 |
3 files changed, 35 insertions, 1 deletions
diff --git a/services/applications.cf b/services/applications.cf index 6a5af1d..27ee499 100644 --- a/services/applications.cf +++ b/services/applications.cf @@ -5,6 +5,7 @@ body file control "services/applications/check_mk.cf", "services/applications/fcgiwrap.cf", "services/applications/nagios.cf", + "services/applications/php56.cf", "services/applications/sshd.cf", }; } diff --git a/services/applications/nagios.cf b/services/applications/nagios.cf index a664bb5..8e9ab44 100644 --- a/services/applications/nagios.cf +++ b/services/applications/nagios.cf @@ -5,9 +5,9 @@ bundle agent nagios "packages" slist => { "nagios4", "nginx", - "php56", }; methods: nagios:: "nagios" usebundle => fcgiwrap("nagios", "www", "770"); + "nagios" usebundle => php56(); } diff --git a/services/applications/php56.cf b/services/applications/php56.cf new file mode 100644 index 0000000..5f96d25 --- /dev/null +++ b/services/applications/php56.cf @@ -0,0 +1,33 @@ +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"; +} |