Skip to content

The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'platform_setup'. #5

@andresmmujica

Description

@andresmmujica

Hi, I had this issue while setting up an environment, it seems to be related to the 'platform_setup' key which should be 'platform_profile' instead.

TASK [xtoph_deploy : libvirt-setup: create default qcow directory] ************************************************************************************************************************************************ fatal: [localhost.localdomain]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'platform_setup'. 'dict object' has no attribute 'platform_setup'\n\nThe error appears to be in '/home/student/RHEL9-Workshop/roles/xtoph_deploy/tasks/libvirt-setup.yml': line 72, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"libvirt-setup: create default qcow directory\"\n ^ here\nThis one looks easy to fix. It seems that there is a value started\nwith a quote, and the YAML parser is expecting to see the line ended\nwith the same kind of quote. For instance:\n\n when: \"ok\" in result.stdout\n\nCould be written as:\n\n when: '\"ok\" in result.stdout'\n\nOr equivalently:\n\n when: \"'ok' in result.stdout\"\n"}

This is a patch that solves the issue against the main branch.

git diff
diff --git a/tasks/libvirt-setup.yml b/tasks/libvirt-setup.yml
index 0cb3fb2..f3535bf 100644
--- a/tasks/libvirt-setup.yml
+++ b/tasks/libvirt-setup.yml
@@ -71,7 +71,7 @@
 
 - name: "libvirt-setup: create default qcow directory"
   file:
-    path: "{{ xtoph_deploy.platform_setup.storage.default.qcow_dir }}"
+    path: "{{ xtoph_deploy.platform_profile.storage.default.qcow_dir }}"
     mode: "0775"
     state: directory
 
@@ -132,7 +132,7 @@
         name: libvirtd
         state: started
 
-  when: xtoph_deploy.platform_setup.nested_virt_enable == true
+  when: xtoph_deploy.platform_profile.nested_virt_enable == true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions