2021-07-19 19:00:08 +02:00
|
|
|
---
|
|
|
|
- name: Upgrade hosts
|
|
|
|
hosts: all
|
|
|
|
become: yes
|
2021-07-20 12:20:14 +02:00
|
|
|
|
2021-08-22 09:42:26 +02:00
|
|
|
#vars:
|
|
|
|
#ignore_pkg: [postgresql, postgresql-libs, linux-hardened, linux-headers, linux-api-headers]
|
2021-07-20 12:20:14 +02:00
|
|
|
|
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
|
2021-08-22 09:42:26 +02:00
|
|
|
#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-08-22 09:42:26 +02:00
|
|
|
|
|
|
|
vars:
|
|
|
|
utd: "image is up to date"
|
|
|
|
|
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-08-22 09:42:26 +02:00
|
|
|
cmd: docker-compose pull
|
2021-07-20 12:20:14 +02:00
|
|
|
register: pv_pull
|
2021-08-22 09:42:26 +02:00
|
|
|
changed_when: utd not in pv_pull.stderr
|
2021-07-20 12:20:14 +02:00
|
|
|
notify:
|
|
|
|
- Restart Photoview
|
|
|
|
- name: Docker pull Vaultwarden
|
|
|
|
ansible.builtin.command:
|
|
|
|
chdir: ~/Docker/vaultwarden
|
2021-08-22 09:42:26 +02:00
|
|
|
cmd: docker-compose pull
|
2021-07-20 12:20:14 +02:00
|
|
|
register: vw_pull
|
2021-08-22 09:42:26 +02:00
|
|
|
changed_when: utd not in 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
|