bifrost/playbooks
Markos Chandras a40dfaf9c3 roles: bifrost-create-vm-nodes: Improve host matching when deleting from vbmc
Assuming that 'vm_name' is 'foobar' then 'vm_name in vbmc_list.stdout'
will also match when there is a foobar[a-zA-Z0-9]* host registered so
there is a chance for the task to try and delete non-existing hosts
as obsereved below:

fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ["vbmc",
"delete", "jumphost"], "delta": "0:00:00.343033", "end": "2017-03-20
02:10:19.759738", "failed": true, "invocation": {"module_args":
{"_raw_params": "vbmc delete jumphost", "_uses_shell": false, "chdir":
null, "creates": null, "executable": null, "removes": null, "warn":
true}, "module_name": "command"}, "rc": 1, "start": "2017-03-20
02:10:19.416705", "stderr": "No domain with matching name jumphost was
found", "stdout": "", "stdout_lines": [], "warnings": []}

That happens because a 'jumphost.opnfvlocal' is registered in vbmc
but the 'vm_name' for this run is just 'jumphost'.

We fix this by using the 'find' method and looking for '{{vm_name}} '
instead.

Change-Id: I1675a978489bfd0633eabb30e2227ed7cb70c7ef
2017-03-20 10:11:17 +00:00
..
2017-03-16 10:49:43 +02:00
2017-03-16 10:49:43 +02:00