difference([source_ip]) %} {{ peer_ip }} {% endfor %} Where source ip is the ip address of the server where this is run and peer ip is the secondary ip ...

问题描述 投票:0回答:1
you can use
{% for peer_ip in all_ips.split(',') | difference([source_ip]) %}
    {{ peer_ip }}
    {% endfor %}

template resource

with

embedded-ruby (erb)

其中source ip是运行这个服务的服务器的ip地址,peer ip是同一服务的二级ip。 all_ips包含source和peer的2个ips,用逗号分开。
ansible chef chef-template
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.