Reputation: 57
When i use yum module in an ansible playbook to install maven on the target server, i get this error message: No package matching 'maven' found available, installed or updated
But when i log on to the target server, i could successfully install maven with yum install maven
Not sure what is wrong with the playbook. Where should i look for any further logs or how to resolve this issue?
playbook task looks like:
- name: install maven (and other packages if needed)
yum: name=maven state=latest
become: true
Upvotes: 1
Views: 4744
Reputation: 7907
Oh, I found that yum module doesn't update cache by default, but rpm (on command line) does.
Try to add update_cache: yes
to yum module parameters.
Upvotes: 1