Allow elastic-recheck-uncategorized custom options

Allow custom command line options for the elastic-recheck-uncategorized,
graph_all_cmd, and graph_gate_cmd.

This can include other current or future options e.g. --db_uri --es_url.

Remove these commands from init.pp since they are only used by the cron.pp
class (since Ibf5dad1071f65f8d676e8b9a0ec4331bada9943f).

Change-Id: I4588ea4e40ae643070f8da4954cca984ec6a3d96
This commit is contained in:
Ramy Asselin 2015-10-15 17:50:28 +00:00
parent f8b1c57f9a
commit 1d93e6581d
2 changed files with 9 additions and 14 deletions

View File

@ -17,11 +17,15 @@
# service.
#
class elastic_recheck::cron () {
$er_state_path = $::elastic_recheck::recheck_state_dir
$graph_all_cmd = $::elastic_recheck::graph_all_cmd
$graph_gate_cmd = $::elastic_recheck::graph_gate_cmd
$uncat_cmd = $::elastic_recheck::uncat_cmd
class elastic_recheck::cron (
$uncat_cmd_options = undef,
$graph_all_cmd_options = undef,
$graph_gate_cmd_options = undef,
) {
$er_state_path = '/var/lib/elastic-recheck'
$graph_all_cmd = "elastic-recheck-graph /opt/elastic-recheck/queries -o all-new.json ${graph_all_cmd_options} && mv all-new.json all.json"
$graph_gate_cmd = "elastic-recheck-graph /opt/elastic-recheck/queries -o gate-new.json -q gate ${graph_gate_cmd_options} && mv gate-new.json gate.json"
$uncat_cmd = "elastic-recheck-uncategorized -d /opt/elastic-recheck/queries -t /usr/local/share/elastic-recheck/templates -o uncategorized-new.html ${uncat_cmd_options} && mv uncategorized-new.html uncategorized.html"
cron { 'elastic-recheck-all':
user => 'recheck',

View File

@ -20,15 +20,6 @@ class elastic_recheck (
$revision = 'master',
) {
# For all static page generation scripts we want to run them
# both on a cron schedule (see elastic_recheck::cron) and on
# any commit. So we need to define commands in a way that
# we can trigger an exec here, as well as on cron.
$recheck_state_dir = '/var/lib/elastic-recheck'
$graph_all_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o all-new.json && mv all-new.json all.json'
$graph_gate_cmd = 'elastic-recheck-graph /opt/elastic-recheck/queries -o gate-new.json -q gate && mv gate-new.json gate.json'
$uncat_cmd = 'elastic-recheck-uncategorized -d /opt/elastic-recheck/queries -t /usr/local/share/elastic-recheck/templates -o uncategorized-new.html && mv uncategorized-new.html uncategorized.html'
group { 'recheck':
ensure => 'present',
}