refactor ♻️: Refactor README and update role for Proxmox VE provisioning
This refactoring includes updating the README, changing the role name to focus on Proxmox VE, enhancing compatibility matrix, and refactoring default values for role variables. Handlers are updated to manage apt cache, restart pveproxy, and reload systemd. Role metadata is also updated for better Proxmox VE provisioning.
This commit is contained in:
@@ -1,45 +1,15 @@
|
||||
---
|
||||
# ansible-role-template/handlers/main.yml
|
||||
# ansible_role_proxmox_provision/handlers/main.yml
|
||||
# Handlers for role
|
||||
# ==================
|
||||
- name: apt update
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
# Service handlers
|
||||
- name: Restart {{ role_template_service_name }}
|
||||
ansible.builtin.service:
|
||||
name: "{{ role_template_service_name }}"
|
||||
- name: restart pveproxy
|
||||
systemd:
|
||||
name: pveproxy
|
||||
state: restarted
|
||||
listen: "restart {{ role_template_service_name }}"
|
||||
when: role_template_service_enabled
|
||||
|
||||
- name: Reload systemd
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
listen: "restart {{ role_template_service_name }}"
|
||||
when: role_template_systemd_enabled
|
||||
|
||||
# Configuration handlers
|
||||
- name: Reload nginx
|
||||
ansible.builtin.service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
listen: "reload nginx"
|
||||
when: "'nginx' in role_template_service_name"
|
||||
|
||||
# Backup handlers
|
||||
- name: Rotate logs
|
||||
ansible.builtin.command: logger -p local0.info "Rotating logs for {{ role_template_service_name }}"
|
||||
changed_when: true
|
||||
listen: "rotate logs"
|
||||
|
||||
# Monitoring handlers
|
||||
- name: Notify monitoring
|
||||
ansible.builtin.uri:
|
||||
url: "{{ role_template_monitoring_webhook_url }}"
|
||||
method: POST
|
||||
body_format: json
|
||||
body: "{{ lookup('template', 'monitoring_notification.json.j2') }}"
|
||||
status_code: 200
|
||||
delegate_to: localhost
|
||||
run_once: true
|
||||
listen: "notify monitoring"
|
||||
when: role_template_monitoring_enabled
|
||||
- name: reload systemd
|
||||
command: systemctl daemon-reexec
|
||||
|
||||
Reference in New Issue
Block a user