Else try these–>
update ansible to the last a version >= 2.4.0.0. or later
Type this command with superuser like
1. Sudo su -
When you run sudo su - then you see as root user and then type fail2ban command.
Other references- Error while setting up bench to production mode
Hope it helps !!