소스 검색

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

Grega Bremec 1 개월 전
부모
커밋
2e99ff7718
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      playbooks/45-oc-mirror.yml

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

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