use handlers https://docs.ansible.com/ansible/2.6/user_guide/playbooks_intro.html#handlers-running-operations-on-change
On Wed, Sep 5, 2018 at 4:12 PM Chris <[email protected]> wrote: > Apologies if that was not clear. > > On my ansible server I have files that I want to copy to remote servers. I > only want to restart a service if a specific file was copied and not just > any other file. My example shows two files, but I only want to restart the > syslog service if the syslog file is copied. Additionally I don't want to > restart the syslog service on all of the inventoried servers just the ones > with the updated file. > > I hope that makes my question more clear. > > Chris > > On Wednesday, September 5, 2018 at 12:48:54 PM UTC-7, Kai Stian Olstad > wrote: >> >> On 05.09.2018 20:23, Chris wrote: >> > Good day, >> > >> > I have a list that I loop over to copy files. I want to restart a >> > service >> > only if that file has been changed on the remote system. What is the >> > best >> > method to restart a service on only on a system if the file was copied >> > to >> > the system. >> >> Here you say system and system. >> >> > If the system copies a new syslog file restart syslog. >> > >> > I know there are handlers and notify, but I only want to restart on a >> > specific system if it gets updated. >> >> And system again, so i guess this is system is the same host and notify >> is perfect in that scenario. >> >> -- >> Kai Stian Olstad >> > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/6d8870fb-3154-4965-93ff-b8300902a401%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/6d8870fb-3154-4965-93ff-b8300902a401%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Jonathan lozada de la matta AUTOMATION PRACTICE -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFYJA%2BKBODXu-YMUq-7knT%2BjSBM-%3DrrUR60BNq5%3Dzs8bVf5VhA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
