ansible-tools/gather_facts
2022-09-07 02:35:53 +02:00

20 lines
553 B
Bash
Executable File

#!/bin/bash
ANSIBLE_DIR=/etc/ansible
ANSIBLE_CMDB=/usr/local/bin/ansible-cmdb
OUTPUT=/var/www/def/public/facts.html
rm $ANSIBLE_DIR/gathered_facts/*
ansible '!off,linux,windows' -m setup -f 5 --task-timeout 30 --tree $ANSIBLE_DIR/gathered_facts >/dev/null
if [[ -x $ANSIBLE_CMDB ]]; then
INV=""
if [[ -r $ANSIBLE_DIR/cmdb-inventory ]]; then
INV="-i $ANSIBLE_DIR/cmdb-inventory"
fi
$ANSIBLE_CMDB $INV -t html_fancy_split_overview $ANSIBLE_DIR/gathered_facts > $OUTPUT
fi
# vim: set tabstop=4 shiftwidth=4 expandtab smarttab: