1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

add a fact gathering check for the default of all

This commit is contained in:
Toshio Kuratomi 2016-03-15 11:58:23 -07:00
parent 86080fbaa9
commit 9a6a5a5516
2 changed files with 25 additions and 8 deletions

View file

@ -5,7 +5,7 @@ testhost2 ansible_ssh_host=127.0.0.1 ansible_connection=local
testhost3 ansible_ssh_host=127.0.0.3
testhost4 ansible_ssh_host=127.0.0.4
# For testing fact gathering
facthost[0:7] ansible_host=1270.0.0.1 ansible_connection=local
facthost[0:8] ansible_host=1270.0.0.1 ansible_connection=local
# the following inline declarations are accompanied

View file

@ -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"