-
Notifications
You must be signed in to change notification settings - Fork 34
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
ansible-local provisioner extra_arguments do not work with LXD builder #34
Comments
I think the (perhaps this invalid option is causing I've tried removing it from the src &
but I still see it showing up in the
I can make a PR for this change but wanted to test the change properly first - am I missing a step ? (NB for others: the ansible provisioner works perfectly with the ansible |
When it comes to the So the initial fix (untested) might look a little more like this (although I believe the whole diff --git a/provisioner/ansible-local/provisioner.go b/provisioner/ansible-local/provisioner.go
index 9619733..c6ece7d 100644
--- a/provisioner/ansible-local/provisioner.go
+++ b/provisioner/ansible-local/provisioner.go
@@ -549,7 +549,7 @@ func (p *Provisioner) invokeGalaxyCommand(args []string, ui packersdk.Ui, comm p
func (p *Provisioner) executeAnsible(ui packersdk.Ui, comm packersdk.Communicator) error {
inventory := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(p.config.InventoryFile)))
- extraArgs := fmt.Sprintf(" --extra-vars \"packer_build_name=%s packer_builder_type=%s packer_http_addr=%s -o IdentitiesOnly=yes\" ",
+ extraArgs := fmt.Sprintf(" --extra-vars \"packer_build_name=%s packer_builder_type=%s packer_http_addr=%s\" --ssh-extra-args \"-o IdentitiesOnly=yes\" ",
p.config.PackerBuildName, p.config.PackerBuilderType, p.generatedData["PackerHTTPAddr"])
if len(p.config.ExtraArguments) > 0 {
extraArgs = extraArgs + strings.Join(p.config.ExtraArguments, " ") |
This issue was originally opened by @ppennanen as hashicorp/packer#6146. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
When used with the LXD builder, the ansible-local provisioner
extra_arguments
do not work as expected. See a (full example in this gist. Given this provisioner:It looks like
extra_arguments
are added to the command when ansible is called:However the extra variable is not defined and ansible does not run in extra verbose
-vvv
mode:Packer version: 1.2.2
Host platform: Ubuntu 16.04
Gist: https://gist.github.com/ppennanen/77e64f55fa1d7218e10ecd8b1ae1f2e8
The text was updated successfully, but these errors were encountered: