Updated upgrade.yml with task status

This commit is contained in:
Edgar P. Burkhart 2021-07-20 12:20:14 +02:00
parent a449d3f3db
commit 8819fa68bd
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -2,20 +2,44 @@
- 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: all
hosts: aconcagua
tasks:
- name: Docker upgrade Photoview
ansible.builtin.shell:
- name: Docker pull Photoview
command:
chdir: ~/Docker/photoview-docker
cmd: docker-compose pull -q && docker-compose up -d
- name: Docker upgrade Vaultwarden
ansible.builtin.shell:
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 && docker-compose up -d
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