ansible-testing is designed to be a set of modules for Ansible to allow infrastructure testing.
Hopefully these modules will be absorbed into Ansible if the concept proves itself
git clone https://github.com/willthames/ansible-testing
ansible -M path/to/ansible-testing testing-playbook.yml
name: python is running app.py
test_process:
state: present
name: python
args:
- app.py
name: port 80 appears open from playbook machine
local_action: test_tcp host=example.com state=open port=80
name: check HTTP response has 200 status and contains Hello
local_action: test_http url=https://example.com/helloworld status=200 regex='.*Hello.*'
name: run hello command
action: command echo -n hello
register: hello_cmd
name: check results of hello command
assert:
that:
- "hello_cmd.stdout == 'hello'"
- "hello_cmd.rc == 0"