I am newbie in Ansible and I would like to upgrade all of our environment's kernel. I've checked the modules but I have couple of questions about it. My main point is upgrade only kernel. Some VMs have another repositories like web servers, nosql etc. So if I write the playbook like this:
- name: Disable all repositories except rhel-7-server-rpms
rhsm_repository:
name: rhel-7-server-rpms
purge: True
- name: YUM Update
yum:
name: '*'
state: latest
First, It disables all repositories except rhel-7server-rpms which has the latest kernel version. Then, it will start yum update procedure. First question is, does it work correctly like I want, and do I need to add one more module between them like:
-name: Subscription Manager Refresh
command: subscription-manager refresh or yum clear all
Secondly, does it solve my problem with one module:
- name: update specific repo from rpm
yum:
name: rhel-7-server-rpms
state: latest
If one or both of them works correctly, which one should I use?
Thanks in advence.