Hi there Manuel, 

I have not used the ansible (remote) provisioner with docker so I can't speak 
to it directly, but since the ansible provisioner relies on SSH I believe you 
would be responsible for setting up an SSH server on the container along with 
installing a version of Ansible in order for the provisioner to work.

If you are looking to provisioner a docker container with Ansible you might 
want to look into the ansible-local provisioner as it does not rely on SSH 
access to the container, but does require that the host running Packer have a 
local version of Ansible installed. 

Have you seen the example build templates 
(https://github.com/hashicorp/packer-plugin-ansible/tree/main/example) for the 
Ansible plugin? 

There is a docker with ansible-local example that you might find useful 
https://github.com/hashicorp/packer-plugin-ansible/blob/main/example/docker-ansible-local.pkr.hcl

Please let me know if this was the information you were looking for. 

--
Wilken Rivera <[email protected]>



On Tue, Jun 8, 2021, at 9:46 AM, Manuel Sopena Ballesteros wrote:
> 
> Dear hashicorp packer community,
> 
> I am learning packer and would like to understand if it is possible to have 
> the ansible provisioner working with docker builder. I assume I will have to 
> bring up the ssh server on the docker container myself?
> 
> thank you very much
> 

> -- 
> 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/hashicorp/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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/packer-tool/3d99dfb8-5570-4bc6-8d4f-079438c7acacn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/packer-tool/3d99dfb8-5570-4bc6-8d4f-079438c7acacn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/hashicorp/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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/85f36a1d-4c49-4e63-b2b4-a5f176bb0ca6%40www.fastmail.com.

Reply via email to