Skip to content

Commit

Permalink
Ansible changes
Browse files Browse the repository at this point in the history
- Inject environment variables through list instead of using a script.
- Already in the .venv context from the makefile, so don't need to activate it again.
  • Loading branch information
JosBritton committed Oct 8, 2023
1 parent e325841 commit d5eb5c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 6 additions & 3 deletions main.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ build {
}

provisioner "ansible" {
command = "scripts/playbook.sh"
playbook_file = "config/ansible/${var.target}.yaml"
galaxy_file = "config/ansible/requirements.yaml"
extra_arguments = [
"--scp-extra-args", "'-O'" # https://github.com/hashicorp/packer/issues/11783
ansible_env_vars = [
"ANSIBLE_FORCE_COLOR=1",
"PYTHONUNBUFFERED=1",
"ANSIBLE_HOST_KEY_CHECKING=False"
]
# https://github.com/hashicorp/packer/issues/11783
extra_arguments = ["--scp-extra-args", "'-O'"]
galaxy_force_install = true
}

Expand Down
3 changes: 0 additions & 3 deletions scripts/playbook.sh

This file was deleted.

1 comment on commit d5eb5c4

@JosBritton
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.