Consul ãã¤ã³ã¹ãã¼ã«ããããã®itamaeãã©ã°ã¤ã³ãä½ãã¾ãã
itamae-plugin-recipe-consul (0.1.0): Itamae plugin to install Consul with init scripts https://t.co/1QxtC1D4ck
— RubyGems (@rubygems) 2016å¹´5æ18æ¥
ã¢ããã¼ã·ã§ã³
consulèªä½ã¯golang製ãªã®ã§ãã¤ããªãã³ç½®ãã§ã¤ã³ã¹ãã¼ã«ã§ããã®ã§ãããconsulã®agentãinit.dãsystemdã§ãã¼ã¢ã³åããå¿ è¦ããã£ãã®ã§itamaeãã©ã°ã¤ã³ã«ãã¾ããã
OSã®ãã¼ã¸ã§ã³ãè¦ã¦ãããªã«init.dã¹ã¯ãªãããsystemdã¦ããããã¡ã¤ã«ãè¨ç½®ãã¾ããCentOS 6, CentOS 7, Debian 8辺ãã§CIãã¦ã¾ãã
consul watchãserviceã§èµ·åããã¬ã·ããä½ã£ãã®ã§ãããstretcher辺ãã¨å¯çµåãã¦ãã®ã§å«ãã¦ãã¾ãããï¼ç¤¾å ã¬ã·ãã«ã¯å«ãã¦ãï¼
使ãæ¹
ã¬ã·ãã®ä¸ã§ä¸è¨ã®ããã«æ¸ãã°OK
include_recipe "consul"
ãã©ã°ã¤ã³å
ã§ã¢ã¸ã¥ã¼ã«åãã¦ãã®ã§ä¸è¨ã®ããã«åå¥ã« include_recipe
ãã§ãã¾ã
include_recipe "consul::setup" include_recipe "consul::install" include_recipe "consul::service"
node.ymlã¯ãããªæã
consul: # install consul version (required) version: "0.6.4" # download zip platform (default: "linux_amd64") platform: "linux_amd64" # path to downloaded zip file (default: "/usr/local/src") src_dir: "/usr/local/src" # path to consul executable file (default: "/usr/local/src") bin_dir: "/usr/local/bin" # consul agent -data-dir option (default: "/tmp/consul") data_dir: "/tmp/consul" # consul agent other options (default: none) options: "-server -bootstrap-expect 1" gomaxprocs: 2
ã¡ãªãã
serviceã«ãã¦ããã¨itamaeãserverspecã§
# consul.rb service "consul" do action [:enable, :start] end
# consul_spec.rb describe service("consul") do it { should be_enabled } it { should be_running } end
ã®ããã«æ¸ãã¦ä¾¿å©
ã¹ãã·ã£ã«ãµã³ã¯ã¹
consulã®init.dã¹ã¯ãªããã¨systemdã¦ãããã¯ä¸è¨ãåèã«ããã¦ãããã¾ãã m( )m
追伸
gemããªãªã¼ã¹ããå¾ã§å¥ã®äººãä½ã£ãååã®gemãè¦ã¤ããorz *1 https://github.com/toritori0318/itamae-plugin-recipe-consul