update_hosts.yml with motd, login page and rsyslog config
This commit is contained in:
18
ansible-5/roles/common/tasks/apply_updates.yml
Normal file
18
ansible-5/roles/common/tasks/apply_updates.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
# update packages to latest
|
||||
|
||||
- name: run apt updates
|
||||
apt:
|
||||
upgrade: dist
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: check for reboot required
|
||||
stat:
|
||||
path: /var/run/reboot-required
|
||||
register: reboot_required
|
||||
|
||||
- name: reboot after updates
|
||||
reboot:
|
||||
when: reboot_required.stat.exists
|
||||
Reference in New Issue
Block a user