(A)
This is probably a better question for ansible-project in the future.
(B)
So I noticed you already filed a ticket on this one and it’s on our list to look at.
In general, we’ve never really specified what relative paths mean, but I agree, as I commented in the ticket, assuming “/” is a little weird.
Usually folks use “{{ playbook_dir }}/foo.txt” if they need to reference something relative to the playbook.
A playbook trying to write files into the playbook directory is a bit of an anti-pattern of course.
As I also commented on the ticket, it’s not neccessary that you write a playbook to init a role structure, just do this:
“ansible-galaxy init rolename”
And it will stub it out.
A) I realized I posted to the wrong group after I had posted to ansible-devel. I then tried to delete it after I posted it. Looks like you still saw it.
B) After I posted here I continued to test and was able to confirm that the behavior was definitely different between Ansible 1.6 and 1.7. So I decided to file a bug report.
C) ansible-galaxy init is great for stubbing out a new role but we generate more than ansible-galaxy init does. We have multiple teams contributing to a single ansible repo and we have strict standards for the manifest, other .md files and comment headers in .yml files. We also want people naming their roles a certain way. So similar to yeoman we prompt for several pieces of information and then we generate the role based on our the standards we have defined. Also in the prompts we ask if they want to store encrypted variables. If they answer yes we print out the command they need to run in order to create a vars file with ansible vault. This allows them to copy the command and run it. It ensures that all vault files are in a common location within the role and named a certain way to indicate that the file is encrypted with vault. It would be awesome if we could automate running vault interactively during the running play but I haven’t figured that out. Anyway, this is all just a bunch of extra info that I didn’t think was necessary to include in describing the path issue. I pulled all of the extra stuff out of the playbook in order to demonstrate the issue that I suspect is a bug in 1.7
BTW, Thank you for Ansible! I absolutely love it! It has made life so much easier for my team.
All understood on the templating bits. Thanks!
I think we have a bug filed now, so we’re on it. Appreciate it!