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
Post a Comment