Reputation:
Im trying parted, lvg, lvol and filesystem modules on Ansible.
I have an error with a debug task:
- name: lvm debug
debug:
msg: "{{ ansible_lvm }}"
The error is:
fatal: [nfs_server]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible_lvm' is undefined\n\nThe error appears to be in ...
I thought ansible_lvm
was gathered during facts gathering since I don't have gathering disabled.
My custom ansible.cfg
(put in the playbook folder) is as follow:
[defaults]
host_key_checking= False
callbacks_enabled = profile_tasks
pipelining= True
Thank you
Upvotes: 0
Views: 524
Reputation: 12144
According ansible/lib/ansible/module_utils/facts/hardware/linux.py and Ansible Issue #17393
"if running as root and lvm utils are available"
you need to have high rights like root
or become: true
, as well LVM utils installed, otherwise
"
gather_facts
silently skips lvm facts if lvm pkg not installed"
Similar Q&A
Upvotes: 0