Ansible --connection=local

354 views
Skip to first unread message

Steve Porter

unread,
Nov 15, 2014, 1:31:16 AM11/15/14
to ansible...@googlegroups.com
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

Michael DeHaan

unread,
Nov 17, 2014, 3:34:13 PM11/17/14
to ansible...@googlegroups.com
What's the output of "ansible --version" ?




--
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/3c33947e-e475-4c4b-a8f9-52bc7c45cf37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Porter

unread,
Nov 24, 2014, 5:57:59 AM11/24/14
to ansible...@googlegroups.com
Hi - ansible 1.7.2

Steve Porter

unread,
Nov 24, 2014, 9:13:12 AM11/24/14
to ansible...@googlegroups.com
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!

Steve Porter

unread,
Nov 24, 2014, 2:46:06 PM11/24/14
to ansible...@googlegroups.com
Probably don't get this enough, thank you for Ansible. It has literally changed my life and how I think about IT.

Michael DeHaan

unread,
Nov 24, 2014, 5:30:33 PM11/24/14
to ansible...@googlegroups.com
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?



Reply all
Reply to author
Forward
0 new messages