Skip to content
New issue

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

[Bug]: Ansible feature always installs the latest version #43

Closed
koralowiec opened this issue Sep 28, 2024 · 1 comment · Fixed by #44
Closed

[Bug]: Ansible feature always installs the latest version #43

koralowiec opened this issue Sep 28, 2024 · 1 comment · Fixed by #44
Assignees
Labels
bug Something isn't working

Comments

@koralowiec
Copy link
Member

Feature id and version

ghcr.io/devcontainers-extra/features/ansible:2.0.17

Devcontainer base Image

mcr.microsoft.com/devcontainers/base:bookworm

What happened?

Ansible feature doesn't install ansible-core in the specified version

devcontainer.json:

{
	"name": "Debian",
	"image": "mcr.microsoft.com/devcontainers/base:bookworm",
	"features": {
		"ghcr.io/devcontainers-extra/features/ansible:2.0.17": {
			"version": "2.16.11"
		}
	}
}

image

test_version_selection scenario doesn't catch it when the tests are run - The following check doesn't fail even though the version is not matched:

check "ansible --version | grep 'core 2.13.0'" ansible --version | grep 'core 2.13.0'

It fails when I change it to this:

check "ansible --version | grep 'core 2.13.0'" bash -c "ansible --version | grep 'core 2.13.0'"

Relevant log output

No response

@koralowiec koralowiec added the bug Something isn't working label Sep 28, 2024
@koralowiec koralowiec self-assigned this Sep 28, 2024
@koralowiec
Copy link
Member Author

check "ansible --version | grep 'core 2.13.0'" ansible --version | grep 'core 2.13.0'

The "false positive" caused by the fact that the output of check function is piped to the grep 'core 2.13.0'. And the output contains the "label" that is passed as the 1st argument ("ansible --version | grep 'core 2.13.0'").
As the result the grep is always successful - core 2.13.0 is always present in the check's output

@koralowiec koralowiec linked a pull request Sep 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant