ansible_host set to another variable fails
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ansible, python
- Lĩnh vực
- devops, infrastructure, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 359
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytest-dev/pytest-testinfra
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
pytest-dev/pytest-testinfra#815 ·
-
service is_enabled does not work with exit code 4Có thể đã có người làm @pfuntner đã nhận 577 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
pytest-dev/pytest-testinfra#801 · 1 bình luận ·
-
Chroot backendĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
pytest-dev/pytest-testinfra#789 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
pytest-dev/pytest-testinfra#788 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
pytest-dev/pytest-testinfra#786 ·
Tất cả issue của pytest-dev/pytest-testinfra
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
btclib-org/btclib-node#2198 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Remove the em dashes from the skill smart-account referenceCó thể đã có người làm @Vamsi-2581 đã nhận hôm nay. Đang mởagent-ready area: docs documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Soneso/stellar-agent-wallet#541 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sususweet/midea_auto_cloud#285 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2026-11 documentation good first issue gsoc-2027 project: gsoc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
alphaonelabs/website#1154 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày