-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Line 20 in 587dfb4
| when: ansible_connection == 'docker' or ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"] |
- name: test facts
hosts: all
gather_facts: false
tasks:
- setup:
- debug: var=ansible_facts.virtualization_type
- name: "Setup rules if container"
when:
- ansible_connection == 'docker' or
ansible_facts.virtualization_type in ["docker", "lxc", "openvz", "podman", "container"]
debug:
msg: "Setup rules if container"Output
$ ansible-playbook -i localhost, -c local test.yml
PLAY [test facts] ******************************************************************************************************************************************************
TASK [setup] ***********************************************************************************************************************************************************
[WARNING]: Platform linux on host localhost is using the discovered Python interpreter at /usr/local/bin/python3.12, but future installation of another Python
interpreter could change the meaning of that path. See https://docs.ansible.com/ansible-core/2.17/reference_appendices/interpreter_discovery.html for more information.
ok: [localhost]
TASK [debug] ***********************************************************************************************************************************************************
ok: [localhost] => {
"ansible_facts.virtualization_type": "VirtualPC"
}
TASK [Setup rules if container] ****************************************************************************************************************************************
skipping: [localhost]
PLAY RECAP *************************************************************************************************************************************************************Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels