NAME

Ixchel::Actions::sagan_rules - Generate the rules include for Sagan.

VERSION

Version 0.3.0

CLI SYNOPSIS

ixchel -a sagan_rules [--np] [-w] [-i <instance>]

CODE SYNOPSIS

use Data::Dumper;

my $results=$ixchel->action(action=>'sagan_rules', opts=>{np=>1, w=>1, });

print Dumper($results);

DESCRIPTION

Generates the rules include for sagan using the array .sagan.rules and if .sagan.instances_rules.$instance exists, that will be merged into it.

The resulting array is deduplicated using List::Util->uniq.

Any item that does not match /\// or /\$/ has '$RULE_PATH/' prepended to it.

If told to write it out, .sagan.config_base is used as the base directory to write to with the file name being 'sagan-rules.yaml' or in the case of multi instance "sagan-rules-$instance.yaml"

FLAGS

-w

Write out the generated rule files.

-i <instance>

A instance to operate on.

--no_die_at_end

Don't die if there are errors encounted at the end.

RESULT HASH REF

.errors :: A array of errors encountered.
.status_text :: A string description of what was done and teh results.
.ok :: Set to zero if any of the above errored.