Skip to content

Commit

Permalink
Remove unused option for packer wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Jun 16, 2023
1 parent 177fad6 commit 0973037
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This directory contains a python script named `packer` which wraps the system `p

### Running `packer`

To run the wrapper pass the environment, playbook, and any vars ansible is expecting:
To run the wrapper pass the environment and playbook:

```bash
$ ./packer staging docs-rs-builder --var "revision=SOME_REVISION5
$ ./packer staging docs-rs-build
```
7 changes: 1 addition & 6 deletions packer/packer
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,10 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("env")
parser.add_argument("playbook")
parser.add_argument('--var', action='append', help='Ansible variables as $key=$value', default=[])
args = parser.parse_args()

workspace = create_workspace(args.env, args.playbook)
# Call packer with the right arguments from the workspace
vars = []
for var in args.var:
vars += ["-var", var]
cmd = ["packer", "build", *vars, "template"]
cmd = ["packer", "build", "template"]
res = subprocess.run(cmd, cwd=str(workspace))
if res.returncode != 0:
exit(1)

0 comments on commit 0973037

Please sign in to comment.