Use opts hash

https://dev.metasploit.com/redmine/issues/8498