åºè«
Serverspec ãmizzyæ°ã«ãã£ã¦ãªãªã¼ã¹ãããã®ã¯2013å¹´3æã®ãã¨ã§ãï¼
ãããã5å¹´éã§ã¤ã³ãã©ã¨ã³ã¸ãã¢ã®çããã¯ã¯ã©ã¦ãåãã»ãã¥ãªãã£ã®æ©éãé«ã¾ã£ã¦
ä»äºå
容ã大ããå¤ãã£ãã¨ããæ¹ãå¤ãã®ã§ã¯ãªãã§ããããï¼ï¼
Serverspecã®èªçã¯ã¤ã³ãã©æ§æã®èªååã®å¤¢ãè¦ã¦ãã人é¡ã«ã¨ã£ã¦ååãããã¤ã³ãã¯ããä¸ããã¨æãã¾ãï¼
ããã¦ï¼Ansible,Chefãªã©ã®æ§æ管çãã¬ã¼ã ã¯ã¼ã¯ã®å°é ã¨ç¸ã¾ã£ã¦éç¨ã«ã¯æ¬ ãããªãæé«ã®ãã¼ã«ã¨ãªãã¾ããï¼
ãµã¼ãã¼æ§æã®ãã¹ããç®è¦ç¢ºèªã§è¡ã人é¡ã«æ¯ã¹ãã¨å¤§ããé²åãã¾ããï¼ ãã®èªååã¯è¤éæ§ãä¼´ããã®ã§ã¯ãªãèªååãå éãããã»ã©ã·ã³ãã«ã§ç¾ãããã®ã§ããï¼
ãã¹ãé§åã¤ã³ãã©ã®æµã
- ããããæ¸ãã¤ã³ãã©ã³ã¼ãã«å¯¾ãããã¹ãã³ã¼ããè¨è¿°ãã
- ã¤ã³ãã©ã³ã¼ãé©ç¨åã®VMã«å¯¾ãã¦ãã¹ããå®æ½ã失æãããã¨ã確èªãã
- ç®çã®ã¤ã³ãã©ã³ã¼ããæ¸ã
- ã¤ã³ãã©ã³ã¼ããVMã«é©ç¨ãããã¹ããæåãããã¨ã確èªãã
- ã¤ã³ãã©ã³ã¼ãé©ç¨åã®ç¶æ ã«VMããã¼ã«ããã¯ãã
- ã¤ã³ãã©ã³ã¼ãããªãã¡ã¯ããªã³ã°ãã
- ãªãã¡ã¯ã¿ãªã³ã°ããã¤ã³ãã©ã³ã¼ããVMã«é©ç¨ãããã¹ããæåãããã¨ã確èªãã
- 1 ~ 7 ãç¹°ãè¿ã
Serverspecã¯ãµã¼ãã¼æ§æ管çãã¼ã«ãè¤éã§ãã£ãããçã¾ãããã¼ã«ã§ã è¤éãªãµã¼ãã¼æ§æ管çãã¼ã«ãä¸è¦ã«ãªãã¨Serverspecãä¸è¦ã«ãªãã§ããã ããããæåã§ã¤ã³ãã©ãæ§ç¯ããå ´åã¯ãããããæçãªãã¼ã«ã§ããã¨ããã¾ã
Gossã¨ã¯
Goss is EASY! Goss is FAST! Goss is SMALL!
Gossã¨ã¯ããµã¼ãã¼ã®æ§æãæ¤è¨¼ããããã®YAMLãã¼ã¹ã®Serverspecã®ä»£æ¿ãã¼ã«ã§ãã ç¾å¨ã®ã·ã¹ãã ç¶æ ãããã¹ããçæã§ããããã«ãããã¨ãã§ãããã¹ããæ¸ãããã»ã¹ãããç°¡åã«è¡ããã¨ãã§ãã¾ãã ã¤ã³ã¹ãã¼ã«ãç°¡åã§Goããåãã°åºæ¬çã«ã©ãã§ãåãããã ãã¤ããªã¨ãã¦10MBãããã®å¤§ãã Dockerã¸ã®å¯¾å¿ãã¢ã¸ã¥ã¼ã«ãå²ã¨å å®ãã¦ããã
Serverspecã¨ã®éã
ã¡ãªãã
- Ruby(ãããã¯Go)ã«ç²¾éãã¦ãªãã¦ããµã¼ãã¼ãæ£ããæ§æããã¦ãããã©ããã確èªãããã¨ãã§ãã ã¤ã³ã¹ãã¼ã«ãç°¡å
- gemãªã©ã®ç°å¢ã«æ©ã¾ããããã¨ããªã
ãã¡ãªãã
- ãã©ã°ã¤ã³ãå°ãªãã®ã§å°ãã¯ã¿ã ãããã¨ããããã¨ããã¨ã©ããã¦ããèªåã§è¨è¿°ããçºã®Goã®ç¥èãå¿ è¦ã«ãªã
How to Goss
Goss ã¤ã³ã¹ãã¼ã«
èªåã¤ã³ã¹ãã¼ã«
curl -fsSL https://goss.rocks/install | sh
æåã¤ã³ã¹ãã¼ã«
curl -L https://github.com/aelsabbahy/goss/releases/download/_VERSION_/goss-linux-amd64 -o /usr/local/bin/goss chmod +rx /usr/local/bin/goss
ç°¡åã«ä½¿ãã
å ¬å¼ããã¥ã¡ã³ãã«45ç§ã§ä½¿ãããï¼ã¨ããã®ã§æ¸ããã ãã§ãããªããã¨æ¬å½ã«é«éã«è¡ããã¨ãã§ããã 使ç¨ããã³ãã³ãã ã確èªãã
# goss add package openssh-server # goss add service sshdã
ãã®2è¡ã§ç¾å¨ã®Openssh-serverã®ããã±ã¼ã¸ã®æ å ±ã¨sshdã®ãµã¼ãã¹ã®ç¶æ ãè¨é²ã§ããã
# systemctl stop sshd # goss validate
sshdãæ¢ãã¦gossãå®è¡ãã㨠ãã£ããã¨ã¨ã©ã¼ãåºã¾ãã
FS....F Failures/Skipped: (詳細ä¸ç¥)
# goss serve 2>/dev/null & # curl -i http://localhost:8080/healthz
ã¡ãªã¿ã«ãHTTPã¨ãã¦åå¾ãå¯è½ã§ãã
FS....F Failures/Skipped: (詳細ä¸ç¥)
詳ããã¯ãã¡ãã«å ¨é¨æ¸ãã¦ãã¾ãã https://github.com/aelsabbahy/goss/blob/master/docs/manual.md
Nginxã®è¨å®ã確èªãã
ã³ãã³ãããã³ããã§ä¸è¨ã®ã³ãã³ããå®è¡ãã¾ãï¼
$goss add service nginx $goss add process nginx $goss add port nginx $goss add port 80 $goss add package nginx $goss add user nginx $goss add group nginx
ããã¨ã«ã¬ã³ããã£ã¬ã¯ããªã«goss.yaml ã¨ãããã¡ã¤ã«ãã§ãã¦ãããã¡ã¤ã«ã®ä¸èº«ã¯ä¸è¨ã®ããã«ãªã£ã¦ããã¾ãï¼ Nginxãèµ·åãã¦ããç¶æ ãè¨é²ããyamlãçæã§ãã¾ããï¼
package: nginx: installed: true versions: - 1.12.2 port: tcp:80: listening: true ip: - 0.0.0.0 service: nginx: enabled: true running: true user: nginx: exists: true groups: - nginx home: /var/lib/nginx shell: /sbin/nologin group: nginx: exists: true process: nginx: running: true
å ã»ã©åæ§å®è¡ããã¨
$goss validate ............... Total Duration: 0.053s Count: 15, Failed: 0, Skipped: 0
GitHub - nwiizo/nginx_goss: Call people to use Goss for nginx