I’m sure this is dead simple, but googling seems hard since most posts contain the words “role” and “variable”!
I have versioned playbooks. I would like to stick a file somewhere on the target system that explains what role was used, a time stamp, and a version. I use maven as it happens. I thought I could something like this:
roles/install_iod_base/tasks/pom.yml
- name: copy the pom for this trunk/branch/tag
copy: src=…/…/…/…/pom.xml dest=~/pom.xml-{{ ansible_date_time.date }}-{{ ansible_date_time.time }} mode=0644
I would like to include this snippet in all my roles, and therefore it would be useful to have something like
copy: src=…/…/…/…/pom.xml dest=~/pom.xml-{{ ansible_role }}-{{ ansible_date_time.date }}-{{ ansible_date_time.time }} mode=0644
How can I enumerate the current roles name?