Last Updated: February 25, 2016
·
4.611K
· Lorin Hochstein

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

3 Responses
Add your response

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 ·