vscode-ansible icon indicating copy to clipboard operation
vscode-ansible copied to clipboard

ansible extension doesn't recognize podman installed on the system

Open mrniranjan opened this issue 1 year ago • 5 comments

Summary

i enabled "*Execution Environment" , *and selected podman, it throws an error 'Error: Command failed: command -v podman', But infact

i have podman installed and available in default PATH. (/usr/bin/podman)

Extension version

v2.3.7

VS Code version

Version: 1.78.

Ansible Version

ansible [core 2.13.8]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/mniranja/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mniranja/venv38/lib/python3.8/site-packages/ansible
  ansible collection location = /home/mniranja/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mniranja/venv38/bin/ansible
  python version = 3.8.16 (default, Dec 21 2022, 10:58:32) [GCC 8.5.0 20210514 (Red Hat 8.5.0-17)]
  jinja version = 3.1.2
  libyaml = True

OS / Environment

RHEL 8.8

Relevant log output

No response

mrniranjan avatar Jun 13 '23 08:06 mrniranjan

Send us the output of command -v podman, also the output of echo $PATH. Please run the above commands from vscode terminal.

audgirka avatar Jun 14 '23 12:06 audgirka

From my Bash terminal

(venv) [mniranja@mniranja ~]$ command -v podman
/usr/bin/podman
(venv) [mniranja@mniranja ~]$ echo $PATH
/home/mniranja/venv/bin:/home/mniranja/.local/bin:/home/mniranja/bin:/home/mniranja/.local/bin:/home/mniranja/bin:/home/mniranja/.local/bin:/home/mniranja/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/mniranja/go/bin:/home/mniranja/go/bin:/home/mniranja/go/bin
(venv) [mniranja@mniranja ~]$ 

From vscode terminal

sh-5.1$ echo $PATH
/app/bin:/app/bin:/app/bin:/usr/bin:/home/mniranja/.var/app/com.visualstudio.code/data/node_modules/bin
[476 preload-host-spawn-strategy] Warning: waitpid override ignores groups
sh-5.1$ echo $PATH
/app/bin:/app/bin:/app/bin:/usr/bin:/home/mniranja/.var/app/com.visualstudio.code/data/node_modules/bin
sh-5.1$ command -v podman
sh-5.1$ 

mrniranjan avatar Jun 14 '23 13:06 mrniranjan

I have to mention here that vscode was installed using flathub repository

mrniranjan avatar Jun 14 '23 13:06 mrniranjan

@mrniranjan The /usr/bin in flatpak is coming from the runtime. The host one is accessible via /run/host/usr/bin, however the proper way to invoke commands from the host is using flatpak-spawn --host from within the flatpak sandbox.

Folks, is there a way to change the command the plugin uses to invoke podman so I can configure it properly for the sandboxed environment?

MarSik avatar Sep 20 '23 05:09 MarSik

On that point, I'm trying to figure out how to use this in Silverblue. The flatpak version of vscode includes the command /app/tools/podman/bin/podman-remote, which I can't execute from the ansible extension.

ptoal avatar Nov 14 '23 20:11 ptoal