Any Go developers in the house? Packer provisioner module?

It might be nice for us to have a module for packer.io, which uses various CM tools to build images. It’s pretty new.

I’m not a Go developer, though I figured someone might like to do this, and there were probably go developers on the list.

It’s small compensation, but if anyone wants gets one accepted, we’ll send you a shirt and some stickers and build a statue of you in our formal gardens*

  • = note, we don’t have any formal gardens yet. But when we do! Yes, we’ll do it in bronze, and maybe with you riding a horse.

It’s in my todo list to look at it and I may wrote it tonight or during the week.

I’m a Go developer but I did some fix for the Salt masterless and it’s surprisingly easy to wrote a plugin for Packer

  • I’m not a Go developer* I meant, but you can sort yourself out by looking how the other provisioner are done

Hi Rachid,

In order to write ansible plugin of packer, I think the ssh
information such as addr, port, user and pass is required.
So I tend to get these from Communicator but it seems it can not.

I posted the question to the packer's ML[1] and got the answer about
it can not yet.
Additionally, there are several types of Communicator like chroot.
so if you will implement same as my thought, you may need to implement
getting information function to base Communicator type and switching
behavior by connection type.
(fortunately, ansible has chroot connection!)

Since I am not familiar with packer, if you will work the plugin, I am
glad to. and a statue will be yours :wink:

[1] https://groups.google.com/d/msg/packer-tool/Go_nAVgkt2g/nWW1SvCruiAJ

Regards,
WAKAYAMA Shirou

Hi,

As you said the communicator doesn’t provide this kind of thing yet and the communicator is abstraction with the builder so we cannot take assumption on the protocol used.

I discussed my 3 approach that I had in mind with mitchell :

I think the first version should be in local mode. It’s not perfect but it will help the community to start using packer with Ansible and make progress the things

Now local mode make sense if you think in term of immutable server :

http://martinfowler.com/bliki/ImmutableServer.html

Because you don’t care about doing any update and I prefer to have the playbook there to being able to debug and ensure which playbooks generated which image.

I hope having something before the weekend but if not should be done for Monday.

I let you know

Hi Rachid,

I have also considered about local mode -- a.k.a. ansible-pull.
However, before using ansible-pull in the box, dependencies like a
paramiko and git, should be installed.
I think it is not simple way so I put away once.

But I agree to implement the local mode approach as a first step.

Regards,
WAKAYAMA Shirou

Hi Rach,

I did something very similar to a Packer provisioner, which is an Ansible provisioner for Aminator:

https://groups.google.com/forum/#!topic/ansible-project/lXurP9o2wys

I need to check out Packer.io because although it is early, it seems to have similar functionality to Aminator, but for a broader audience, and so may win in the long run.

If you do start working on this, please let me know. I’d love to help out where I can.

Hi,

I found time to work on it but I’m struggling on one part…
As I’m getting started with Ansible local mode, I need to install Ansible on the host.

I don’t really like to assume that ansible is pre-installed which is the approach of Aminator.
On the other hand Ansible doesn’t have an bootstrap script as Salt does.

I have one attribute called : ‘install-script’ which the path to a local script to install ansible on the target OS or we may consider to work on community install script ?

Do you have any suggestions?

Otherwise everything else is simple to do the Ansible provisioner.

I don’t understand why it would be a problem to expect someone to install a software application.

Executing “curl | bash” should set everyone’s alarms off every time you see it.

I’ve taken a stab at this and got something I’m pretty happy with. I’m basically doing something similar to ansible-pull, but instead of pulling things down using git, I’m pushing up user specified playbooks and roles.

More details and examples can be found at my Github repo kelseyhightower/packer-provisioner-ansible-local.

I would really appreciate some feedback, which should help me polish things up and prepare a pull request to Packer core.

I’ve just issued a pull request to get this into packer core:
https://github.com/mitchellh/packer/pull/475

Glad to see this!

packer 0.3.10 was released yesterday and comes with the new ansible provisioner!

See also: