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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -