Amit Joshi
Amit Joshi

Reputation: 57

No package matching 'maven' found available, installed or updated.

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

Answers (1)

George Shuklin
George Shuklin

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

Related Questions