diff --git a/cookbooks/consul/files/usr/local/bin/check_file b/cookbooks/consul/files/usr/local/bin/check_file new file mode 100644 index 0000000..8622cee --- /dev/null +++ b/cookbooks/consul/files/usr/local/bin/check_file @@ -0,0 +1,9 @@ +#!/bin/bash + +TARGET=$1 + +if [ -f ${TARGET} ]; then + exit 1 +fi + +exit 0 diff --git a/cookbooks/consul/monitoring.rb b/cookbooks/consul/monitoring.rb index c9bfde4..63944de 100644 --- a/cookbooks/consul/monitoring.rb +++ b/cookbooks/consul/monitoring.rb @@ -1,3 +1,9 @@ +remote_file '/usr/local/bin/check_file' do + owner 'root' + group 'root' + mode '755' +end + %w(reboot-required).each do |conf| remote_file "/etc/consul.d/check-#{conf}.json" do owner 'root'