We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_containers()
When running host.podman.get_containers(), podman generates the following command that is run:
host.podman.get_containers()
podman ps --all --format {{.Names}}
The Ansible providers interprets the {{ as the start of a jinja2 template, and thus tries to interpet it, which fails with:
{{
self = <testinfra.backend.ansible.AnsibleBackend object at 0x7f4af339e7d0> command = "podman ps --all --format '{{.Names}}'", args = (), kwargs = {} host = None out = {'msg': "template error while templating string: unexpected '.'. String: podman ps --all --format '{{.Names}}'. unexpected '.'"} def run(self, command, *args, **kwargs): command = self.get_command(command, *args) if not self.force_ansible: host = self.ansible_runner.get_host( self.host, ssh_config=self.ssh_config, ssh_identity_file=self.ssh_identity_file, ) if host is not None: return host.run(command) out = self.run_ansible("shell", module_args=command, check=False) return self.result( > out["rc"], command, stdout_bytes=None, stderr_bytes=None, stdout=out["stdout"], stderr=out["stderr"], ) E KeyError: 'rc'
In the meantime, host.run("podman ps --all --format '{{ '{{' }}.Names{{ '}}' }}'") works, but is a bit more manual.
host.run("podman ps --all --format '{{ '{{' }}.Names{{ '}}' }}'")
I would be happy to provide a fix, but I am unsure how best to do this, given that in other cases, interpolation is what is wanted
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When running
host.podman.get_containers()
, podman generates the following command that is run:The Ansible providers interprets the
{{
as the start of a jinja2 template, and thus tries to interpet it, which fails with:In the meantime,
host.run("podman ps --all --format '{{ '{{' }}.Names{{ '}}' }}'")
works, but is a bit more manual.I would be happy to provide a fix, but I am unsure how best to do this, given that in other cases, interpolation is what is wanted
The text was updated successfully, but these errors were encountered: