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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -