From c4f9573a635ff511290d9bf175370439f3d6c323 Mon Sep 17 00:00:00 2001 From: Lucy Fu Date: Tue, 10 Sep 2019 10:00:17 -0400 Subject: [PATCH] Need to turn off Ansible runner timeout for automate. Automate has its own timeout. This Ansible runner timeout does not play nice with automate timeout. https://bugzilla.redhat.com/show_bug.cgi?id=1750370 --- app/models/manageiq/providers/ansible_runner_workflow.rb | 2 +- .../automation_manager/configuration_script.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/ansible_runner_workflow.rb b/app/models/manageiq/providers/ansible_runner_workflow.rb index f60747cd7bbb..8667af8b9aa1 100644 --- a/app/models/manageiq/providers/ansible_runner_workflow.rb +++ b/app/models/manageiq/providers/ansible_runner_workflow.rb @@ -55,7 +55,7 @@ def execute def poll_runner response = Ansible::Runner::ResponseAsync.load(context[:ansible_runner_response]) if response.running? - if started_on + options[:timeout] < Time.now.utc + if options[:timeout].present? && started_on + options[:timeout] < Time.now.utc response.stop queue_signal(:abort, "ansible #{execution_type} has been running longer than timeout", "error") diff --git a/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script.rb b/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script.rb index 12fec353a945..5d860bd99fc1 100644 --- a/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script.rb +++ b/app/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script.rb @@ -41,8 +41,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 : nil + 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)