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 -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -