Handlers

main.yml

Synopsis: Main task.

Import handlers.

[handlers/main.yml]

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
# handlers for vbotka.apache

- name: enable and start apache
  ansible.builtin.service:
    name: "{{ apache_service }}"
    state: started
    enabled: true

- name: disable and stop apache
  ansible.builtin.service:
    name: "{{ apache_service }}"
    state: stopped
    enabled: false

- name: restart apache
  ansible.builtin.service:
    name: "{{ apache_service }}"
    state: restarted
  when: apache_enable|bool

- name: reload apache
  ansible.builtin.service:
    name: "{{ apache_service }}"
    state: reloaded
  when: apache_enable|bool

- name: graceful apache
  ansible.builtin.command:
    cmd: "/usr/local/etc/rc.d/{{ apache_service }} graceful"
  when: apache_enable|bool

- name: gracefulstop apache
  ansible.builtin.command:
    cmd: "/usr/local/etc/rc.d/{{ apache_service }} gracefulstop"
  when: apache_enable|bool

# EOF
...