Ansible yum automation

From snippet wiki
Jump to navigation Jump to search

To automate updates on CentOS. Create a host group named centos and use this:

---
- hosts: centos
  tasks:

  - name: Update and upgrade centos packages
    yum:
      name: '*'
      state: latest