Procházet zdrojové kódy

some weird stuff going on with db restore; keep debugging and TODOs in for now

Grega Bremec před 1 měsícem
rodič
revize
2e99ff7718
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      playbooks/45-oc-mirror.yml

+ 6 - 0
playbooks/45-oc-mirror.yml

@@ -27,6 +27,9 @@
 
     - debug: var=quay_mft
 
+    - debug:
+        msg: "{{ (quay_mft.stderr | ansible.builtin.regex_search('FATAL:  database .* does not exist')) }}"
+
     - name: Remember the number of image manifests in quay.
       ansible.builtin.set_fact:
         quay_nmft: "{{ quay_mft.stdout_lines[0] | default(0) | trim | int }}"
@@ -52,8 +55,10 @@
             name: postgresql
             command: psql -d postgres -U postgres -t -c 'CREATE DATABASE quay OWNER quay'
           when:
+            - quay_mft.rc > 0
             - (quay_mft.stderr | ansible.builtin.regex_search('FATAL:  database .* does not exist')) is defined
             - (quay_mft.stderr | ansible.builtin.regex_search('FATAL:  database .* does not exist')) != ""
+          # TODO: something is wrong with the above regex_searches
 
         - name: Create a temporary pgpass file
           ansible.builtin.copy:
@@ -96,6 +101,7 @@
           failed_when:
             - (quay_import.stderr | regex_search('FATAL')) is defined
             - (quay_import.stderr | regex_search('FATAL')) != ""
+          # TODO: what's up with no output, no rc, but still failed?!?
 
         - debug: var=quay_import