|
|
|
@ -1,6 +1,23 @@
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
- hosts: facthost0
|
|
|
|
|
tags: [ 'fact_min' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "all"
|
|
|
|
|
gather_facts: yes
|
|
|
|
|
tasks:
|
|
|
|
|
- setup:
|
|
|
|
|
register: facts
|
|
|
|
|
- debug: var=facts
|
|
|
|
|
- name: Test that only retrieving minimal facts work
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- '"{{ ansible_user_id|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
- '"{{ ansible_interfaces|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost1
|
|
|
|
|
tags: [ 'fact_min' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "!all"
|
|
|
|
@ -14,7 +31,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost1
|
|
|
|
|
- hosts: facthost2
|
|
|
|
|
tags: [ 'fact_network' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "network"
|
|
|
|
@ -28,7 +45,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost2
|
|
|
|
|
- hosts: facthost3
|
|
|
|
|
tags: [ 'fact_hardware' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "hardware"
|
|
|
|
@ -42,7 +59,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost3
|
|
|
|
|
- hosts: facthost4
|
|
|
|
|
tags: [ 'fact_virtual' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "virtual"
|
|
|
|
@ -56,7 +73,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost4
|
|
|
|
|
- hosts: facthost5
|
|
|
|
|
tags: [ 'fact_comma_string' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "virtual,network"
|
|
|
|
@ -70,7 +87,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost5
|
|
|
|
|
- hosts: facthost6
|
|
|
|
|
tags: [ 'fact_yaml_list' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset:
|
|
|
|
@ -86,7 +103,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost6
|
|
|
|
|
- hosts: facthost7
|
|
|
|
|
tags: [ 'fact_negation' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "!hardware"
|
|
|
|
@ -100,7 +117,7 @@
|
|
|
|
|
- '"{{ ansible_mounts|default("UNDEF") }}" == "UNDEF"'
|
|
|
|
|
- '"{{ ansible_virtualization_role|default("UNDEF") }}" != "UNDEF"'
|
|
|
|
|
|
|
|
|
|
- hosts: facthost7
|
|
|
|
|
- hosts: facthost8
|
|
|
|
|
tags: [ 'fact_mixed_negation_addition' ]
|
|
|
|
|
connection: local
|
|
|
|
|
gather_subset: "!hardware,network"
|
|
|
|
|