galaxy_collection icon indicating copy to clipboard operation
galaxy_collection copied to clipboard

Error using Role module

Open nodje opened this issue 9 months ago • 1 comments

Using 2.0.2, I get the following error:

TASK [infra.ah_configuration.role : Add Automation Hub role] *********************************************************************************************************************************************************************************************
[WARNING]: TASK: infra.ah_configuration.role : Add Automation Hub role: The loop variable '__role' is already in use. You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and
unexpected behavior.
fatal: [localhost]: FAILED! => {"msg": "The field 'tags' has an invalid value, which includes an undefined variable. The error was: 'dict object' has no attribute 'tags'. 'dict object' has no attribute 'tags'\n\nThe error appears to be in '/root/.ansible/collections/ansible_collections/infra/ah_configuration/roles/role/tasks/main.yml': line 4, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# Create AH Role\n- name: Add Automation Hub role\n  ^ here\n"}

With the following config:

---
ah_configuration_dispatcher_roles:
  - {role: group, var: ah_groups, tags: groups}
  - {role: user, var: ah_users, tags: users}
  - {role: role, var: ah_roles, tags: roles}
...

---
ah_roles:
  - name: galaxy.DBA
    description: DBA role
    perms:
      - modify_ansible_repo_content
      - sign_ansiblerepository
...

nodje avatar Sep 12 '23 09:09 nodje