It looks like you're implicitly that "included" playbook as your first task, and thus you're mixing up the use of role and include in a rather odd way. Is there any reason why you're invoking it directly?
On Monday, 28 March 2016 17:04:35 UTC+1, Alastair Brayne wrote: > > Hey, > > I've just upgraded to Ansible 2 and my playbooks have stopped working. The > specific error I get is: > > ERROR! the role 'common' was not found in /<obfuscatedpathtomyproject> > /roles/ec2/tasks/roles:/<obfuscatedpathtomyproject>/roles/ec2/tasks:/etc/ > ansible/roles > > > > The error appears to have been in '/<obfuscatedpathtomyproject>/site.yml': > line 5, column 7, but may > be elsewhere in the file depending on the exact syntax problem. > > > The offending line appears to be: > > > roles: > - common > ^ here > > > > > My `sites.yml` looks like: > > - include: roles/ec2/tasks/load_ec2_group_foo.yml > > - hosts: foo > roles: > - common > - java > > > My directory structure looks like this: > hosts > - app > - ec2.py > roles > - common > - java > site.yml > > No *.ansible.cfg* file. > > Run command: > ansible-playbook -i hosts site.yml > > > > It worked absolutely fine in 1.9. Just broke with the upgrade. I made no > other changes. > > What I notice and find interesting is that the search path for the roles > uses *<project>/roles/ec2/tasks/roles*, *<project>/roles/ec2/tasks*, and > */etc/ansible/roles*. It looks almost like the include statement on line > 1 in the *site.yml* file is setting this path lookup. What it is missing > is of course an entry in this list for *<project>/roles*. > > Anyone got any idea why this might be? Does the include now do an internal > *cd* or something and then leave itself in the wrong directory? No idea > about the bowels of ansible, I've never dug into it. > > Any help much appreciated :) > > Thanks > Alastair > > > > > > e: *[email protected] <javascript:>* > t: *07779266625* > w: *http://perchten.co.uk <http://perchten.co.uk/>* > > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6be9822b-b39b-495e-bfa3-023bf1a28eca%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
