How to use Multiple choice

Hi there,
i am pretty at the beginning of my use of ansible.
But I have a woring script to use ansible to put fresh installed ubuntu machines into our AD to use groups to manage user access.
Now this script has to grow for more groups to come.
So I thought multiple choice is a cool thing.
So I placed this in my playbook.

"

  • name: “institute”
    prompt: “Wähle das Institut. \n1- Institute1\n2- Institute2\n”
    private: no
    "

and I use this in the role as follows
"

  • name: make admins sudo
    ansible.builtin.lineinfile:
    dest: /etc/sudoers
    line: ‘% Name_of_the_AD-Group ALL=(ALL:ALL) ALL’
    state: present
    insertafter: ‘%sudo ALL=(ALL:ALL) ALL’
    when: ( institute == “1” )
    "
    The Error is as follows:
    fatal: [xxx.xxx.xxx.xxx]: FAILED! => {
    “changed”: false,
    “invocation”: {
    “module_args”: {
    “_raw_params”: “realm permit --groups ‘Name_of_the_AD-Group’”,
    “_uses_shell”: true,
    “argv”: null,
    “chdir”: null,
    “creates”: null,
    “executable”: null,
    “removes”: null,
    “stdin”: null,
    “stdin_add_newline”: true,
    “strip_empty_ends”: true,
    “warn”: false,
    “when”: “( institute == "1" )”
    }
    }
    }

MSG:

Unsupported parameters for (ansible.legacy.command) module: when. Supported parameters include: strip_empty_ends, warn, _uses_shell, stdin, removes, stdin_add_newline, chdir, argv, creates, executable, _raw_params.

Anybody a Tip for me?

Outdent your “when:” line. It (“when”) is a task parameter, not a “command” parameter.