Skip to content

Generate diff for all modules #440

@jooola

Description

@jooola
SUMMARY

Ansible is capable of printing diffs for before and after a module has run.

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_checkmode.html#using-diff-mode

None of our modules implement this feature, which can be handy.

ISSUE TYPE
  • Feature Idea
ADDITIONAL INFORMATION

Most of the following steps are already implemented for the logic of our modules, only a few are missing to implement the diff:

  • Fetch the current state of the resource
  • TODO: Generate the result of the previous state and save it
  • Apply the requested changes if any, or create the resource if non-existent
  • TODO: Generate the result of the after state and save it
  • Generate the result of the state and return to the user

To simplify the implementation, a refactor might be needed to use the same structure on all our modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions