For use with eg CentOS.

Assumes you have a file /etc/ansible/hosts with groups and members already configured.

A properly formatted .yml-file can be found at the end of the article.

 

yum.update.yml

---
- hosts: centos-cli
gather_facts: no
tasks:

# Alternative 1
# - name: upgrade all packages
# yum:
# name'*'
# state=latest
# exclude=kmod*,nvidia*
#
# Alternative 2
# - name: upgrade some packages
# yum: name='tzdata' state=latest; name='firefox' state=latest
#
# On error pending transactions clean up remote host with
# yum-complete-transaction --cleanup-only
#
# Alternative 3
- name: upgrade some packages v2
yum: name={{ item }} state=latest
with_items:
- tzdata*
- firefox
...

 

 

 

 

 

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext