07092026
test / build-docs (push) Successful in 1s

This commit is contained in:
jonnybravo
2026-09-07 17:02:48 +02:00
parent 6678aed520
commit 23b7df0037
118 changed files with 2029 additions and 1467 deletions
-1
View File
@@ -1,7 +1,6 @@
[defaults]
#inventory = /home/user06/hosts
inventory = ./ansible_inv_main.py
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S on {host}
private_key_file = /home/jonnybravo/.ssh/ansible-test
gathering = smart
fact_caching = yaml
+5 -1
View File
@@ -44,7 +44,11 @@ def scan_csv(csvfile=str, colm="hostname"):
with open(csvfile) as csv_file:
csv_reader = csv.DictReader(csv_file, delimiter=",")
for count, row in enumerate(csv_reader, 1):
hostlist.append(row[colm])
hostname = row[colm]
if port_open(address=hostname):
hostlist.append(hostname)
else:
print(f"INFO: Host {hostname} not reachable.", file=sys.stderr)
else:
raise FileNotFoundError(
errno.ENOENT, os.strerror(errno.ENOENT), csvfile)