I have a python script that runs "vgs" command to check the free space in the volume groups available and then creates lvm , using lvcreate command.
When I run this python script locally, I can run it without issues and the lvm gets created as well. But if I run it using Ansible playbook, I've tried with both 'command' and 'shell' modules, it is unable to locate the path for vgs
command and fails. It seems it is only looking for /usr/bin:/bin
paths. Please help.
which: no vgs in (/usr/bin:/bin)", "No Volume Groups Found", "Space Found in Volume Group:"], "warnings": []}
"stderr": "sh: -c: line 0: syntax error near unexpected token `('\nsh: -c: line 0: `{ which: no vgs in (/usr/bin:/bin) -o VG_NAME --noheadings --units m ; } 2>&1'