# Basic Info required please regarding the sequence that tasks inside a role are executed in

**URL:** <https://forum.ansible.com/t/basic-info-required-please-regarding-the-sequence-that-tasks-inside-a-role-are-executed-in/23169>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [December 5, 2016, 10:19am UTC](https://forum.ansible.com/t/basic-info-required-please-regarding-the-sequence-that-tasks-inside-a-role-are-executed-in/23169 "2016-12-05T10:19:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Byrne](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@Michael\_Byrne](https://forum.ansible.com/u/Michael_Byrne)\
**Post date:** [December 5, 2016, 10:19am UTC](https://forum.ansible.com/t/basic-info-required-please-regarding-the-sequence-that-tasks-inside-a-role-are-executed-in/23169/1 "2016-12-05T10:19:50Z")

</div>

Hi,

I’m new to Ansible so apologies for the the basic question.  
I have a role called “ **manage\_prod\_logs** ”  
I created the directory structure automatically using the command → " **ansible-galaxy init manage\_prod\_logs"**

Within the directory structure, I have a file …\tasks\mail.yml  
It looks as follows:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 8, 2016, 7:08am UTC](https://forum.ansible.com/t/basic-info-required-please-regarding-the-sequence-that-tasks-inside-a-role-are-executed-in/23169/2 "2016-12-08T07:08:33Z")

</div>

> Hi,
> 
> I'm new to Ansible so apologies for the the basic question.

I would recommend you read this page, it give answers to many basic question like this  
[https://docs.ansible.com/ansible/playbooks\_intro.html](https://docs.ansible.com/ansible/playbooks_intro.html)

> I have a role called "\*manage\_prod\_logs\*"  
> It looks as follows:  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> ---  
> - name: \*Copy\_File\*  
> &nbsp;&nbsp;copy: src=skins/larry/bt/brandtone/task-automation/scripts/log\_file\_archiver.bash  
> dest=/bt/scripts/log\_file\_archiver.bash owner=ansible force=yes  
> group=brandtone mode=4755
> 
> - name: \*Run\_Script\*  
> &nbsp;&nbsp;command: "/bin/bash /bt/scripts/log\_file\_archiver.bash"  
> &nbsp;&nbsp;become: true  
> &nbsp;&nbsp;args:  
> &nbsp;&nbsp;&nbsp;chdir: /bt/scripts  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
> 
> The playbook is actually working properly at the moment for the remote host.  
> My question is, will the task "\*Copy\_File\*" above always execute before the  
> task "\*Run\_Script\*" by virtue of their positioning within the task list  
> or do I need to do something else to ensure they always execute in sequence.

Yes, Ansible always run tasks in the listed order, starting from top to bottom in the file.
