prompting for password

I am attempting to do a db update.
I have tried using the following command

  • name: run mysqlupgrade
    command: 'mysql_upgrade -u root -p
    it hangs waiting for the password
    so I tried

  • name: run mysqlupgrade
    expect:
    command: 'mysql_upgrade -u root -p
    responses: (?i) Enter password" “”

The error I get is “argument responses if of type <type ‘str’> and we were unable to convert to dict: dictionary requested could not pars JSON or key=value”

Any help would be appreciated.

Dave

Your responses need to be a dictinary

  - name: run mysqlupgrade
    expect:
      command: 'mysql_upgrade -u root -p
      responses:
        Enter password: <password>