Pass JSON to host_dns_check, fix issue with curl of harvester
Change-Id: I5b4dc9870e9c64f5a6ed77db787b6da096689ab6
diff --git a/roles/create-vms/library/host_dns_check.py b/roles/create-vms/library/host_dns_check.py
index 20413ab..cbd39ae 100755
--- a/roles/create-vms/library/host_dns_check.py
+++ b/roles/create-vms/library/host_dns_check.py
@@ -65,7 +65,7 @@
result["command_on_fail"] = {}
result["command_on_fail"]["command"] = command_on_fail
try:
- cmd_out = subprocess.check_output(shlex.split(command_on_fail), shell=True, stderr=subprocess.STDOUT)
+ cmd_out = subprocess.check_output(shlex.split(command_on_fail), stderr=subprocess.STDOUT)
result["command_on_fail"]["retcode"] = 0
result["command_on_fail"]["out"] = cmd_out
except subprocess.CalledProcessError as e:
diff --git a/roles/create-vms/tasks/main.yml b/roles/create-vms/tasks/main.yml
index 77244f0..8c1acb6 100644
--- a/roles/create-vms/tasks/main.yml
+++ b/roles/create-vms/tasks/main.yml
@@ -30,7 +30,7 @@
- name: wait for VM name resolution
when: on_maas
host_dns_check:
- hosts: "{{ head_vm_list | map(attribute='name') | list }}"
+ hosts: "{{ head_vm_list | map(attribute='name') | list | to_json }}"
command_on_fail: "curl -sS --connect-timeout 3 -XPOST http://{{ harvester_ip.stdout }}:8954/harvest"
register: all_resolved
until: all_resolved.everyone == "OK"