Skip to content

Instantly share code, notes, and snippets.

@shofetim
Created June 6, 2013 19:58
Show Gist options
  • Select an option

  • Save shofetim/5724436 to your computer and use it in GitHub Desktop.

Select an option

Save shofetim/5724436 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import salt.client
import os
client = salt.client.LocalClient()
ret = client.cmd("*", "network.ip_addrs")
ips = set(reduce(lambda x, y: x+y, ret.values()))
cmd = "ssh-keyscan "
for ip in ips:
cmd += ip + " "
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment