Skip to content

Commit

Permalink
Propogate execution_ttl to job timeout
Browse files Browse the repository at this point in the history
Previously this option was being ignored and the job timeout
was always the default of 1.hour
  • Loading branch information
carbonin committed Jul 16, 2019
1 parent e007e48 commit 121cdb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def run(vars = {})
playbook_vars = { :playbook_path => parent.path }
credentials = collect_credentials(vars)

workflow.create_job({}, extra_vars, playbook_vars, vars[:hosts], credentials).tap do |job|
kwargs = {}
kwargs[:timeout] = vars[:execution_ttl].to_i.minutes if vars[:execution_ttl].present?

workflow.create_job({}, extra_vars, playbook_vars, vars[:hosts], credentials, kwargs).tap do |job|
job.signal(:start)
end
end
Expand Down
1 change: 1 addition & 0 deletions app/models/service_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get_job_options(action)
CONFIG_OPTIONS_WHITELIST = %i[
cloud_credential_id
credential_id
execution_ttl
extra_vars
hosts
network_credential_id
Expand Down

0 comments on commit 121cdb9

Please sign in to comment.