Improve NFS detection

Detect if NFS is present by looking into the available mounts from
ansible facts.

Change-Id: I0e2d90d9e706ad4f6527484d96757b8578cb61bb
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-07-10 00:12:10 -05:00
parent 316f527243
commit 3a3430976f
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3

@ -439,7 +439,7 @@ packetbeat.protocols:
- type: nfs
# Enable NFS monitoring. Default: true
{% set ns = namespace(enabled=((inventory_hostname in groups['glance_all'] | default([])) or (inventory_hostname in groups['nova_compute'] | default([])))) %}
{% set ns = namespace(enabled=((inventory_hostname in groups['glance_all'] | default([])) or (inventory_hostname in groups['nova_compute'] | default([])) or 'nfs4' in (ansible_mounts | map(attribute='fstype') | list))) %}
{% if not ns.enabled | bool %}
{% for _item in groups['glance_all'] | default([]) + groups['nova_compute'] | default([]) %}
{% if not ns.enabled | bool or _item in groups[inventory_hostname + '-host_containers'] | default([]) %}