[yaVDR-ansible] Installation hängt an mehreren Stellen

  • Hallo,


    da die Hardware meines VDRs den Geist aufgegeben hat, musste neue her.

    In dem Zuge will ich ihn auch komplett neu aufsetzten. Entschieden habe ich mich für yaVDR mit Ansible.


    Mein Ansible Controller läuft auf ansible.domain.tld. Der VDR auf vdr.domain.tld.


    Das Git Repository habe ich auf den Controller gecloned.

    Anschließend den VDR Host ins Inventory aufgenommen und im Playbook unter host: eingetragen


    Wenn ich das Playbook ausführe, erhalte ich mehrere Fehler


    1)

    Code
    TASK [yavdr-common : create media directories] ************************************************************************************************************************************
    fatal: [vdr.nottebrok.net]: FAILED! => {"msg": "Unable to look up a name or access an attribute in template string ({{ media_dirs|dict2items }}).
    Make sure your variable name does not contain invalid characters like '-': dict2items requires a dictionary, got <class 'ansible.template.AnsibleUndefined'> instead."}

    Das habe durch manuelles Anlegen der Verzeichnisse umschifft, würde aber gerne die Ursache verstehen.


    2)

    Code
    TASK [vdr : vdr configuration | copy remote.conf if it doesn't exist yet] *********************************************************************************************************
    fatal: [vdr.nottebrok.net]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'confdir'
    The error appears to be in '/var/lib/ansible/ansible/playbooks/vdr/yavdr/yavdr-ansible/roles/vdr/tasks/main.yml': line 84, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
    The offending line appears to be:
    - name: \"vdr configuration | copy remote.conf if it doesn't exist yet\"\n  ^ here\n"}

    Um diesen Fehler zu umgehen, habe ich in der Task alles zu den Konfigurationsdateien auskommentiert.

    Fehler ist aber wieder ähnlich wie oben. Es wird ein Dictionary nicht richtig aufgelöst.


    3)

    Code
    TASK [nfs-server : create /etc/exports] *******************************************************************************************************************************************
    An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'media_dirs' is undefined
    fatal: [vdr.nottebrok.net]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'media_dirs' is undefined"}

    Verstehe ich nicht. "media_dirs" ist in den Vars vorhanden. Auch auskommentiert, damit es erstmal weiter geht


    4)

    Code
    TASK [yavdr-remote : configure vdr to read from a lircd-compatible socket] ********************************************************************************************************
    An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'frontend' is undefined
    fatal: [vdr.nottebrok.net]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'frontend' is undefined"}

    Hier beschwert sich Ansible über die Variable im Template.


    Könnte mir bitte jemand helfen diese Fehler zu beheben.


    Guido

    HW: Gigabyte EP41-UD3L | Core2Duo 7400 | 2GB Kingston | MSI N220GT-MD1GZ (passiv) | L4M-Twin S2 ver 6.5 mit Flex S2 | Silverstone LC16M mit iMON VFD | Samsung LE46B750
    SW: Xubuntu 14.04 3.13.0-24 | NVIDIA 304.117 | vdr 2.1.6 | softhddevice | inputlirc | lcdproc

  • Kannst du mal bitte deine host_vars/localhost bzw. falls du die nicht angelegt hast die group_vars/all zeigen? Für mich riecht das danach, dass da einige verschachtelte Werte in der Konfigurationsdatei nicht verfügbar sind - z.B. ist das confdir ein Key-Value Paar der Variable vdr: https://github.com/yavdr/yavdr…/focal/group_vars/all#L35

    yaVDR-Dokumentation (Ceterum censeo enchiridia esse lectitanda.)

  • Ich habe die Konfiguration etwas angepasst, da ich ja bereits ein Inventory hatte


    Die group_vars/all habe ich in mein Inventory kopiert


    Code
    cp group_vars/all ~/ansible/inventories/production/host_vars/vdr/yavdr_07-vars.yml

    Darin habe ich nur host: vdr.domain.tld geändert


    Einige andere Dateien habe ich (hoffentlich korrekt) aus dem Weg geräumt

    Code
    mv ansible.cfg xxx_ansible.cfg
    mv group_vars/ xxx_group_vars
    mv hosts xxx_hosts
    mv localhost_inventory xxx_localhost_inventory

    HW: Gigabyte EP41-UD3L | Core2Duo 7400 | 2GB Kingston | MSI N220GT-MD1GZ (passiv) | L4M-Twin S2 ver 6.5 mit Flex S2 | Silverstone LC16M mit iMON VFD | Samsung LE46B750
    SW: Xubuntu 14.04 3.13.0-24 | NVIDIA 304.117 | vdr 2.1.6 | softhddevice | inputlirc | lcdproc

  • Also lässt du das Playbook nicht aus dem Git-Ordner heraus laufen - dann würde ich vermuten, dass da irgendetwas an der Organisation des Inventory nicht passt - https://docs.ansible.com/ansib…li/ansible-inventory.html sollte dir zeigen, was da an Variablen für ein Playbook bzw. Host definiert ist.

    yaVDR-Dokumentation (Ceterum censeo enchiridia esse lectitanda.)

  • Der Name des Hostverzeichnis war falsch :wand


    falsch:

    Code
    ~/ansible/inventories/production/host_vars/vdr/yavdr_07-vars.yml

    richtig:

    Code
    ~/ansible/inventories/production/host_vars/vdr.domain.tld/yavdr_07-vars.yml

    Danke für den Schubser

    HW: Gigabyte EP41-UD3L | Core2Duo 7400 | 2GB Kingston | MSI N220GT-MD1GZ (passiv) | L4M-Twin S2 ver 6.5 mit Flex S2 | Silverstone LC16M mit iMON VFD | Samsung LE46B750
    SW: Xubuntu 14.04 3.13.0-24 | NVIDIA 304.117 | vdr 2.1.6 | softhddevice | inputlirc | lcdproc

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!