install mackerel agent
- install chef-dk from http://downloads.getchef.com/chef-dk/
- git clone https://github.com/higanworks/chef-local-mode-mackerel-agent.git
cd chef-local-mode-mackerel-agent
- berks vendor cookbooks
set API_KEY from ENV
- MACKEREL_API_KEY='Your API KEY' chef-client -z -o 'role[mackerel-agent-active]'
input API_KEY from stdin
- chef-client -z -o 'role[mackerel-agent-active]'
Starting Chef Client, version 11.xx.xx
...
Synchronizing Cookbooks:
- apt
- mackerel-agent
- yum
- mackerel_setting_sample
Compiling Cookbooks...
========================================
Please input Mackrel API_KEY ? << Please input apikey here.
set API_KEY from attribute by node, role or environment.
{
"mackerel-agent": {
"conf": {
"apikey": "your api key"
}
}
}
- bootstrap
knife zerobootstrap {ip address} -r 'role[mackerel-agent-active]'
- exec
knife exec -E "nodes.all {|n| n.set['mackerel-agent']['conf']['apikey'] = 'Your API KEY'' ; n.save }"
- run
knife zero chef_client "name:*" [ -a ipaddress]