Skip to content

Commit

Permalink
Merge pull request #19279 from lfu/ansible_runner_timeout_1750370
Browse files Browse the repository at this point in the history
Set default playbook service timeout to 100 minutes
  • Loading branch information
Fryguy authored Sep 11, 2019
2 parents 97613cf + 861cc99 commit e1e730f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript < ManageIQ::Providers::EmbeddedAutomationManager::ConfigurationScript
FRIENDLY_NAME = "Embedded Ansible Job Template".freeze
DEFAULT_EXECUTION_TTL = 100.minutes # automate state machine aborts after 100 retries at a minite interval

include ManageIQ::Providers::EmbeddedAnsible::CrudCommon

Expand Down Expand Up @@ -41,8 +42,8 @@ def run(vars = {})
credentials = collect_credentials(vars)

kwargs = {:become_enabled => vars[:become_enabled]}
kwargs[:timeout] = vars[:execution_ttl].to_i.minutes if vars[:execution_ttl].present?
kwargs[:verbosity] = vars[:verbosity].to_i if vars[:verbosity].present?
kwargs[:timeout] = vars[:execution_ttl].present? ? vars[:execution_ttl].to_i.minutes : DEFAULT_EXECUTION_TTL
kwargs[:verbosity] = vars[:verbosity].to_i if vars[:verbosity].present?

workflow.create_job({}, extra_vars, playbook_vars, vars[:hosts], credentials, kwargs).tap do |job|
job.signal(:start)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::PlaybookRunner < ::Job
DEFAULT_EXECUTION_TTL = 10 # minutes
DEFAULT_EXECUTION_TTL = 100 # minutes

# options are job table columns, including options column which is the playbook context info
def self.create_job(options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
expect(job.options[:extra_vars]).to eq(:instance_ids => ["i-3434"])
expect(job.options[:configuration_script_source_id]).to eq(ansible_script_source.id)
expect(job.options[:playbook_relative_path]).to eq(playbook.name)
expect(job.options[:timeout]).to eq(1.hour)
expect(job.options[:timeout]).to eq(100.minutes)
expect(job.options[:verbosity]).to eq(0)
end

Expand Down

0 comments on commit e1e730f

Please sign in to comment.