You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
894 B
28 lines
894 B
{%- set argv = [ "virt-install", "--noautoconsole", "--name=" ~ libvirt_domain.name] -%}
|
|
{%- for param in libvirt_domain.virt_install -%}
|
|
{%- for param2, values in param.items() -%}
|
|
{%- set prefix = "--" ~ param2 -%}
|
|
{%- if values is string or values is number -%}
|
|
{%- do argv.append(prefix ~ "=" ~ (values)) -%}
|
|
{%- elif values is mapping -%}
|
|
{%- set arglist = [] -%}
|
|
{%- for item in values | dict2items -%}
|
|
{%- set arg = item.key -%}
|
|
{%- set value = item.value -%}
|
|
{%- if value is none -%}
|
|
{%- do arglist.append(arg) -%}
|
|
{%- elif value.__class__.__name__ == 'list' -%}
|
|
{%- for v in value -%}
|
|
{%- do arglist.append(arg ~ "=" ~ v) -%}
|
|
{%- endfor -%}
|
|
{%- else -%}
|
|
{%- do arglist.append(arg ~ "=" ~ value) -%}
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
{%- do argv.append(prefix ~ "=" ~ arglist | join(",")) -%}
|
|
{%- else -%}
|
|
{%- do argv.append(prefix) -%}
|
|
{%- endif -%}
|
|
{%- endfor -%}
|
|
{%- endfor -%}
|
|
{{ argv }}
|