Updating system packages playbook
This commit is contained in:
parent
e759802ce6
commit
d483f5ed72
3
ansible/ansible.cfg
Normal file
3
ansible/ansible.cfg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[defaults]
|
||||||
|
stdout_callback = yaml
|
||||||
|
|
20
ansible/playbooks/update.yml
Normal file
20
ansible/playbooks/update.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Purpose: General update to the system to keep packages up to date
|
||||||
|
---
|
||||||
|
- hosts: webhost
|
||||||
|
remote_user: webadmin
|
||||||
|
tasks:
|
||||||
|
- name: Informational Dump of what is upgradeable
|
||||||
|
ansible.builtin.command: apt list --upgradable
|
||||||
|
register: pkg
|
||||||
|
- name: Show list of packages to upgrade
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ pkg.stdout_lines }}"
|
||||||
|
- name: Update the packages at the system level to the latest versions
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user