Files
infra-automation/roles/system_info/tasks
ansible 8df343182f Fix Jinja2 template conflicts in Docker and Podman detection
Escape Go template syntax in shell commands to prevent Ansible from
interpreting them as Jinja2 templates.

Errors fixed:
  template error while templating string: unexpected '.'
  String: docker version --format '{{.Server.Version}}'
  String: docker images --format "{{.Repository}}:{{.Tag}}"
  String: podman version --format '{{.Version}}'

Changes:
- Docker version check: Escape {{.Server.Version}}
- Docker images list: Escape {{.Repository}} and {{.Tag}}
- Podman version check: Escape {{.Version}}

Solution:
  Convert {{ to {{ "{{" }} and }} to {{ "}}" }}
  This tells Ansible to output literal {{ }} in the shell command
  The Docker/Podman CLI then interprets the Go templates correctly

Example:
  Before: '{{.Server.Version}}'
  After:  '{{ "{{" }}.Server.Version{{ "}}" }}'
  Result: Shell receives '{{.Server.Version}}' as intended

Testing: Playbook now completes successfully without template errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 01:52:22 +01:00
..