September 2018
Beginner to intermediate
214 pages
5h 53m
English
This use case is built to update and clean a Linux-based host under the two main families: Debian and Red Hat. The task should be able to update the software list index, install any available updates, remove unnecessary packages, clean the package manager cache, and, finally, restart the hosts if required. This playbook can be used on either physical or virtual Linux hosts that are accessible to the Ansible management server.
The code for this playbook is as follows:
---- name: Update and clean up Linux OS hosts: Linux become: yes gather_facts: yes tasks: - name: Update Debian Linux packages with Index updated apt: upgrade: dist update_cache: yes when: ansible_os_family == "Debian" - name: Update Red ...
Read now
Unlock full access