Closed Nosmoht closed 2 years ago
I can reproduce this with stable-2.4
[newswoop:F25:ansible (stable-2.4 % u=)]$ ansible localhost -m setup -a 'gather_subset=!facter' | grep mount
[newswoop:F25:ansible (stable-2.4 % u=)]$ ansible localhost -m setup | grep mounts
"ansible_mounts": [
works in stable-2.3:
[newswoop:F25:ansible (stable-2.3 % u=)]$ ansible localhost -m setup | grep mounts
"ansible_mounts": [
[newswoop:F25:ansible (stable-2.3 % u=)]$ ansible localhost -m setup -a 'gather_subset=!facter' | grep mounts
"ansible_mounts": [
Just realized that also ansible_product_name is not defined if Factor facts are excluded
Next one: ansible_default_ipv4 not available
cc @david_obrien click here for bot help
I can also reproduce when excluding ohai facts.
This was broken by https://github.com/ansible/ansible/commit/27a015f0ad79a33af2d7ed4d39635ca8f7c02fd8. Previously, gather_subset = !ohai,!facter
implied gather_subset = all,!ohai,!facter
(which works on Ansible 2.4.x!), but that commit changed it to imply gather_subset = min,!ohai,!facter
@rouge8 so the issue here is that all
is the default, but once you add !facter
it does not include all
, only min
is implied. So =!facter
is the same as =min,!facter
not =all,!facter
as you expected.
i'm not sure this is wrong but we might want to be clearer in docs about how this works.
cc @davidobrien1985 click here for bot help
This was arguably a regression when the fact gathering code was reorganized, but it's been working this way for so long that changing it back now would probably cause more problems than it solves. Closing for "as-designed"-ish. ;)
ISSUE TYPE
COMPONENT NAME
setup
ANSIBLE VERSION
CONFIGURATION
DEFAULT_GATHER_SUBSET(/home/tkrahn/workspace/ansible/ansible.cfg) = !facter
OS / ENVIRONMENT
SUMMARY
If facter facts are not gathered fact _ansiblemounts does not exist.
STEPS TO REPRODUCE
EXPECTED RESULTS
Fact _ansiblemounts is provided
ACTUAL RESULTS
Fact _ansiblemounts is not provided.
I might be wrong but as far as i remember facter facts are always prefixed with facter