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

Unable to pass arguments - python script - shell provisioner- packer -environment variables #10307

Closed
sededg opened this issue Nov 25, 2020 · 4 comments

Comments

@sededg
Copy link

sededg commented Nov 25, 2020

I am trying to pass arguments on python script using shell provisioner, am i missing anything?

packer --version
1.6.4

Packer code:
"provisioners": [
{
"type": "shell-local",
"script": "python.py",
"environment_vars": [
"pyt_name=pytname",
"pyt_arch=64-bit"
],
"execute_command": [
"/bin/bash",
"-c",
"{{.Vars}} /usr/bin/python {{.Script}}"
]
}
Debug log Error:
==> vsphere-clone: usage: python.py [-h] --pyt_name PYT_NAME --pyt_arch PYT_ARCH
==> vsphere-clone: python.py: error: argument --pyt_name is required

@SwampDragons
Copy link
Contributor

It looks like you're setting those variables as environment vars, but the python.py script expects them as arguments rather than env vars.

@tenthirtyam
Copy link
Contributor

Recommend closure.

cc @nywilken

@lbajolet-hashicorp
Copy link
Contributor

Good catch @tenthirtyam, we can indeed close this one since there hasn't been any update for years.

Copy link

github-actions bot commented Jul 4, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants