I found why : if I had the following configuration ip ssh password-auth to the switch, it is working.
From the cisco guide : Use the ip ssh password-auth Global Configuration mode command to enable password authentication of incoming SSH sessions.
The thing is normally when I connect to a switch by ssh, I am still asked for a user name and password after being connected before entering commands.
I tried the option authorize of the ios_command module but it's not working.
I could manually add this configuration of the ssh server on every switch but it is a long job to do.
Do you have any other solutions ?
Have a nice day !
Romain