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