home-server/roles/cleanupdate/tasks/main.yml

49 lines
1.5 KiB
YAML
Raw Normal View History

2018-09-03 20:06:05 +02:00
---
# The home-server project produces a multi-purpose setup using Ansible.
2023-07-30 19:31:56 +02:00
# Copyright © 20182023 Y. Gablin, under the GPL-3.0-or-later license.
2018-09-03 20:06:05 +02:00
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
### UPSTREAM BEGIN ⇒ ###
- name: pull prerequisites from upstream
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=upstream.yml
vars:
msg: pacman clean update
### ⇐ UPSTREAM BEGIN ###
- name: check for unused software
shell: |
pacman -Qtdq || true
register: unused_software
changed_when: false
- name: remove unused software
command: |
pacman -Rns --noconfirm --noprogressbar {{unused_software.stdout}}
when:
- (unused_software.stdout is defined)
- (unused_software.stdout != "")
- name: clean packages metadata and cache
command: |
pacman -Sc --noconfirm --noprogressbar
changed_when: false
- name: update installed software
command: |
pacman -Syuq --noconfirm --noprogressbar --ignore {{software_to_ignore}}
register: update_result
changed_when:
- (update_result.stdout is defined)
- (update_result.stdout.find('there is nothing to do') == -1)
2023-07-30 19:36:11 +02:00
- name: setup arch-chroot (dev)
include_role: name=dev.inc allow_duplicates=true tasks_from=arch-chroot.yml
when: (env == 'dev')
2018-09-03 20:06:05 +02:00
### UPSTREAM END ⇒ ###
- name: merge upstream
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=merge.yml
vars:
msg: pacman clean update
### ⇐ UPSTREAM END ###