Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Dec 6, 2019
1 parent c992963 commit 43818c4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions menu/roles/update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
force_apt_get: yes

- name: Fix filled /boot
#shell: apt-get remove `dpkg --list 'linux-image*' | grep ^ii | awk '{print $2}'\ | grep -v \`uname -r\``
shell: dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge

- name: Update APT package cache
Expand All @@ -82,6 +81,8 @@
register: apt_result
changed_when: "'packages will be REMOVED' in apt_result.stdout"



- name: updates $(hostname)
apt:
update_cache: yes
Expand All @@ -94,10 +95,10 @@
state: present
force_apt_get: yes

- name: Check if a reboot is required for $(hostname)
register: file
stat: path=/var/run/reboot-required get_md5=no
#- name: Check if a reboot is required for $(hostname)
# register: file
# stat: path=/var/run/reboot-required get_md5=no

- name: Reboot the server $(hostname)
command: /sbin/reboot
when: file.stat.exists == true
#- name: Reboot the server $(hostname)
# command: /sbin/reboot
# when: file.stat.exists == true

0 comments on commit 43818c4

Please sign in to comment.