ben-grande / qusal

Salt Formulas for Qubes OS.
14 stars 6 forks source link

sys-usb fails to install due to Jinja syntax error #82

Closed c0mmando closed 4 days ago

c0mmando commented 6 days ago

Commitment

I confirm that I have read the following resources:

Software version

05e73f9

Brief summary

Attempting to install sys-usb fails for sys-usb-set-rpc-policy due to Jinja syntax error.

$ qvm-mgmt tpl-sys-usb
GLOBAL
management_dispvm: dvm-mgmt
management_dispvm template: tpl-mgmt
management_dispvm template features:
  os-distribution: fedora
  os-version: 40
  template-name: fedora-40-minimal
  template-release: 202404260902

WANTED
qube: tpl-sys-usb
class: TemplateVM
  template-name: debian-12-minimal
  template-release: 202308031621
  os-distribution: debian
  os-version: 12
tpl-sys-usb management_dispvm: dvm-mgmt

Steps to reproduce

Iterate through steps as listed in sys-usb README

Expected behavior

/etc/qubes/policy.d/80-sys-usb.policy is created and working as intended

Actual behavior

----------
          ID: sys-usb-set-rpc-policy
    Function: file.managed
        Name: /etc/qubes/policy.d/80-sys-usb.policy
      Result: False
     Comment: Unable to manage file: Jinja syntax error: unexpected '%'; line 9

              ---
              [...]

              ## Do not modify this file, create a new policy with with a lower number in the
              ## file name instead. For example `30-user.policy`.

              # Input {{{
              {% if salt['pillar.get']('qvm:sys-usb:mouse-action', 'ask') == 'ask' -%}    <======================
                {% set mouse_action = 'ask default_target=dom0' -%}
              {% elif salt['pillar.get']('qvm:sys-usb:mouse-action', 'ask') == 'allow' -%}
                {%- set mouse_action = 'allow' -%}
              {% else -%}
                {%- set mouse_action = 'deny' -%}
              [...]
              ---
     Started: 04:47:24.594302
    Duration: 11.765 ms
     Changes:   

Summary for local
-------------
Succeeded: 15 (changed=3)
Failed:     1
-------------
Total states run:     16
Total run time:   60.677 s

I'm not seeing any obvious issues with the syntax at https://github.com/ben-grande/qusal/blob/main/salt/sys-usb/files/admin/policy/default.policy