1
0
Fork 0
This repository has been archived on 2025-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-role-syncthing/files/syncthing.fact

23 lines
675 B
Perl

#!/usr/bin/env perl
###############################################################################
# \_o< WARNING : This file is being managed by ansible! >o_/ #
# ~~~~ ~~~~ #
###############################################################################
use strict;
use warnings;
use JSON::PP;
use LWP::UserAgent;
my $id = '0000000-0000000-0000000-0000000-0000000-0000000-0000000-0000000';
my $resp = LWP::UserAgent->new()->head('http://localhost:8384/');
if ($resp->code == 200) {
$id = $resp->header('X-Syncthing-Id');
}
my %output = (
'id' => $id,
);
print encode_json \%output;