I have a list of rpm packages including dependencies. Locally I do rpm -i *.rpm and it works fine. How do I use the -i flag when I use chef's rpm_package resource. I cant use yum as we are trying something that works offline.
Just need a chef way for rpm -i.
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:Ruby it
Slightly less straightforward, you can use Ruby's native file system functions to traverse the tree:
This will iterate over each item in the given path that matches the glob.