Last active
June 8, 2016 02:49
-
-
Save hakopako/c381b891c5dab740970b262cbb4c675a to your computer and use it in GitHub Desktop.
itamae entrypoint.rb sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node["recipes"] = node["recipes"] || [] | |
host_name = node[:hostname] # SpecinfraというGemを利用しているらしい | |
host_group = host_name[/(.+)([0-9]){4}/, 1 ] # 号機を除いたホスト名 ex.) hogehoge0001 -> hogehoge | |
proxy_host = "bar" | |
proxy_port = "1234" | |
# 実行環境 | |
if host_name.index("-dev") != nil then | |
env = "dev" | |
elsif host_name.index("-test") != nil then | |
env = "test" | |
else | |
env = "product" | |
end | |
node.reverse_merge!( | |
common: { | |
host_name: host_name , | |
host_group: host_group , | |
proxy_host: proxy_host, | |
proxy_port: proxy_port, | |
env: env | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment