Procházet zdrojové kódy

added a pull-images role

Grega Bremec před 1 rokem
rodič
revize
50da28c18a

+ 2 - 0
pre-flight.yml

@@ -10,4 +10,6 @@
       tags: check
     - role: fix-operators
       tags: fix
+    - role: pull-images
+      tags: prep
 ...

+ 7 - 0
roles/pull-images/defaults/main.yml

@@ -0,0 +1,7 @@
+---
+# needs some images to pull, specified in an array
+pull_images:
+  - name: registry.access.redhat.com/ubi8/ubi-minimal:latest
+    tag_latest: no
+    auth_file: registry-rh-auth
+...

+ 3 - 0
roles/pull-images/files/emptyauth

@@ -0,0 +1,3 @@
+{
+	"auths": {}
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
roles/pull-images/files/registry-rh-auth


+ 23 - 0
roles/pull-images/tasks/main.yml

@@ -0,0 +1,23 @@
+---
+# Pulls any images that will be needed on workstation during the training.
+- name: make sure all the required images are there
+  containers.podman.podman_image:
+    name: "{{ item.name }}"
+    auth_file: "{{ 'roles/' + role_name + '/files/' + (item.auth_file | default('emptyauth')) }}"
+    pull: true
+    push: false
+    state: present
+  loop: "{{ pull_images }}"
+  loop_control:
+    label: "{{ item.name }}"
+
+- name: if so desired, tag the image as latest
+  containers.podman.podman_tag:
+    image: "{{ item.name }}"
+    target_names:
+      - "{{ item.name | regex_replace(':.*$', ':latest') }}"
+  when: item.tag_latest
+  loop: "{{ pull_images }}"
+  loop_control:
+    label: "{{ item.name }}"
+...

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů