From 457e95863f2d25516029d44d017d55be0dc4b95e Mon Sep 17 00:00:00 2001 From: Fabien Dupont Date: Sat, 28 Jul 2018 18:07:30 -0400 Subject: [PATCH 1/2] Allow running playbook against powered off VM --- .../Ansible.class/__methods__/launchplaybookasaservice.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb b/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb index 41a59b733..a0dff5ae2 100644 --- a/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb +++ b/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb @@ -26,7 +26,7 @@ def main service_template = task.send("#{transformation_hook}_ansible_playbook_service_template") return if service_template.nil? target_host = target_host(task, transformation_hook) - return if target_host.nil? || target_host.power_state != 'on' + return if target_host.nil? service_dialog_options = { :hosts => target_host.ipaddresses.first } service_request = @handle.execute(:create_service_provision_request, service_template, service_dialog_options) task.set_option("#{transformation_hook}_ansible_playbook_service_request_id".to_sym, service_request.id) From bf019e1735ae2209918a286649e3541c1e07858a Mon Sep 17 00:00:00 2001 From: Fabien Dupont Date: Sun, 29 Jul 2018 10:58:49 -0400 Subject: [PATCH 2/2] Change test from `.nil?` to `.blank?` --- .../Ansible.class/__methods__/launchplaybookasaservice.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb b/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb index a0dff5ae2..05a125f21 100644 --- a/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb +++ b/content/automate/ManageIQ/Transformation/Ansible.class/__methods__/launchplaybookasaservice.rb @@ -26,7 +26,7 @@ def main service_template = task.send("#{transformation_hook}_ansible_playbook_service_template") return if service_template.nil? target_host = target_host(task, transformation_hook) - return if target_host.nil? + return if target_host.blank? service_dialog_options = { :hosts => target_host.ipaddresses.first } service_request = @handle.execute(:create_service_provision_request, service_template, service_dialog_options) task.set_option("#{transformation_hook}_ansible_playbook_service_request_id".to_sym, service_request.id)