You have two options:
Bash it
Just like you did in your question, you can use the bash
resource to execute the rpm command. This is not idempotent by default and is (obviously) not cross-platform:
bash 'rpm -i *.rpm' do
cwd '/path/to/that/directory'
end
Ruby it
Slightly less straightforward, you can use Ruby's native file system functions to traverse the tree:
Dir['/path/to/rpms/*.rpm'].each do |path|
rpm_package File.basename(path) do
source path
end
end
This will iterate over each item in the given path that matches the glob.