community.general.cloud_init_data_facts module – Retrieve facts of cloud-init
Note
This module is part of the community.general collection (version 12.6.1).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.cloud_init_data_facts.
Synopsis
Gathers facts by reading the
status.jsonandresult.jsonof cloud-init.
Parameters
Parameter |
Comments |
|---|---|
Filter facts. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Returns details on what has changed (or possibly needs changing in |
|
Support: full |
Action returns an |
Notes
Note
See http://cloudinit.readthedocs.io/ for more information about cloud-init.
Examples
- name: Gather all facts of cloud init
community.general.cloud_init_data_facts:
register: result
- ansible.builtin.debug:
var: result
- name: Wait for cloud init to finish
community.general.cloud_init_data_facts:
filter: status
register: res
until: "res.cloud_init_data_facts.status.v1.stage is defined and not res.cloud_init_data_facts.status.v1.stage"
retries: 50
delay: 5
Returned Facts
Facts returned by this module are added/updated in the hostvars host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
Key |
Description |
|---|---|
Facts of result and status. Returned: success Sample: |