以åãQiitaã§ããããè¨äºãæ¸ãããã§ããï¼
ããã¨åãã³ã³ã»ããã§ãæä½éã®è¨å®ã§ä½æå¾ã®ã¤ã¡ã¼ã¸ã«Serverspecãèµ°ãããããã®ãã©ã°ã¤ã³ãæ¸ãã¾ããã
ã¤ã³ã¹ãã¼ã«ã¯ãä»ã®ã¨ããèªåã§ãã«ãããå¿ è¦ãããã¾ãï¼ããã¡ããã¡ããã¨ããããã¤ããªãé ãããï¼ã
# Needs Go >= 1.3 $ git clone https://github.com/udzura/packer-provisioner-serverspec.git $ cd packer-provisioner-serverspec $ make install
è¨å®ã¯ãããªæãã§ã
{ "builders" : [ { "type": "amazon-ebs", "ssh_username": "centos", "ssh_pty": true, "...": "..." } ], "provisioners": [ { "type": "shell", "script": "/path/to/your-provisoner.sh" }, { "type": "serverspec", "source_path": "/path/to/your/serverspec-root" } ] }
ä»ã¯Î±çã¨ãããã¨ï¼ã«ãã¦ããï¼ã§ããããããªæ¡ä»¶ãåºå®ã§ãã
- sshã®ã¦ã¼ã¶ã¯sudoã§ããªãã¨ãããªã
"ssh_pty": true
ã§ãªãã¨ãããªãï¼Packer 0.8ããã ããã§ããåèï¼- rakeã¿ã¹ã¯ã¯
rake spec
ã§ãªãã¨ãããªã - ãã£ã¬ã¯ããªæ§æã¯ãããªæãããããã
/path/to/your/serverspec-root âââ Gemfile # Gemfileã¨lockãå¿ ãããå¿ è¦ãªã âââ Gemfile.lock âââ Rakefile âââ spec âââ localhost â âââ cloud_init_spec.rb â âââ hosts_spec.rb â âââ packages_spec.rb â âââ users_spec.rb # and so on... âââ spec_helper.rb
Serverspecèªä½ã®ã¤ã³ã¹ãã¼ã«ã¯ omnibus ã使ã£ã¦ãã¾ãã @sawanoboly ããã¯ç¥ã§ãããããã§ãCentOSãUbuntuã§ããã°ã²ã¨ã¾ãåãããã§ããããUbuntuã¯ã¡ããã¨æ¤è¨¼ãã¦ãã¾ãã......
rake spec
ãçµãã£ããserverspecããã±ã¼ã¸ã¨ã¢ããããserverspecã®ãã£ã¬ã¯ããªã¯ç¶ºéºã«æ¶ãã¾ãã
ãããªæãã§ãæ©è½ã¯ã¾ã å ¨ç¶è¶³ããªãã§ãããã試ããã ããã
PR
ããããPackerã®æ·±ã話ãå ·ä½çã«ã¯provisionerã ãã§ãªãbuilderã¾ã§èªä½ããäºä¾ãã HackerTackleã¨ããã¤ãã³ãã§è©±ãã¾ããã¤ãã§ã«ããConsulã®è©±ã¨ããªããæ½è±¡çãªè©±ããã¡ããã¾ãã
ãªãã¨ï¼ ææ¥ ãªãã§ãããä¼å ´ããªãä½è£ãããã®ã§ãä»ããç»é²ãã¦ãåå ã§ããã¨æãã¾ãï¼
ä¹å·ã«ä½ãã§ããªã人ããä»ããé£è¡æ©ãåãã°å ¨ç¶éã«åãã¾ãï¼
ã¨ããæãã§ãæ·±ã話ãã§ãããªããã¤æåç·ï¼èªåãæ£ã«ãããï¼ã®ã¨ã³ã¸ãã¢ã«è³ªåã§ãããããã£ã¤ãè°è«ã§ããè²´éãªå ´ã ã¨æãã¾ããåå¤ã§ãå¾ ã¡ãã¦ããã¾ãï¼