Updated to work with sudo

This commit is contained in:
2026-04-27 16:26:53 -07:00
parent 960f8fa2ba
commit 6b82b1e458

View File

@@ -38,7 +38,7 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
- name: Trigger config backup via PHP (writes to /cf/conf/backup/) - name: Trigger config backup via PHP (writes to /cf/conf/backup/)
ansible.builtin.raw: > ansible.builtin.raw: >
php -r "require_once('/etc/inc/config.inc'); sudo php -r "require_once('/etc/inc/config.inc');
require_once('/etc/inc/util.inc'); require_once('/etc/inc/util.inc');
backup_config();" backup_config();"
register: _backup_result register: _backup_result
@@ -73,7 +73,7 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
- name: "UPGRADE — Running pfSense-upgrade on {{ inventory_hostname }}" - name: "UPGRADE — Running pfSense-upgrade on {{ inventory_hostname }}"
ansible.builtin.raw: > ansible.builtin.raw: >
{{ pfsense_upgrade_bin }} -d -y 2>&1 sudo {{ pfsense_upgrade_bin }} -d -y 2>&1
register: _upgrade_result register: _upgrade_result
async: 600 # pfSense upgrades can take several minutes async: 600 # pfSense upgrades can take several minutes
poll: 10 poll: 10
@@ -97,4 +97,4 @@
delay: 30 delay: 30
timeout: "{{ reboot_timeout }}" timeout: "{{ reboot_timeout }}"
sleep: 10 sleep: 10
when: auto_reboot | bool when: auto_reboot | bool