|
17 | 17 | set_fact:
|
18 | 18 | service_docker_image: "{{ service_configuration.image.split(':') | first }}"
|
19 | 19 | service_docker_image_tag: "{{ service_configuration.image.split(':') | last }}"
|
20 |
| - when: service_exists is defined and service_configuration.autoupdate |
| 20 | + when: service_exists and service_configuration.autoupdate |
21 | 21 |
|
22 | 22 | - name: Get latest version for this service
|
23 | 23 | set_fact:
|
24 | 24 | new_service_docker_image_tag: "{{ update_data[service_configuration.network][service_configuration.service] | default(update_data['stratis'][service_configuration.service]) | last }}"
|
25 |
| - when: service_exists is defined and service_configuration.autoupdate and service_configuration.service != 'CustomService' |
| 25 | + when: service_exists and service_configuration.autoupdate and service_configuration.service != 'CustomService' |
26 | 26 |
|
27 | 27 | - name: Build new image tag
|
28 | 28 | set_fact:
|
29 | 29 | new_service_configuration_fraction:
|
30 | 30 | image: "{{ service_docker_image }}:{{ new_service_docker_image_tag }}"
|
31 |
| - when: service_exists is defined and service_configuration.autoupdate |
| 31 | + when: service_exists and service_configuration.autoupdate |
32 | 32 |
|
33 | 33 | - name: Update configuration
|
34 | 34 | set_fact:
|
35 | 35 | new_service_configuration: "{{ service_configuration | combine(new_service_configuration_fraction) }}"
|
36 |
| - when: service_exists is defined and service_configuration.autoupdate and (new_service_docker_image_tag != service_docker_image_tag or new_service_docker_image_tag == 'latest') |
| 36 | + when: service_exists and service_configuration.autoupdate and (new_service_docker_image_tag != service_docker_image_tag or new_service_docker_image_tag == 'latest') |
37 | 37 |
|
38 | 38 | - name: Write configuration
|
39 | 39 | copy:
|
|
42 | 42 | owner: "root"
|
43 | 43 | group: "root"
|
44 | 44 | mode: 0644
|
45 |
| - when: service_exists is defined and service_configuration.autoupdate and (new_service_docker_image_tag != service_docker_image_tag or new_service_docker_image_tag == 'latest') |
| 45 | + when: service_exists and service_configuration.autoupdate and (new_service_docker_image_tag != service_docker_image_tag or new_service_docker_image_tag == 'latest') |
46 | 46 | become: yes
|
47 | 47 |
|
48 | 48 | - name: Update configuration file modification time
|
49 | 49 | file:
|
50 | 50 | path: "/etc/stereum/services/{{ item }}.yaml"
|
51 | 51 | state: touch
|
52 |
| - when: service_exists is defined and service_configuration.autoupdate and (new_service_docker_image_tag != service_docker_image_tag or new_service_docker_image_tag == 'latest') |
| 52 | + when: service_exists and service_configuration.autoupdate and (new_service_docker_image_tag != service_docker_image_tag or new_service_docker_image_tag == 'latest') |
53 | 53 | become: yes
|
54 | 54 |
|
55 | 55 | # EOF
|
0 commit comments