Smoke test after deployment with ansible
After deploying webservers with Ansible, I wanted to be able to run a "smoke test", a simple test that ensures that the servers are up and running. The test itself runs on my local machine, and makes requests against the web servres.
It's easy to do with local_action, which uses Ansible's delegation functionality. Here's what my smoke test play looks like:
---
- name: Run a smoke test against a deployed webserver
hosts: webservers
gather_facts: False
tasks:
- name: run smoke test
local_action: command scripts/smoke.py $inventory_hostname
Written by Lorin Hochstein
Related protips
3 Responses
Could you please provide a bit more detail. I am kind of newbie to ansible and am stuck on a use case like yours. Thanks in advance.
over 1 year ago
·
Thanks I got it working!
over 1 year ago
·
Yay!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ansible
Authors
Misha Behersky
78.97K
tartansandal
73.31K
Related Tags
#ansible
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#