为什么我的逻辑卷没有显示在 ansible_lvm 变量中?
Why is my logical volume not showing in the ansible_lvm variable?
我创建了一个剧本来添加卷组 (vg.services) 和逻辑卷 (lv_new)。这会导致创建指定的 VG 和 LV,如 lsblk 命令所确认:
[root@serverb student]# lsblk
vda
|---vda1
|----vda2
|----vda3
vdb
|--**vg.services-lv_new**
但是当我查询可靠的事实时,我什么也没得到:
ansible serverb -m setup -a "filter=ansible_lvm"
serverb | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false
这里出了什么问题?
根据ansible/lib/ansible/module_utils/facts/hardware/linux.py and Ansible Issue #17393
"if running as root and lvm utils are available"
你需要像root
或become: true
这样的高权限,以及安装LVM utils,否则
"gather_facts
silently skips lvm facts if lvm pkg not installed"
我创建了一个剧本来添加卷组 (vg.services) 和逻辑卷 (lv_new)。这会导致创建指定的 VG 和 LV,如 lsblk 命令所确认:
[root@serverb student]# lsblk
vda
|---vda1
|----vda2
|----vda3
vdb
|--**vg.services-lv_new**
但是当我查询可靠的事实时,我什么也没得到:
ansible serverb -m setup -a "filter=ansible_lvm"
serverb | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false
这里出了什么问题?
根据ansible/lib/ansible/module_utils/facts/hardware/linux.py and Ansible Issue #17393
"if running as root and lvm utils are available"
你需要像root
或become: true
这样的高权限,以及安装LVM utils,否则
"
gather_facts
silently skips lvm facts if lvm pkg not installed"