The value will not be random. Value will be generated from static server data, and will be in some range using python function.
For range [0..2]:
( N % 3 )
The value will not be random. Value will be generated from static server data, and will be in some range using python function.
For range [0..2]:
( N % 3 )
Creation of file from pillar simple list with Jinja template will be create empty line, in top or bottom of file, dependence for template syntax.
You can not create file without empty lines.
#!/usr/bin/python from jinja2 import Template d = {'testlist':['item1','item2','item3']} tmpl = '''{%- for item in testlist %} {{ item }} {%- endfor %}''' t = Template(tmpl) print( t.render( d ) )
{host-id}[.dev].{dc-id}.{domain}
h01.kyiv01.domain.com h01.lon1.domain.com vs02.lon2.domain.com vs02.dev.lon1.domain.com h01.ny01.domain.com