Is there some way inside of a playbook to see if a role changed something?
The use case is this:

tests_of_my_role.yml:
- name: call role to see if working
  include_role:
    name: my_role
  vars:
    - my role vars

- set_fact:
    __role_changes_before: "{{ _tqm._stats.changes }}"

- name: call role again to see if idempotent
  include_role:
    name: my_role
  vars:
    - my role vars

- assert:
    that: __role_changes_before == _tqm._stats.changes
    msg: Role is not idempotent!

I'm assuming it would be possible to keep track of the changes with a
callback plugin, but I'm not sure how the callback would make the
"num_of_changes" variable available at the playbook scope.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CALF5A-L%3DMTt7r_0QimE9RK4STnPkceXR8zQ8YWUe-H4sP3EQxQ%40mail.gmail.com.

Reply via email to