Files
ansible-msp-automations/roles/pfsense_upgrade/tasks/backup_webhook.yml
2026-04-29 11:45:53 -07:00

23 lines
651 B
YAML

- name: Capture current config.xml for backup
ansible.builtin.raw: |
cat /conf/config.xml
register: _config_xml
when: perform_upgrade | bool
- name: Send config to webhook (if webhook URL provided)
uri:
url: "{{ n8n_webhook_url }}"
method: POST
body: |
{
"client_id": "{{ client_id }}",
"hostname": "{{ inventory_hostname }}",
"timestamp": "{{ ansible_date_time.iso8601 }}",
"config_xml": "{{ _config_xml.stdout | b64encode }}"
}
body_format: json
when:
- perform_upgrade | bool
- n8n_webhook_url is defined
- n8n_webhook_url | length > 0
delegate_to: localhost