Updated upgrade.yml with task status
This commit is contained in:
parent
a449d3f3db
commit
8819fa68bd
1 changed files with 31 additions and 7 deletions
38
upgrade.yml
38
upgrade.yml
|
@ -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
|
||||
|
|
Reference in a new issue