Certificate validation fails within Vagrant

Hi,

I’m developing a testing environment for our Ansible playbooks using Vagrant. I’m using ansible 1.7.2 and vagrant 1.6.5.

When I execute a playbook, built-in modules fail SSL certificate validation:

  • name: wget phantomjs
    action: get_url
    args:
    url: “{{ phantomjs_archive_download_url }}”
    dest: “{{ phantomjs_archive_download_to }}”
    sha256sum: “{{ phantomsjs_archive_sha256_checksum }}”
    sudo: yes

However if I replace with a manual shell command they work fine:

  • name: wget phantomjs
    shell: wget {{ phantomjs_archive_download_url }} -O “{{ phantomjs_archive_download_to }}/{{ phantomjs_archive_name }}”
    sudo: yes

Both machines (the one running ansible-playbook and the controlled VM) are Ubuntu 14.04 and they both have the ca-certificates package installed.

Why would certificates validate successfully using any shell command (wget, httpie, curl, etc) but fail when using ansible modules?

Ben