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. ☺


-          Rilindo



From: <[email protected]> on behalf of Rilindo Foster 
<[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Tuesday, June 28, 2016 at 7:02 PM
To: "[email protected]" <[email protected]>
Subject: [ansible-project] Ansible + Packer = nothing?

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


--
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 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9328C4A6-C947-428D-AC98-D763B6921A2F%40connecture.com<https://groups.google.com/d/msgid/ansible-project/9328C4A6-C947-428D-AC98-D763B6921A2F%40connecture.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/532C18B4-FF95-4ED9-82A2-672F1F143F90%40connecture.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to