Skip to content

Instantly share code, notes, and snippets.

@CharlieSu
Last active December 20, 2015 21:09
Show Gist options
  • Save CharlieSu/6195243 to your computer and use it in GitHub Desktop.
Save CharlieSu/6195243 to your computer and use it in GitHub Desktop.
Chef recipe for installing SPM
# Author: Charles Sullivan (charles@fullcontact.com)
if node.spm[:token] # Will only run if a SPM token is present.
apt_repository "sematech" do
action :add
uri "http://pub-repo.sematext.com/ubuntu"
distribution node['lsb']['codename']
components ["main"]
key "http://pub-repo.sematext.com/ubuntu/sematext.gpg.key"
notifies :run, "execute[apt-get update]", :immediately
end
package "spm-client"
service "spm-monitor" do
action :nothing
end
bash "spm-client-setup-conf.sh" do
user "root"
cwd "/tmp"
code "bash /opt/spm/bin/spm-client-setup-conf.sh #{node.spm[:token]} es standalone"
creates "/opt/spm/spm-monitor/conf/spm-monitor-config-#{node.spm[:token]}-default.properties"
notifies :restart, "service[spm-monitor]"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment