簡體   English   中英

Ansible ec2_fact 文檔

[英]Ansible ec2_fact documentation

我進行了廣泛的搜索,試圖找到一些與 Ansible 的ec2_facts模塊相關的不錯的文檔,特別是與該模塊創建的變量相關的文檔。 但是,我似乎找不到任何東西。 看起來有名為ansible_ec2_instance_idansible_ec2_instance_type變量被創建,但我正在尋找由該模塊生成的所有變量的完整列表。

有沒有辦法用調試模塊打印出ec2_facts存儲的變量?

我試過這個:

- name: Get the ec2 facts of this instance
  debug:
      ec2_facts:

但這會引發語法異常。

查看此文檔並記住所有變量都將使用ansible_ec2_前綴創建。

IE:

instance_id --> ansible_ec2_instance_id

那可能對你有幫助。

- hosts: ec2
  gather_facts: yes
  connection: local
  vars: 
    - region: 'us-west-2'
  tasks:
    - name: Gather EC2 facts
      local_action: ec2_facts
      register: ec2facts

    - debug:
        msg: "{{ ec2facts }}"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM