Server IP : 85.214.239.14 / Your IP : 18.216.8.36 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/ansible_collections/sensu/sensu_go/roles/agent/handlers/ |
Upload File : |
--- - name: Restart Linux agent service: name: sensu-agent state: restarted when: manage_sensu_agent_service | default(False) - name: Restart Windows agent action: module: win_service name: SensuAgent state: restarted when: manage_sensu_agent_service | default(False) # You probably noticed that we use some black magic in the previous handler. # Let us explain what it does and why did we bring it into the daylight. # # Under normal circumstances, we would write the previous handler as # # - name: Restart Windows agent # win_service: # name: SensuAgent # state: restarted # # When Ansible loads this handler, it makes sure it can find the win_service # module. And this is where things start to go downhill for us. Because we do # not have a guarantee that win_service module will be available (win_service # is not part of a certified collection), this eagerness prevents operating in # certain situations where win_service module is not even needed. # # And this is why we use the alternative form that forces Ansible to lazy-load # the module at the task/handler execution time. # # Of course, it would be much easier if we could declare ansible.windows as our # dependency, but this is not possible at the moment.