Unable to use provisioners on FreeBSD

54 views
Skip to first unread message

Dan Moutal

unread,
Jan 13, 2019, 7:57:18 PM1/13/19
to Packer
I am just getting started with Packer and have run into some issues.

I am running Packer 1.3.3 installed using homebrew on MacOS 10.14.2 and I am having trouble running the Ansible Provisioner. As a troubleshooting step I tried using the shell provisioner but that also failed. I don't really need the ouse the shell provisioner since I plan to configure everything using Ansible but figured it would be a simpler test to troubleshoot.

I have attached my packer json builds and the corresponding output.

Run1: Ansible provisioner
Run2: Shell provisioner

Any help would be appreciated.
run1.json
run1.log
run2.json
run2.log

Rickard von Essen

unread,
Jan 14, 2019, 4:20:47 AM1/14/19
to packe...@googlegroups.com
The shell provisioner fails because of tcsh, see the docs 1)

The ansible provisioning seems to work but fail on something in your playbook. Can you provide your playbook?



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/2fe0ccb6-89a3-4b62-ab5a-0b07a90d1387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Moutal

unread,
Jan 14, 2019, 11:31:51 AM1/14/19
to packe...@googlegroups.com
Here is the playbook. I use this same playboot with vagrant without issues.
playbook.yml

Rickard von Essen

unread,
Jan 15, 2019, 1:56:48 AM1/15/19
to packe...@googlegroups.com
Remove this line:

 "private_key_file=~/.ssh/id_ed25519",

It will interfere with how Packer handles the connection towards the VM. (Also I don't see how that key could work, there is not provisioning of it before and not supplied to the VM directly in any way)

On Mon, Jan 14, 2019 at 5:31 PM Dan Moutal <d...@moutal.ca> wrote:
Here is the playbook. I use this same playboot with vagrant without issues.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


-- 
Dan Moutal


For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

Dan Moutal

unread,
Jan 15, 2019, 2:34:41 AM1/15/19
to Packer
I removed that line but it still fails (see the attached log). I should add that the corresponding public key was uploaded to Digital Ocean (but I I don't know if Packer would use that key).

Looks like it has trouble establishing an ssh connection to 127.0.0.1(I don't understand why it would be trying to do that. Why not ssh directly into the newly created droplet at DO?) I am pretty sure the sshd is not running in my Mac. Should it be?

Thanks for your help so far
packer.log

Rickard von Essen

unread,
Jan 15, 2019, 2:50:52 AM1/15/19
to packe...@googlegroups.com
Packer runs Ansible towards a local SSH proxy.

The ansible Packer provisioner runs Ansible playbooks. It dynamically creates an Ansible inventory file configured to use SSH, runs an SSH server, executes ansible-playbook, and marshals Ansible plays through the SSH server to the machine being provisioned by Packer.


For the problem with "too many authentication failures" see

In your case you can probably add something like:

"extra_arguments": [ "--ssh-common-args=\"-o IdentityAgent=none\"" ]

to the ansible provisioner.

Dan Moutal

unread,
Jan 15, 2019, 3:11:26 AM1/15/19
to Packer
Its still not working :(

Thanks for your help so far. I am calling it a night. Will try more tomorrow
packer.log

Rickard von Essen

unread,
Jan 15, 2019, 4:13:55 AM1/15/19
to packe...@googlegroups.com
Tried your template and playbook, and for some reason it fails on the "Install default packages" task. Verify that you are getting python3 + ansible correctly working.

I suggest that you launch a droplet and use the null-builder to connect to it to iterate faster.

Dan Moutal

unread,
Jan 15, 2019, 9:38:59 PM1/15/19
to Packer
Ok I figured it out

I needed to add "user": "root" to the Ansible provisioner and it worked without issue. I am confused as to why the first play in the playbook ran without issue but the second play failed. 

Thanks for your help!
Reply all
Reply to author
Forward
0 new messages