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

46 lines
1.2 KiB
YAML
Raw Normal View History

2021-07-19 19:00:08 +02:00
---
- name: Upgrade hosts
hosts: all
become: yes
2021-07-20 12:20:14 +02:00
vars:
ignore_pkg: [postgresql, postgresql-libs, linux-hardened, linux-headers, linux-api-headers]
2021-07-19 19:00:08 +02:00
tasks:
- name: Full system upgrade
pacman:
update_cache: yes
upgrade: yes
2021-07-20 12:20:14 +02:00
register: syu
changed_when: syu.packages is not subset(ignore_pkg)
2021-07-19 19:00:55 +02:00
2021-07-19 19:00:08 +02:00
- name: Upgrade Dockers
2021-07-20 12:20:14 +02:00
hosts: aconcagua
2021-07-19 19:00:08 +02:00
tasks:
2021-07-20 12:20:14 +02:00
- name: Docker pull Photoview
command:
2021-07-22 17:17:16 +02:00
chdir: ~/Docker/photoview
2021-07-20 12:20:14 +02:00
cmd: docker-compose pull -q
register: pv_pull
2021-07-22 17:17:16 +02:00
changed_when: pv_pull.stdout != '' or pv_pull.stderr != ''
2021-07-20 12:20:14 +02:00
notify:
- Restart Photoview
- name: Docker pull Vaultwarden
ansible.builtin.command:
chdir: ~/Docker/vaultwarden
cmd: docker-compose pull -q
register: vw_pull
2021-07-22 17:17:16 +02:00
changed_when: vw_pull.stdout != '' or vw_pull.stderr != ''
2021-07-20 12:20:14 +02:00
notify:
- Restart Vaultwarden
handlers:
- name: Restart Photoview
ansible.builtin.command:
2021-07-23 08:31:04 +02:00
chdir: ~/Docker/photoview
2021-07-20 12:20:14 +02:00
cmd: docker-compose up -d
- name: Restart Vaultwarden
ansible.builtin.command:
2021-07-19 19:00:08 +02:00
chdir: ~/Docker/vaultwarden
2021-07-20 12:20:14 +02:00
cmd: docker-compose up -d