Skip to content

Instantly share code, notes, and snippets.

View inokappa's full-sized avatar
😴
zzzzz

Yohei Kawahara inokappa

😴
zzzzz
View GitHub Profile
@inokappa
inokappa / gist:38440fb4149a176d610f
Last active August 29, 2015 14:00
Puppet を使って Sensu Server をプロビジョニングした際のログ(2)
Warning: Deprecation notice: Resource references should now be capitalized on line 11 in file /etc/puppet/manifests/site.pp
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Notice: Compiled catalog for ip-xxx-xxx-xxx-xxx.ec2.internal in environment production in 4.85 seconds
Notice: /Stage[main]/Main/Node[default]/Rabbitmq_vhost[/sensu]/ensure: created
Notice: /Stage[main]/Sensu::Client::Service/Service[sensu-client]/ensure: ensure changed 'stopped' to 'running'
Notice: /Stage[main]/Sensu::Api::Service/Service[sensu-api]/ensure: ensure changed 'stopped' to 'running'
Notice: /Stage[main]/Sensu::Server::Service/Service[sensu-server]/ensure: ensure changed 'stopped' to 'running'
Notice: /Stage[main]/Sensu::Dashboard::Service/Service[sensu-dashboard]/ensure: ensure changed 'stopped' to 'running'
Notice: /Stage[main]/Main/Node[default]/Rabbitmq_user_permissions[sensu@/sensu]/ensure: created
Notice: Finished catalog run in 23.26 seconds
@inokappa
inokappa / gist:f6cbab790a26d0269908
Created May 4, 2014 01:37
Sensu がちゃんとインストールして起動しているかを確認する spec
require 'spec_helper'
PACKAGES = [
'sensu' ,
'redis' ,
'rabbitmq-server'
]
PACKAGES.each do |pkg|
describe package pkg do
it { should be_installed }
@inokappa
inokappa / gist:bd67ac42a0267f5f715d
Created May 4, 2014 09:20
Puppet から Docker コンテナを起動するマニフェスト
node default {
include 'docker'
$IMAGES = ['centos','ubuntu']
docker::image { $IMAGES :
ensure => 'present',
}
$CONTAINER = ['container1','container2']
docker::run { $CONTAINER :
image => 'centos',
command => 'echo "a"',
@inokappa
inokappa / gist:f7ad701ee27c25bb806a
Last active August 29, 2015 14:00
Chef から Docker コンテナを作成するレシピ
include_recipe "docker"
#
docker_image 'centos'
#
docker_container 'centos' do
command 'echo "a"'
detach true
end
@inokappa
inokappa / gist:4af007ad6eb9a901bcc4
Created May 4, 2014 21:49
Chef から Docker コンテナを操作した時のログ
Recipe: docker-test::default
* docker_image[centos] action pull[2014-05-04T21:41:21+00:00] INFO: Processing docker_image[centos] action pull (docker-test::default line 3)
* docker_container[centos] action run[2014-05-04T21:42:26+00:00] INFO: Processing docker_container[centos] action run (docker-test::default line 5)
Recipe: <Dynamically Defined Resource>
* template[/etc/init.d/centos] action create[2014-05-04T21:42:27+00:00] INFO: Processing template[/etc/init.d/centos] action create (/root/chef-repo-test/cookbooks/docker/providers/container.rb line 402)
[2014-05-04T21:42:28+00:00] INFO: template[/etc/init.d/centos] created file /etc/init.d/centos
@inokappa
inokappa / gist:6c4b95367277abadd460
Created May 5, 2014 04:59
Chef Handlers json_file Handler example
{
"node": {
"name": "ip-xxx-xxx-x-xxx.ec2.internal",
"chef_environment": "_default",
"json_class": "Chef::Node",
"automatic": {
"chef_packages": {
"ohai": {
"version": "7.0.4",
"ohai_root": "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/ohai-7.0.4/lib/ohai"
@inokappa
inokappa / gist:cc24f85c4e05c8790d06
Created May 6, 2014 02:51
graphite-web の初期設定
[root@ip-xxx-xxx-x-xx]# /usr/lib/python2.6/site-packages/graphite/manage.py syncdb
/usr/lib/python2.6/site-packages/graphite/settings.py:231: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security
warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')
/usr/lib/python2.6/site-packages/django/conf/__init__.py:75: DeprecationWarning: The ADMIN_MEDIA_PREFIX setting has been removed; use STATIC_URL instead.
"use STATIC_URL instead.", DeprecationWarning)
/usr/lib/python2.6/site-packages/django/core/cache/__init__.py:82: DeprecationWarning: settings.CACHE_* is deprecated; use settings.CACHES instead.
DeprecationWarning
Creating tables ...
Creating table account_profile
Creating table account_variable
@inokappa
inokappa / gist:4ed5dc4446205cbc9a64
Last active August 29, 2015 14:01
chef-solo で Sensu Server をインストールするメモ

前提

インストールした環境

  • AWS EC2 インスタンス
  • CentOS 6.5
  • ChefOmnibus Installer にてインストール済み
  • Chef Handlerschef-handler-graphiteGraphite とかで結果を可視化している(Sensu Server とはあまり関係無いw)

@inokappa
inokappa / gist:668ddeaa3957f2f897e4
Last active August 29, 2015 14:01
Chef Server で Sensu をセットアップするメモ

やりたいこと

  • Sensu ServerSensu Client の設定 Chef でやらせるにあたり、毎回 knife solo を叩くのは近い将来はやってられんので
  • あと、この作業に乗じて Chef Server を復習する
  • ほとんど Chef Server とか Chef Client の使い方メモになってしまってる...

参考

@inokappa
inokappa / gist:7363a01c4797a67d80d8
Created May 11, 2014 13:04
Chef の role にて定義する sensu-client.json
{
"name": "sensu-client",
"default_attributes": {
},
"override_attributes": {
},
"run_list": [
"sensu::default",
"sensu::client_service"
]