Skip to content

Commit 8737960

Browse files
committed
Automate System Updates
This patch adds an Ansible script to automate system updates via dnf-automatic.
1 parent 695a414 commit 8737960

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

autoupdate.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# vim: et:ts=2:sw=2:sts=2
3+
4+
- hosts: server
5+
become: yes
6+
tasks:
7+
- name: install dnf-automatic
8+
package:
9+
name: dnf-automatic
10+
11+
- name: configure automatic updates
12+
lineinfile:
13+
path: /etc/dnf/automatic.conf
14+
regexp: '^{{ item.key }}'
15+
line: '{{ item.key }} = {{ item.val }}'
16+
loop:
17+
- key: upgrade_type
18+
val: default
19+
- key: download_updates
20+
val: yes
21+
- key: apply_updates
22+
val: yes
23+
24+
- name: enable automatic updates
25+
service:
26+
name: dnf-automatic.timer
27+
state: started
28+
enabled: yes

0 commit comments

Comments
 (0)