DoclerLabs / openstack

Production-ready Openstack installer using Ansible
46 stars 21 forks source link

ansible_distribution_version' is undefined Ansible failed to complete successfully. #15

Closed wanghaisheng closed 8 years ago

wanghaisheng commented 8 years ago

Centos7.1

[wanghs@db2 vagrant]$ vagrant box add --name ubuntu/trusty64 ~/ubuntu-trusty64.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'ubuntu/trusty64' (v0) for provider:
    box: Unpacking necessary files from: file:///home/wanghs/ubuntu-trusty64.box
==> box: Successfully added box 'ubuntu/trusty64' (v0) for 'virtualbox'!
[wanghs@db2 vagrant]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vagrant_default_1462436911427_80914
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2208.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
    default: Adapter 3: hostonly
    default: Adapter 4: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2208 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2208
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 4.3.36
    default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /home/wanghs/paas_evaluation/openstack/openstack-installer/vagrant
==> default: Running provisioner: ansible...
    default: Running ansible-playbook...
ERROR: Failed to template {{ (ansible_distribution_version | version_compare('16.04', '>=')) | ternary('xUbuntu_15.04','xUbuntu_14.04') }}: Version comparison: 'ansible_distribution_version' is undefined
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
gyurco commented 8 years ago

What is your ansible version?

gyurco commented 8 years ago

Also please check if /etc/ansible.cfg has the option gathering=smart or gathering=implicit

wanghaisheng commented 8 years ago

[wanghs@db2 openstack]$ ansible --version ansible 1.9.6 i dont have /etc/ansible.cfg on my host machine

gyurco commented 8 years ago

Please try it now, with the latest commit.