# Ansible --connection=local

**URL:** <https://forum.ansible.com/t/ansible-connection-local/16797>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [November 15, 2014, 6:31am UTC](https://forum.ansible.com/t/ansible-connection-local/16797 "2014-11-15T06:31:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@Steve\_Porter](https://forum.ansible.com/u/Steve_Porter)\
**Post date:** [November 15, 2014, 6:31am UTC](https://forum.ansible.com/t/ansible-connection-local/16797/1 "2014-11-15T06:31:16Z")

</div>

Having a bit of an issues with a Packer/Ansible/Vagrant build pipeline. I have been using Ansible for a while and can happily provision my dev VMs via Ansible.

I have hooked Packer in the the pipeline and now with the same Ansible scripts in local mode I am getting failures on conditional checks, apache\_module disallowed.

This is an example of what fails:

- name: Set Ruby 1.9.3 as default on Ubuntu 12.0.4  
sudo: yes  
shell: “{{item}}”  
with\_items:
- ‘cd /etc/alternatives && sudo ln -sf /usr/bin/ruby1.9.3 ruby’
- ‘cd /etc/alternatives && sudo ln -sf /usr/bin/gem1.9.3 gem’
- ‘cd /etc/alternatives && sudo ln -sf /usr/bin/irb1.9.3 irb’
- ‘cd /etc/alternatives && sudo ln -sf /usr/bin/ri1.9.3 ri’  
when: ansible\_distribution\_version | version\_compare(‘12.04’, ‘=’)  
tags: common

The error I am getting is:

TASK: [common | Set Ruby 1.9.3 as default on Ubuntu 12.0.4] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [127.0.0.1] =\> error while evaluating conditional: ansible\_distribution\_version | version\_compare(‘12.04’, ‘=’)

The base iso is Ubuntu 12.04.

I am sure it is something simple but for the life of me this has me stumped.

S

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [November 17, 2014, 8:34pm UTC](https://forum.ansible.com/t/ansible-connection-local/16797/2 "2014-11-17T20:34:10Z")

</div>

What’s the output of “ansible --version” ?

---

<div class="post-metadata">

**Author:** ![Steve\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@Steve\_Porter](https://forum.ansible.com/u/Steve_Porter)\
**Post date:** [November 24, 2014, 10:57am UTC](https://forum.ansible.com/t/ansible-connection-local/16797/3 "2014-11-24T10:57:59Z")

</div>

Hi - ansible 1.7.2

---

<div class="post-metadata">

**Author:** ![Steve\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@Steve\_Porter](https://forum.ansible.com/u/Steve_Porter)\
**Post date:** [November 24, 2014, 2:13pm UTC](https://forum.ansible.com/t/ansible-connection-local/16797/4 "2014-11-24T14:13:12Z")

</div>

My bad - on the Ubuntu VM, the version is 1.4.4+dfsg-1~ubuntu12.04.1. On my OSx box, 1.7.2.

Numpty mistake!

---

<div class="post-metadata">

**Author:** ![Steve\_Porter](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@Steve\_Porter](https://forum.ansible.com/u/Steve_Porter)\
**Post date:** [November 24, 2014, 7:46pm UTC](https://forum.ansible.com/t/ansible-connection-local/16797/5 "2014-11-24T19:46:06Z")

</div>

Probably don’t get this enough, thank you for Ansible. It has literally changed my life and how I think about IT.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [November 24, 2014, 10:30pm UTC](https://forum.ansible.com/t/ansible-connection-local/16797/6 "2014-11-24T22:30:29Z")

</div>

A collective “you are welcome!” from behalf of everyone that works on this. It’s much appreciated.

I am wondering if maybe fact gathering is disabled, possibly as a default in ansible.cfg, or there is a “gather\_facts: False” in the play turning it off.

That might explain the absense of the version info.

My other question if that’s not the case would be what is the OS inside the image you are building?
