ansible-local vs ansible-remote why would you use one over the other?

1,583 views
Skip to first unread message

Matzuba

unread,
Nov 9, 2016, 8:55:21 PM11/9/16
to Packer

Hey

sorry if this has been asked but i didn't see much in the history to aid me.

I'm having trouble understanding what really is the difference between ansible-remote and ansible-local as provisioners to build an AMI within AWS.

We typically use ansible in its standard setup with SSH on our other projects for general CM/ad-hoc tasks run. I understand that ansible-local will copy the playbook to the remote node/ami instance i am building and run. I understand that ansible-remote will do the same/similar over SSH but i am not getting why i would choose one method over the other?

What are the pro/cons with either approach and why would i choose one over the other? As i wish to use playbooks using our standard config management and not just when building an AMI, i was thinking remote was the way to go but a lot seem to be using ansible-local which i have just tested and works fine. I understand there maybe slight differences to the playbooks written for each method and would prefer to stick with one method for both workloads.

Cheers


Alvaro Miranda Aguilera

unread,
Nov 10, 2016, 1:52:46 AM11/10/16
to packe...@googlegroups.com
My undersrtanding is

local doesn't require ansible to be installed on the host where packer is running.

Alvaro

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a03590d4-09dc-48df-961c-e8208cbb263f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Rickard von Essen

unread,
Nov 10, 2016, 2:17:10 AM11/10/16
to packe...@googlegroups.com

Pros ansible-remote:
Doesn't require ansible to be installed on the target i.e. the instance building the AMI. Simplify using complex setup of ansible playbooks (over multiple repository etc), and usage of ansible-vault.

Cons ansible-remote:
Requires ansible to be installed on the host i.e. you can't build from Windows.

Pros/cons ansible-local: basically the reverse of the above.

If you are heavy ansible users and don't run ansible-pull I would start by trying to use ansible-remote since that is similar to what you use now days.


Matzuba

unread,
Nov 10, 2016, 5:12:27 AM11/10/16
to Packer
Thanks for the replies guys!

I will have a management host that will be used to run Ansible for the whole platform so i will go with remote.
I've just got remote working as well so will continue with it

appreciate your time and am enjoying the hashicorp products
Reply all
Reply to author
Forward
0 new messages