Sync last changes

This commit is contained in:
2025-07-09 14:31:11 -04:00
parent cf3811c98f
commit 1378d8a38e
23 changed files with 4051 additions and 8 deletions

30
utils/dns_parse.pl Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/perl
use strict;
my $BASE_URL="tower2.thezengarden.net";
my $AAP_INVENTORY=14;
my $CONTENT_TYPE="Content-type: application/json";
my $TOWER_TOKEN="Authorization: Bearer YtLStVtkMGKxnWinslNiqDgYwZqKfM";
my $csv = $ARGV[0];
open (CSV, "< $csv") or die "unable to read $csv: $0\n";
while (my $line = <CSV>)
{
chomp $line;
$line =~ s/\r//g;
my @host = split(/,/, $line);
next if $host[1] =~ /Not/;
my $json_args = "{\"name\": \"$host[1]\", \"description\": \"$host[0]\"}";
print "$json_args\n";
my $add_host_post = `curl -s -k -H \"$TOWER_TOKEN\" -H \"$CONTENT_TYPE\" -X POST -d '$json_args' \"https://$BASE_URL/api/v2/inventories/$AAP_INVENTORY/hosts/\"`;
print "$add_host_post\n";
}