Answer the question
In order to leave comments, you need to log in
How to execute only those scripts in which there were changes?
Salute comrades!
There is a small playbook that uploads several script files (to be more precise SQL files) to the server and then applies them one by one. At the moment it is implemented like this
- template: src={{ item }} dst=/tmp
with_item: "{{ some_list }}"
- shell: "sqlplus / @{{ item }}"
with_item: "{{ some_list }}"
Answer the question
In order to leave comments, you need to log in
I'm not 100% sure, but try:
1) add register in the template step
2) see what's in the variable
I would expect to see separate entries for changed there.
3) if it works, then use the register result in with_items for the script launch step
The second option is to use notify and handler docs.ansible.com/ansible/playbooks_best_practices....
PS The second option will be more correct and concise.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question