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)