Imported from personal ansible repository
This commit is contained in:
parent
17afba8c33
commit
23e2941b3a
8 changed files with 448 additions and 0 deletions
23
files/syncthing.fact
Normal file
23
files/syncthing.fact
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/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;
|
Reference in a new issue