Fixed docker update
This commit is contained in:
parent
9952cc230b
commit
6de060842e
1 changed files with 11 additions and 7 deletions
18
upgrade.yml
18
upgrade.yml
|
@ -3,8 +3,8 @@
|
||||||
hosts: all
|
hosts: all
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
vars:
|
#vars:
|
||||||
ignore_pkg: [postgresql, postgresql-libs, linux-hardened, linux-headers, linux-api-headers]
|
#ignore_pkg: [postgresql, postgresql-libs, linux-hardened, linux-headers, linux-api-headers]
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Full system upgrade
|
- name: Full system upgrade
|
||||||
|
@ -12,25 +12,29 @@
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
upgrade: yes
|
upgrade: yes
|
||||||
register: syu
|
register: syu
|
||||||
changed_when: syu.packages is not subset(ignore_pkg)
|
#changed_when: syu.packages is not subset(ignore_pkg)
|
||||||
|
|
||||||
- name: Upgrade Dockers
|
- name: Upgrade Dockers
|
||||||
|
|
||||||
|
vars:
|
||||||
|
utd: "image is up to date"
|
||||||
|
|
||||||
hosts: aconcagua
|
hosts: aconcagua
|
||||||
tasks:
|
tasks:
|
||||||
- name: Docker pull Photoview
|
- name: Docker pull Photoview
|
||||||
command:
|
command:
|
||||||
chdir: ~/Docker/photoview
|
chdir: ~/Docker/photoview
|
||||||
cmd: docker-compose pull -q
|
cmd: docker-compose pull
|
||||||
register: pv_pull
|
register: pv_pull
|
||||||
changed_when: pv_pull.stdout != '' or pv_pull.stderr != ''
|
changed_when: utd not in pv_pull.stderr
|
||||||
notify:
|
notify:
|
||||||
- Restart Photoview
|
- Restart Photoview
|
||||||
- name: Docker pull Vaultwarden
|
- name: Docker pull Vaultwarden
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
chdir: ~/Docker/vaultwarden
|
chdir: ~/Docker/vaultwarden
|
||||||
cmd: docker-compose pull -q
|
cmd: docker-compose pull
|
||||||
register: vw_pull
|
register: vw_pull
|
||||||
changed_when: vw_pull.stdout != '' or vw_pull.stderr != ''
|
changed_when: utd not in vw_pull.stderr
|
||||||
notify:
|
notify:
|
||||||
- Restart Vaultwarden
|
- Restart Vaultwarden
|
||||||
|
|
||||||
|
|
Reference in a new issue