ansible打印ec2_tag寄存器列表 [英] ansible print ec2_tag register list

查看:55
本文介绍了ansible打印ec2_tag寄存器列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个简单的任务,我得到ec2实例tgs我喜欢打印出返回值列表.

i have this simple task which i get ec2 instance tgs i like to print out the return list of values .

- name: get my tagging
  local_action:
    module: ec2_tag
    region: "{{ region }}"
    resource: "{{ instance_id }}"
    state: list
  register: my_ec2_tags
  tags:
    - spots

这不会给我带来任何价值

this don't print me any value

- name: Display all ec2_tags
  debug:
    var: my_ec2_tags
    verbosity: 3

我如何打印my_ec2_tags的所有值,以便知道设置是否正确?

how can i print all the values of my_ec2_tags so i could know if it was set right ?

推荐答案

似乎在运行播放时正在使用标签.在这种情况下,您还应该标记调试任务.

Seems you are using tags while running the play. In that case, you should tag your debug task as well.

例如:

- name: Display all ec2_tags
  debug:
    var: my_ec2_tags.tags
  tags:
    - spots

这篇关于ansible打印ec2_tag寄存器列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆