ansible - j2 template to variable -


i have list of ec2 servers launched ec2 module.

how can create following string future command, , dump terminal?

-hosts=private_ip1:private_ip2:private_ipn 

i have j2 template creates string, cannot find way register output variable.

as i'm using localhost host group, solved using set_fact , j2 loop directly in value:

- name: set fact   set_fact:     render_host_command: "-myarg={% item in aws_instances %}{{ item.private_ip }}{%- if not loop.last %}:{% endif -%}{% endfor %}" 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -