How to pass command line arguments when installing a rpm file

shell is batch only, you want
http://docs.ansible.com/ansible/latest/expect_module.html