Ansible + Packer = nothing?

43 views
Skip to first unread message

Foster, Rilindo

unread,
Jun 28, 2016, 8:02:15 PM6/28/16
to ansible...@googlegroups.com

I am currently experimenting with deploying using Packer’s Ansible local provisioning and for some odd reason, it doesn’t appear to be executing the tasks in the playbook. Packer, after installing  the pre-requiresites for Ansible, uploads the following

 

Inventory file (“hosts”)

 

[localhost]

localhost ansible_connection=local

 

The playbook file (“local.yml”):

 

---

- hosts: localhost

  connection: local

  become: yes

  become_method: sudo

  tasks:

  - name: Making sure that ansible is actually executing this playbook

    shell: echo "hello world"

  - name: install packages

    package: name={{ item }} state=present

    with_items: 

      - nginx

      - git

      - curl

      - libmysqlclient-dev

      - libmysqlclient18

      - mysql-common

      - nodejs

      - tcpdump

 

The output is as follows (running Ansible against a Ubuntu 14.04 instance):

 

    amazon-ebs: Executing Ansible: cd /tmp/packer-provisioner-ansible-local && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/local.yml -c local -i /tmp/packer-provisioner-ansible-local/hosts

==> amazon-ebs: Stopping the source instance...

==> amazon-ebs: Waiting for the instance to stop.

 

As you can see, there is no Ansible output, which I assume I should get (somebody correct me if I am wrong).

 

I did manual run of the playbook, which worked successfully.  At this point, I am not sure if I missing something or not.

 

-          Rilindo

 

 

Foster, Rilindo

unread,
Jun 29, 2016, 3:02:38 PM6/29/16
to ansible...@googlegroups.com

I dumbs.

 

I had a reboot option in my packer config, which mean that the machine was rebooting right when I was running ansible code.

 

It works now. J

 

-          Rilindo

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9328C4A6-C947-428D-AC98-D763B6921A2F%40connecture.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages