deploy_adguard/handlers/main.yml

40 lines
1.1 KiB
YAML
Raw Normal View History

2023-05-28 18:03:38 +00:00
---
# handlers file for deploy_adguard
2023-05-31 20:05:56 +00:00
- name: "Reload systemd file"
ansible.builtin.systemd:
daemon_reload: true
become: true
2023-05-31 20:05:56 +00:00
listen: "systemctl-daemon-reload"
2023-06-01 21:02:50 +00:00
- name: "Enable adguard service"
2023-05-31 20:05:56 +00:00
ansible.builtin.service:
name: adguard
enabled: true
become: true
2023-05-31 20:05:56 +00:00
listen: "systemctl-enable-adguard"
2023-06-01 21:02:50 +00:00
- name: "Start adguard service"
2023-05-31 20:05:56 +00:00
ansible.builtin.service:
name: adguard
state: restarted
become: true
2023-05-31 20:05:56 +00:00
listen: "systemctl-restart-adguard"
throttle: 1
when: deploy_adguard_start_service
2023-06-07 17:17:42 +00:00
- name: "Register/Update consul service"
ansible.builtin.command: "consul services register {{ deploy_adguard_directory }}/adguard.consul.json"
environment:
CONSUL_HTTP_ADDR: "{{ deploy_adguard_consul['consul_addr'] }}"
CONSUL_HTTP_TOKEN: "{{ deploy_adguard_consul['consul_token'] }}"
changed_when: false
listen: "consul-services-register-adguard"
- name: "Enable adguard-connect-proxy service"
ansible.builtin.service:
name: adguard-connect-proxy
enabled: true
state: restarted
become: true
listen: "systemctl-enable-restart-adguard-connect-proxy"