# Execute role tasks before executing role dependencies

**URL:** <https://forum.ansible.com/t/execute-role-tasks-before-executing-role-dependencies/21941>\
**Category:** Ansible Project\
**Created:** [July 6, 2016, 10:33pm UTC](https://forum.ansible.com/t/execute-role-tasks-before-executing-role-dependencies/21941 "2016-07-06T22:33:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Steinbach](https://avatars.discourse-cdn.com/v4/letter/t/df788c/32.png) [@Thomas\_Steinbach](https://forum.ansible.com/u/Thomas_Steinbach)\
**Post date:** [July 6, 2016, 10:33pm UTC](https://forum.ansible.com/t/execute-role-tasks-before-executing-role-dependencies/21941/1 "2016-07-06T22:33:41Z")

</div>

Hi,

is there a way for executing role tasks before executing role dependencies? In my apache\_httpd role I want to deploy some configuration files before calling the sub role docker\_application. Latter will do some boilerplate tasks when creating docker contianers (in this case starting the httpd container). But before I want to deploy the httpd.conf and basic\_auth file with the apache\_httpd role.

I tried to create a role within a role and add is as dependency with the absolute path:  
`"{{ role_path }}/subroles/apache_httpd_pretasks"`

, but at the moment of resolving the depenencies the roles\_path variable isn’t set yet.
