You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ansible is currently using the wrong python3 executable when run via Packer. This is because there is a system Python3 executable location at /usr/bin/python3, and Ansible is using that instead of the executable located at (currently) /opt/hostedtoolcache/Python/3.9.0/x64/bin/python3. This latter executable is the one identified by which python3, but Ansible has its own method of determining which Python executable to use.
In many cases this does not matter, but in some cases (e.g. cisagov/kali-packer and cisagov/teamserver-packer) we install pip packages such as boto3 because they must be available on the Ansible host in order to pull SSM ParameterStore keys or objects stored in S3 from AWS. These packages are installed under the /opt/hostedtoolcache Python and are likely not available with the system Python.
When Ansible runs it will look for /usr/bin/python3 and use it if it
finds it. Therefore we need /usr/bin/python3 to point to the desired
python when packer runs.
This change will hose other tasks that expect to find the system
python at /usr/bin/python3, though, so we undo the change after
running packer.
Resolves#56.
🐛 Bug Report
Ansible is currently using the wrong
python3
executable when run via Packer. This is because there is a system Python3 executable location at/usr/bin/python3
, and Ansible is using that instead of the executable located at (currently)/opt/hostedtoolcache/Python/3.9.0/x64/bin/python3
. This latter executable is the one identified bywhich python3
, but Ansible has its own method of determining which Python executable to use.In many cases this does not matter, but in some cases (e.g. cisagov/kali-packer and cisagov/teamserver-packer) we install
pip
packages such asboto3
because they must be available on the Ansible host in order to pull SSM ParameterStore keys or objects stored in S3 from AWS. These packages are installed under the/opt/hostedtoolcache
Python and are likely not available with the system Python.To Reproduce
Steps to reproduce the behavior:
/usr/bin/python3
does not have theboto3
module available.The text was updated successfully, but these errors were encountered: