unifi-utilities / ansible-udmp

Ansible Playbook for UDM/P on_boot-Script
GNU General Public License v3.0
44 stars 2 forks source link

undefined variable in curl command downloading onboot - package #5

Closed ghost closed 2 years ago

ghost commented 2 years ago

onboot_version dict object does not have the attribute stdout when query package version play is ran. I think the command's output isn't getting captured because podman exec isn't exiting cleanly.

I tested directly on udmpro CLI and here are the results:

# podman exec -it unifi-os dpkg-query --showformat='${Version}' --show udm-boot
dpkg-query: no packages found matching udm-boot
Error: non zero exit code: 1: OCI runtime error
#

unifi_onboot_download_uri is not defined in tasks/onboot.yml for play onboot - download package . I believe the variable should be initialized to: https://udm-boot.boostchicken.dev. I can make a pull request if you like.

mabunixda commented 2 years ago

The variable onboot_version should contain the current installed version, but if the command fails, the variable is not registered. this should be fixed with this commit

mabunixda commented 2 years ago

@chrisstinemetz so the issue should be fixed now.

If you want to update the udm boot version to 1.0.5-fix you have to define a playbook like this one:

---
- name: udmp setup
  hosts: < UNIFI_UDM_HOSTNAME >
  gather_facts: false
  roles:
    - role: udmp
      udm_onboot_version: 1.0.5
      udm_onboot_download_uri: "https://github.com/boostchicken/udm-utilities/releases/download/1.0.5-fix/udm-boot_1.0.5_all.deb"