ansible_host set to another variable fails
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- ansible, python
- Área
- devops, infrastructure, testing-qa
Línea de trabajo
Reproduce the failure with the shown host_vars/my_host.yml configuration, Python 3.8.6, pytest 6.2.4, testinfra 6.4.0, and Ansible 4.1.0. Start at the Ansible connection backend and determine whether ansible_host is expected to resolve this variable reference; done means either supporting the interpolation with coverage or documenting the confirmed limitation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Trying to use ansible connection backend, it seems to fail when
ansible_host variable is set to another variable, like so inventories/host_vars/my_host.yml
---
network_interfaces:
- name: ens3
address: 10.254.14.18
netmask: 255.255.255.0
gateway: 10.254.14.1
ansible_host: "{{ network_interfaces[0]['address'] }}"
when running testinfra this results in:
E RuntimeError: CommandResult(command=b"sudo /bin/sh -c 'getent ahosts mail.example.com'", exit_status=255, stdout=None, stderr=b"ssh: Could not resolve hostname {{ network_interfaces[0]['address'] }}: Name or service not known\r\n")
A workaround is changing the host inventory file like so, but this is
not ideal:
---
network_interfaces:
- name: ens3
address: 10.254.14.18
netmask: 255.255.255.0
gateway: 10.254.14.1
ansible_host: 10.254.14.18
Is this a limitation in testinfra, or am I doing something wrong?
versions using:
Python 3.8.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
plugins: testinfra-6.4.0
ansible == 4.1.0
- Lenguaje dominante
- Python
- Estrellas
- 2.5k
- Forks
- 360
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytest-dev/pytest-testinfra
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 58/100
pytest-dev/pytest-testinfra#815 ·
-
service is_enabled does not work with exit code 4Posiblemente ocupada @pfuntner la tomó hace 553 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
pytest-dev/pytest-testinfra#801 · 1 comentario ·
-
Chroot backendAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
pytest-dev/pytest-testinfra#789 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
pytest-dev/pytest-testinfra#788 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
pytest-dev/pytest-testinfra#786 ·
Todos los issues de pytest-dev/pytest-testinfra
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Deepak3699/Ai_Mentor#244 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
btclib-org/btclib-node#1880 ·
Los mantenedores suelen responder en 1 día
-
CONTRIBUTING.md: say how ticketless bug fixes and feature PRs are handledPosiblemente ocupada @khuisman la tomó hoy. Abiertov0.9.2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
khuisman/mcp-gee-sweet#941 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pyjanitor-devs/pyjanitor#1758 ·
Los mantenedores suelen responder en 1 día
-
bug ready for review
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
odysseus-dev/odysseus#6641 ·
Los mantenedores suelen responder en 1 día