CentOS 7.x Running an ansible task only once
From Notes_Wiki
<yambe:breadcrumb>CentOS_7.x_ansible_tips_and_tricks|CentOS 7.x ansible tips and tricks</yambe:breadcrumb>
CentOS 7.x Running an ansible task only once
Running a task only once per run
To run task only once per playbook run (ie not again and again for every host), use:
run_once: true
Running a task only once even among re-run of the same playbook
To run task only once even if playbook is re-run use creates option of shell module such as:
shell: <thing to be done only once>; touch /root/thing_done args: creates: /root/thing_done
Refer http://stackoverflow.com/questions/26409164/ansible-ignore-the-run-once-configuration-on-task
<yambe:breadcrumb>CentOS_7.x_ansible_tips_and_tricks|CentOS 7.x ansible tips and tricks</yambe:breadcrumb>