copy file to host not in inventory

Hi, sorry, I can’t quite get my head around the last bit of my playbook.

I have a playbook that is doing ssh key rotations - it is pretty much all working other than once it has generated the keys and used authorized_keys module to put them on the hosts in the inventory, I want to copy the keys back to my workstation. Then it deletes the keys to cleanup. I use delegate_to and run_once when creating the keys, but how do I copy the keys to my workstation which is not in my inventory - I am using dynamic inventories in AWX… this isn’t something I have run into before, I will have to use a command worst case I guess, but welcome any alternative suggestions.

thanks
Bill

In the end I just used command: scp seems to work adequately

Regards

Bill

In the end I just used command: scp seems to work adequately

Regards

Bill

I am not sure if i clearly understood your question but, you might look into this:
https://docs.ansible.com/ansible/latest/modules/add_host_module.html