Created
April 10, 2019 11:03
-
-
Save ohadlevy/74e6b351869baf2f9b5a0dc09846cd23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## usage | |
#./nmap-ansible-facts.sh 192.168.0.0/24 | |
#! /bin/bash -x | |
NETWORK=$1 | |
tmpfile=$(mktemp /tmp/foreman-ansible-import.XXXXXX) | |
nmap -p 22 -Pn -R -oG - $1 | awk '/open/{print $2}' > $tmpfile | |
ansible -u root -k -i $tmpfile all -m setup | |
\rm -rf $tmpfile% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment