How can I get the current role name in an ansible task yaml file?
I would like to do something like this
--- # role/some-role-name/tasks/main.yml - name
See this post:
To get the role directory:
role_dir: "{{ lookup('pipe', 'pwd') | dirname }}"
To get the role name:
role_name: "{{ lookup('pipe', 'pwd') | dirname | basename }}"