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:
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
I have a role called "*manage_prod_logs*"
It looks as follows:
________________________________________________________________________________________________________________________________________
---
- name: *Copy_File*
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*
command: "/bin/bash /bt/scripts/log_file_archiver.bash"
become: true
args:
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.