# RADKIT Genie Diff Example## This example shows how an example playbook of how you can a command and run# a genie diff against a prior run on same device or across different devices.## In order for RADKIT to make a connection, expose variables as environment variables or# optionally, add them as variables in the playbook.## export RADKIT_ANSIBLE_CLIENT_PRIVATE_KEY_PASSWORD_BASE64=$(echo -n 'mypassword' | base64)# export RADKIT_ANSIBLE_IDENTITY="myuserid@cisco.com"# export RADKIT_ANSIBLE_SERVICE_SERIAL="xxxx-xxx-xxxx"#----name:Example of RADKIT Genie Diffhosts:daa-csr1become:nogather_facts:notasks:-name:Get show version parsed (initial snapshot)cisco.radkit.genie_parsed_command:commands:show versiondevice_name:"{{inventory_hostname}}"os:iosxeregister:cmd_outputdelegate_to:localhost-name:Get show version parsed (2nd snapshot)cisco.radkit.genie_parsed_command:commands:show versiondevice_name:"{{inventory_hostname}}"os:iosxeregister:cmd_output2delegate_to:localhost-name:Get a diff from snapshots of same devicecisco.radkit.genie_diff:result_a:"{{cmd_output}}"result_b:"{{cmd_output2}}"diff_snapshots:yesregister:diffdelegate_to:localhost-name:Show the diff (its going to be same in this example)debug:msg:"{{diff['genie_diff_result']}}"delegate_to:localhost-name:Run a genie diff against multiple deviceshosts:localhostbecome:nogather_facts:notasks:-name:Get show version parsed from routerAcisco.radkit.genie_parsed_command:commands:show versiondevice_name:daa-csr1os:iosxeregister:cmd_outputdelegate_to:localhost-name:Get show version parsed from routerBcisco.radkit.genie_parsed_command:commands:show versiondevice_name:daa-csr2os:iosxeregister:cmd_output2delegate_to:localhost-name:Get a diff from snapshots of both devicecisco.radkit.genie_diff:result_a:"{{cmd_output}}"result_b:"{{cmd_output2}}"diff_snapshots:noregister:diffdelegate_to:localhost-name:Show the diff (its going to be different in this example)debug:msg:"{{diff['genie_diff_result_lines']}}"delegate_to:localhost