ansible_host set to another variable fails
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- ansible, python
- Ambito
- devops, infrastructure, testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 2.5k
- Fork
- 360
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pytest-testinfra
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
pytest-dev/pytest-testinfra#815 ·
-
service is_enabled does not work with exit code 4Forse già presa @pfuntner l’ha presa 566 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
pytest-dev/pytest-testinfra#801 · 1 commento ·
-
Chroot backendAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
pytest-dev/pytest-testinfra#789 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
pytest-dev/pytest-testinfra#788 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
pytest-dev/pytest-testinfra#786 ·
Tutte le issue di pytest-dev/pytest-testinfra
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
[Bug]: Queen's own Ollama model loses num_ctx when a running session switches to itForse già presa @anasamin26 l’ha presa oggi. Apertabug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
aden-hive/hive#7508 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
llm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BerriAI/litellm#47884 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug 🐛
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
netalertx/NetAlertX#1856 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno