Skip to content

Path warning when running ansible-lint

When running the latest pipelinecomponents/ansible-lint Docker image from Docker Hub (5355995745a9 at the time of this writing), the following warning message is printed by ansible-lint:

WARNING: PATH altered to include /app/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.

This check of path seems quite specific, as the directory /app/bin is already in the path. However the Dockerfile adds this path with a trailing slash.

$ docker run --rm -it pipelinecomponents/ansible-lint:latest sh -c 'echo $PATH'
/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app/bin/

The following commands can be used to reproduce and work-around the issue.

$ docker run --rm -it pipelinecomponents/ansible-lint:latest sh

/code # ansible-lint --version
WARNING: PATH altered to include /app/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.
ansible-lint 24.5.0 using ansible-core:2.16.7 ansible-compat:24.6.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8

///
/// Remove the slash to remove the warning
///
/code # export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app/bi
n"

/code # ansible-lint --version
ansible-lint 24.5.0 using ansible-core:2.16.7 ansible-compat:24.6.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8