added
This commit is contained in:
@@ -35,7 +35,7 @@ def create_ip_list(target_ip="192.168.50.1/24"):
|
||||
only_ip_list.append(i['hostname'])
|
||||
else:
|
||||
only_ip_list.append(i['ip'])
|
||||
return only_ip_list
|
||||
return tuple(only_ip_list)
|
||||
|
||||
def scan_csv(csv_file=str):
|
||||
pass
|
||||
@@ -43,7 +43,7 @@ def scan_csv(csv_file=str):
|
||||
|
||||
if __name__ == "__main__":
|
||||
ip_list = create_ip_list()
|
||||
|
||||
man_list = ["ras-dan-01.local", "dan-jam-01"]
|
||||
output = {
|
||||
"_meta": {
|
||||
"hostvars": {
|
||||
@@ -52,15 +52,22 @@ if __name__ == "__main__":
|
||||
}
|
||||
}
|
||||
},
|
||||
"network-scan": {
|
||||
"network_scan": {
|
||||
"hosts": ip_list,
|
||||
"vars": {
|
||||
"ansible_user": "jonnybravo",
|
||||
"ansible_python_interpreter": "/usr/bin/python3",
|
||||
"ansible_ssh_private_key_file": "/home/jonnybravo/.ssh/ansible-test"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scan_csv": {
|
||||
"hosts": man_list,
|
||||
"vars":{
|
||||
"ansible_user": "jonnybravo",
|
||||
"ansible_python_interpreter": "/usr/bin/python3",
|
||||
"ansible_ssh_private_key_file": "/home/jonnybravo/.ssh/ansible-test"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print(json.dumps(output,indent=4, sort_keys=True))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user