-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathimport-images.yml
49 lines (41 loc) · 2 KB
/
import-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
# Causes re-deployment of components with newer image available.
- name: Import newer images metadata from registry into image streams
hosts: all
vars:
service: "{{ lookup('env', 'SERVICE') | default('packit', True) }}"
deployment: "{{ lookup('env', 'DEPLOYMENT') }}"
with_fedmsg: true
with_dashboard: true
with_tokman: true
with_fluentd_sidecar: false
tasks:
- name: Include variables
ansible.builtin.include_vars: ../vars/{{ service }}/{{ deployment }}.yml
- name: Login
ansible.builtin.command: oc login {{ host }} --token={{ api_key }} --insecure-skip-tls-verify
# it doesn't change anything, so don't report 'changed'
changed_when: false
- name: Check/import newer fluentd image into image stream
ansible.builtin.command: oc import-image is/fluentd:{{ deployment }} -n {{ project }}
when: with_fluentd_sidecar
changed_when: true
- name: Check/import newer packit-service image into image stream
ansible.builtin.command: oc import-image is/packit-service:{{ deployment }} -n {{ project }}
changed_when: true
- name: Check/import newer packit-worker image into image stream
ansible.builtin.command: oc import-image is/packit-worker:{{ deployment }} -n {{ project }}
changed_when: true
- name: Check/import newer packit-service-fedmsg image into image stream
ansible.builtin.command: oc import-image is/packit-service-fedmsg:{{ deployment }} -n {{ project }}
when: with_fedmsg
changed_when: true
- name: Check/import newer dashboard image into image stream
ansible.builtin.command: oc import-image is/packit-dashboard:{{ deployment }} -n {{ project }}
when: with_dashboard
changed_when: true
- name: Check/import newer tokman image into image stream
ansible.builtin.command: oc import-image is/tokman:{{ deployment }} -n {{ project }}
when: with_tokman
changed_when: true