"examples": add perl script regression tests.
parent
20044ba956
commit
e2542c1683
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
binmode STDOUT, ":utf8";
|
||||
use utf8;
|
||||
|
||||
use JSON;
|
||||
|
||||
my $json_args = <<'END_MESSAGE';
|
||||
<<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>
|
||||
END_MESSAGE
|
||||
|
||||
print encode_json({
|
||||
message => "I am a perl script! Here is my input.",
|
||||
input => [decode_json($json_args)]
|
||||
});
|
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
binmode STDOUT, ":utf8";
|
||||
use utf8;
|
||||
|
||||
my $WANT_JSON = 1;
|
||||
|
||||
use JSON;
|
||||
|
||||
my $json;
|
||||
{
|
||||
local $/; #Enable 'slurp' mode
|
||||
open my $fh, "<", $ARGV[0];
|
||||
$json_args = <$fh>;
|
||||
close $fh;
|
||||
}
|
||||
|
||||
print encode_json({
|
||||
message => "I am a want JSON perl script! Here is my input.",
|
||||
input => [decode_json($json_args)]
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- custom_perl_json_args_module:
|
||||
foo: true
|
||||
with_sequence: start=1 end={{end|default(100)}}
|
@ -0,0 +1,5 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- custom_perl_want_json_module:
|
||||
foo: true
|
||||
with_sequence: start=1 end={{end|default(100)}}
|
Loading…
Reference in New Issue