2015-10-11

Get the current role name in an Ansible Role

Since Ansible 1.8 the variable role_path returns the current role's pathname (see Ansible docs). Use the basename filter to extract the role name.
{{ role_path | basename }}
Note: role_path is only defined inside a role.

Keine Kommentare

Kommentar posten