This repository has been archived on 2021-08-22. You can view files and clone it, but cannot push or open issues or pull requests.
aconcagua-ansible/upgrade.yml

45 lines
1.1 KiB
YAML

---
- name: Upgrade hosts
hosts: all
become: yes
vars:
ignore_pkg: [postgresql, postgresql-libs, linux-hardened, linux-headers, linux-api-headers]
tasks:
- name: Full system upgrade
pacman:
update_cache: yes
upgrade: yes
register: syu
changed_when: syu.packages is not subset(ignore_pkg)
- name: Upgrade Dockers
hosts: aconcagua
tasks:
- name: Docker pull Photoview
command:
chdir: ~/Docker/photoview-docker
cmd: docker-compose pull -q
register: pv_pull
changed_when: "pv_pull.stdout != ''"
notify:
- Restart Photoview
- name: Docker pull Vaultwarden
ansible.builtin.command:
chdir: ~/Docker/vaultwarden
cmd: docker-compose pull -q
register: vw_pull
changed_when: "vw_pull.stdout != ''"
notify:
- Restart Vaultwarden
handlers:
- name: Restart Photoview
ansible.builtin.command:
chdir: ~/Docker/photoview-docker
cmd: docker-compose up -d
- name: Restart Vaultwarden
ansible.builtin.command:
chdir: ~/Docker/vaultwarden
cmd: docker-compose up -d