我有这个:
# grab the internal ip [eg 10.5.20.2]
- name: Grab the internal ip to setup the sec group rule
local_action: shell /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1 # returns the ip
register: internal_ip # save the output of the above command in a var
- debug: var=internal_ip.stdout
我想将AWS安全组的入站规则中的此IP设置为单个主机IP。
像这样:10.5.20.2/32
如何将internal_ip
已注册的var与字符串/32
连接起来?
答案 0 :(得分:4)
我划伤并流血但发现它......:]
"{{ internal_ip.stdout }}/32"