update-system/tasks/update-Debian.yml
Tobias Trabelsi f4dde30416
Some checks failed
continuous-integration/drone/push Build is failing
need to update test images.
failed options are currently disabled
2021-01-30 20:21:27 +01:00

46 lines
1.1 KiB
YAML

---
- name: Update apt keys
become: yes
command: apt-key update
when: ansible_os_family == "Debian" or ansible_os_family == "OSMC"
- name: Upgrade all packages to the latest version
become: yes
apt:
upgrade: dist
update_cache: yes
cache_valid_time: 3600
environment:
PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin"
when: ansible_os_family == "Debian" or ansible_os_family == "OSMC"
- name: Remove useless packages from the cache
become: yes
become_method: sudo
ignore_errors: true
command: >
apt-get autoremove -y
environment:
PATH: "{{ ansible_env.PATH }}:/sbin:/usr/sbin"
when: ansible_os_family == "Debian" or ansible_os_family == "OSMC"
- name: install packages
become: yes
apt:
name: "{{ item }}"
state: present
with_items:
- "{{ package_list }}"
when: install and ansible_os_family == "Debian"
#- name: Check if a reboot is required
# register: reboot_required_file
# stat:
# path: /var/run/reboot-required get_md5=no
#
#- name: Needs Reboot
# debug:
# msg: "Restart Required!!"
# ignore_errors: true
# when: reboot_required_file.stat.exists == true