"examples": add perl script regression tests.

pull/193/head
David Wilson 7 years ago
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)]
});

@ -4,6 +4,8 @@
- import_playbook: runner__custom_binary_producing_json.yml - import_playbook: runner__custom_binary_producing_json.yml
- import_playbook: runner__custom_binary_producing_junk.yml - import_playbook: runner__custom_binary_producing_junk.yml
- import_playbook: runner__custom_binary_single_null.yml - import_playbook: runner__custom_binary_single_null.yml
- import_playbook: runner__custom_perl_json_args_module.yml
- import_playbook: runner__custom_perl_want_json_module.yml
- import_playbook: runner__custom_python_json_args_module.yml - import_playbook: runner__custom_python_json_args_module.yml
- import_playbook: runner__custom_python_new_style_module.yml - import_playbook: runner__custom_python_new_style_module.yml
- import_playbook: runner__custom_python_want_json_module.yml - import_playbook: runner__custom_python_want_json_module.yml

@ -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…
Cancel
Save