何か特殊な要件などがなければ そのクラウドで第一にサポートされてるOS の最新版を選ぶべきなのでは?
単純にEC2なりGCEをLaunchするときに一番最初に選ばれているOSが安牌。
AWSであればAmazon Linuxだし、GCPであればDebian Backportsが第一候補。
ruby -e 'Dir.glob("#{Dir.pwd}/nodes/*").to_a.map {|path| path.match(/nodes\/(.+)\.json/)[1]}.each {|node| system "bundle exec knife solo cook #{node}"}' |
require "net/http" | |
require "aws-sdk" | |
require "aws_config" | |
def own_region | |
begin | |
timeout 3 do | |
Net::HTTP.get("169.254.169.254", "/latest/meta-data/placement/availability-zone").chop | |
end | |
rescue |
# Description: | |
# Shibame is the yet another important thing in your life | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# Export your Flickr API key to environmental variable FLICKR_API_KEY | |
# | |
# Commands: |
だいぶ前に作って放置していたRubygem backlog_jp を Backlog.jp API V2 に対応する形でほぼ作り直した。使い方はREADMEを参照。
以前のバージョンではオブジェクト指向的に課題を操作したりできるようにしようと意気込んではいたものの途中で飽きてしまい、中途半端な状態で放置してしまったので今バージョンは本当に薄いラッパーという感じに。
実装例として、プロジェクト内の全課題とそれについているコメントをJSONにexportするツール backlog_jp-pj2json も作った。
テストコードも書いてなく粗末な出来ですが、物好きな方はご利用ください。
require "thor" | |
require "aws-sdk-resources" | |
class OrenoAwsTool < Thor | |
class_option :profile, | |
desc: "Load credentials by profile name from shared credentials file (~/.aws/credentials).", | |
aliases: [:p] | |
class_option :access_key_id, | |
desc: "AWS access key id.", |
require "nokogiri" | |
require "open-uri" | |
site_uri = "http://status.aws.amazon.com" | |
html = Nokogiri::HTML(open site_uri) | |
feed_uris = html.css("a[href$=rss]").map do |node| | |
site_uri + node.attributes["href"].value | |
end |
attrs = { | |
embulk: { | |
install_path: "/opt/embulk", | |
download_url: "https://bintray.com/artifact/download/embulk/maven/embulk-0.5.2.jar", | |
path_export_script_path: "/etc/profile.d" | |
} | |
} | |
directory "#{attrs[:embulk][:install_path]}/bin" do | |
action :create |
#!/bin/sh | |
# chkconfig: 345 98 20 | |
# description: Change hostname to EC2 Name tag of the instance | |
# processname: ec2tag-hostname | |
. /etc/init.d/functions | |
start() { | |
sleep 15 | |
REGION=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/.$//'` |