i would create a playbook that Check configured filesystems for TSM configuration
I need to echo "${FS_TSM[@]}"
from register: FS_TO_ADD
and to conclude it, a conditional must be set to debug the FS_TSM
[[ ! -z "${FS_TO_ADD}" ]] && { FS_TSM+=( "${FS_TO_ADD}" }
.
I think When: statement1 than statement2
is the good but i don't know how to set it to achieve it
- hosts: all
vars:
whitelist:
- '/bin'
- '/boot'
FS_TSM:
- '/'
tasks:
- set_fact:
mount_point: "{{ansible_facts.mounts | selectattr('fstype', 'match', '^xf+') | map(attribute='mount')}}"
- debug:
var: mount_point
loop: "{{ whitelist }}"
when: item in mount_point
register: FS_TO_ADD
the final result of the playbook is to get this output:
/
/boot
/home
/opt
/var
/var
/opt
/var/tmp
/var/log
/var/log/audit