Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Sep 7, 2019
1 parent f7c534b commit 673e1a9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion menu/alias/templates/update
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
sudo apt update -y
sudo ansible-playbook /opt/plexguide/menu/pg.yml --tags update
5 changes: 5 additions & 0 deletions menu/functions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ updateprime() {
pginstall() {
updateprime
bash /opt/plexguide/menu/pggce/gcechecker.sh
update
# core pythonstart
core aptupdate
core alias &>/dev/null &
Expand Down Expand Up @@ -123,6 +124,10 @@ alias() {
ansible-playbook /opt/plexguide/menu/alias/alias.yml
}

update() {
ansible-playbook /opt/plexguide/menu/pg.yml --tags update &>/dev/null &
}

aptupdate() {
yes | apt-get update
yes | apt-get install software-properties-common
Expand Down
1 change: 1 addition & 0 deletions menu/pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
- { role: autodelete, tags: ['autodelete'] }
- { role: clean, tags: ['clean'] }
- { role: clean-encrypt, tags: ['clean-encrypt'] }
- { role: update, tags: ['update'] }
24 changes: 24 additions & 0 deletions menu/roles/update/task/main.yml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- hosts: all
environment:
LC_ALL: C
LANG: C

tasks:

- name: Update APT package cache
apt: update_cache=yes cache_valid_time=600

- name: Upgrade APT to the latest packages
apt: upgrade=dist
register: apt_result

- name: Autoremove unused packages
command: apt-get -y autoremove
register: apt_result
changed_when: "'packages will be REMOVED' in apt_result.stdout"

- name: Purge residual kernel packages
shell: apt-get remove -y --purge $(dpkg -l | grep "^rc\s*linux-image-" | awk '{print $2}' | tr '\n' ' ')
register: apt_result
changed_when: "'packages will be REMOVED' in apt_result.stdout"

0 comments on commit 673e1a9

Please sign in to comment.