bcoe / librarian-ansible

Port of librarian-chef, providing bundler functionality for Ansible roles.
MIT License
185 stars 19 forks source link

ERROR! 'version' is not a valid attribute for a RoleMetadata #17

Open my2ter opened 8 years ago

my2ter commented 8 years ago

Hey,

After installing the deps with librarian I can't run ansible-playbook as it fails on the version variable placed in my repository meta/main.yml file.

my_role/meta/main.yml

galaxy_info: ............ dependencies: [] version: 1.0.0

my_app/Ansiblefile

!/usr/bin/env ruby

^syntax detection

role "my_role", "1.0.0", git: "git@bitbucket.org:private/my_role.git"

Installation

librarian-ansible install --path roles
ansible-playbook webservers.yml -i production
The error appears to have been in 'my_role/meta/main.yml': line 2, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
galaxy_info:
^ here

versions

ansible-playbook --version
ansible-playbook 2.0.0.2

librarian-ansible version
librarian-0.1.2
librarian-ansible-2.0.0

Removing the version or moving it under the galaxy_info tree resolves the problem with ansible-playbook. Drowback is now if it fails on resolving the deps when the version variable is moved up in the meta file.

bertvv commented 8 years ago

version: is an unofficial field that was never endorsed by Ansible. Custom meta fields are no longer accepted in Ansible 2.0. An upstream feature request has already been submitted. See ansible/ansible#13496 for more info.