Hello everyone,
I did not found a elegant way of sharing tasks list between roles.
I explain my problem :
1 I have a first role in which i include tasks (IE create_user.yml) so i put the file in my_firt_role/tasks/create_user.yml
2 I am writing an other role in which i would like to use the tasks create_user.yml too
The only solutions i found to use it in both playbooks are :
hardcode the path of a common dir in my roles includes ( /var/ansible/common/create_user.yml)
duplicate the tasks in each playbook
I was expecting a way to configure tasks lookup directories (like role_path for roles) in ansible.cfg
I try also to add a role dependencies but it seems that the pulled roles are not sharing tasks to upper roles.
Am I missing an Ansible feature or good practice ?
Any ideas to improve tasks re-usability and avoid duplication ?
Regards,
Efflam