salt-formulas / salt-formula-freeipa

Other
20 stars 35 forks source link

Rendering SLS 'base:freeipa.client' failed: Jinja syntax error: expected token ',', got 'integer'; line 20 on Salt 3005 (OneDir) #23

Closed ggiesen closed 1 year ago

ggiesen commented 1 year ago

While running a state.apply to join a Salt 3005 OneDir minion to FreeIPA, I receive the following error:

minion:
    Data failed to compile:
----------
    Rendering SLS 'base:freeipa.client' failed: Jinja syntax error: expected token ',', got 'integer'; line 20

---
[...]

freeipa_push_principal:
  file.managed:
    - name: /tmp/principal.keytab
    - source: {{ client.get("install_principal", {}).get("source", "salt://freeipa/files/principal.keytab") }}
    - mode: {{ client.get("install_principal", {}).get("mode", 0600) }}    <======================
    - user: {{ client.get("install_principal", {}).get("file_user", "root") }}
    - group: {{ client.get("install_principal", {}).get("file_group", "root") }}
    - unless:
      - ipa-client-install --unattended 2>&1 | grep "IPA client is already configured on this system"
freeipa_get_ticket:
[...]
---

Per the note on this page:

https://docs.saltproject.io/en/latest/ref/states/all/salt.states.file.html

Warning

When using a mode that includes a leading zero you must wrap the value in single quotes. If the value is not wrapped in quotes it will be read by YAML as an integer and evaluated as an octal.