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