Trying to use ansible as a provisioner in packer. Ansible is hanging during 
the TASK [Gathering Facts] and I have no idea why

the provisioner snippet is below:

    {
      "type": "ansible",
      "command": "script/ansible.sh",
      "playbook_file": "playbooks/testing_ami.yml",
      "user": "{{ user `ssh_username` }}",
      "groups": [
        "aws_comap_com",
        "linux_servers"
      ],
      "extra_arguments": [
        "-u ubuntu",
        "-vvvv"
      ],
      "only": [
        "amazon-ebs"
      ]
    }


The testing_ami.yml is below:

- hosts: all
  vars:
    keep_deb_src: true
    keep_build_essentials: true
  pre_tasks:
  roles:
    - { role: take-over, become: yes }
  tasks:
  post_tasks:

The script/ansible.sh

#!/bin/bash

ansible-playbook $@

I do not understand why a couple of the ssh calls to the packer AMI work 
and then last one fails.

I am pretty sure this is a packer problem as invoking the same playbook 
from the command line
works as expected. BUT the logs show the invocation of ansible-playbook 
like I would do via the command
line.

When I "telnet 127.0.0.1 port", where port is show in the gist below I see 

$ telnet localhost 58595
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SSH-2.0-Go

So Packer (Go) is being a proxy to the Packer AMI but I never see any sort 
of login attempts in /var/log/syslog on the Packer AMI then I try to "ssh 
127.0.0.1 port"

gist of the logs

https://gist.github.com/basictheprogram/017998412e0dc7aa068ee765cdd85ad5

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/a08fdb59-2436-4423-ae47-7660ed00edd4%40googlegroups.com.

Reply via email to