Skip to content

Instantly share code, notes, and snippets.

@danielnegreiros
Created August 27, 2022 20:36
Show Gist options
  • Save danielnegreiros/79f2f49c46656d5a341181677e9610b9 to your computer and use it in GitHub Desktop.
Save danielnegreiros/79f2f49c46656d5a341181677e9610b9 to your computer and use it in GitHub Desktop.
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Get info from Nginx running process
ansible.builtin.command: systemctl status nginx
register: nginx_status
- name: Assert that Nginx is up and running
ansible.builtin.assert:
that:
- nginx_status is success
success_msg: Nginx successfully installed and started
fail_msg: The test validation failed, please check manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment