From b20e07b82063f6fda729a0db424ddfd49d645997 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Tue, 10 Dec 2024 09:24:53 +0100 Subject: [PATCH 1/8] backup changes color --- roles/database/files/sql/idempotent/fworch-obj-import.sql | 5 ++++- roles/database/files/sql/idempotent/fworch-usr-import.sql | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/database/files/sql/idempotent/fworch-obj-import.sql b/roles/database/files/sql/idempotent/fworch-obj-import.sql index 4c06ee1fa..d951ec8fa 100644 --- a/roles/database/files/sql/idempotent/fworch-obj-import.sql +++ b/roles/database/files/sql/idempotent/fworch-obj-import.sql @@ -141,7 +141,10 @@ BEGIN SELECT INTO i_farbe color_id FROM stm_color WHERE color_name = LOWER(remove_spaces(to_import.obj_color)); RAISE DEBUG 'processing import_nwobj_single 4'; IF NOT FOUND THEN -- TODO: Fehlerbehandlung bzw. automat. Neuanlegen einer Farbe? - i_farbe := NULL; + SELECT INTO i_farbe color_id FROM stm_color WHERE color_name = 'black'; + IF NOT FOUND THEN + i_farbe := NULL; + END IF; -- IF to_import.obj_color IS NOT NULL THEN -- -- PERFORM add_data_issue(i_control_id, to_import.obj_color, NULL, NULL, NULL, NULL, 'nw obj color', 'undefined color in network object: ' || to_import.obj_color, NULL); -- END IF; diff --git a/roles/database/files/sql/idempotent/fworch-usr-import.sql b/roles/database/files/sql/idempotent/fworch-usr-import.sql index e2c641ca9..8204bf876 100644 --- a/roles/database/files/sql/idempotent/fworch-usr-import.sql +++ b/roles/database/files/sql/idempotent/fworch-usr-import.sql @@ -160,7 +160,10 @@ BEGIN END IF; SELECT INTO i_color_id color_id FROM stm_color WHERE color_name LIKE v_farbe; IF NOT FOUND THEN - RAISE NOTICE 'user color not found: %', v_user_name || ' color ' || v_farbe; + SELECT INTO i_farbe color_id FROM stm_color WHERE color_name = 'blackOld'; + IF NOT FOUND THEN + RAISE NOTICE 'user color not found: %', v_user_name || ' color ' || v_farbe; + END IF; END IF; IF NOT FOUND THEN PERFORM error_handling('ERR_COLOR_MISS', r_to_import.user_color); END IF; SELECT INTO existing_usr * FROM usr WHERE user_name=v_user_name AND mgm_id=i_mgm_id AND active; From 957ab478bfacc5ee72f420c0597440ffb2e14d2b Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 20 Dec 2024 12:32:10 +0100 Subject: [PATCH 2/8] chrome for pdf --- roles/lib/tasks/install_wkhtml_pdf.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/roles/lib/tasks/install_wkhtml_pdf.yml b/roles/lib/tasks/install_wkhtml_pdf.yml index 1fe4a87f0..11152dc19 100644 --- a/roles/lib/tasks/install_wkhtml_pdf.yml +++ b/roles/lib/tasks/install_wkhtml_pdf.yml @@ -52,4 +52,29 @@ become: true environment: "{{ proxy_env }}" + +# get google chrome for pdf generation +- name: get last known good versions of chrome to download + uri: + url: https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json + register: chrome_versions + +- name: parse latest stable versions for chrome + set_fact: + stable_chrome_versions: "{{ chrome_versions['json']['channels']['Stable']['downloads']['chrome'] }}" + +- block: + - name: install unzip + package: + name: unzip + state: present + + - name: download google chrome and unpack + unarchive: + src: "{{ stable_chrome_versions | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" + dest: /usr/local/bin + remote_src: yes + + become: true + environment: "{{ proxy_env }}" \ No newline at end of file From 74776390cec8a637c3053d0226d5eb26cff5b057 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 20 Dec 2024 12:37:09 +0100 Subject: [PATCH 3/8] revert changes --- roles/lib/tasks/install_wkhtml_pdf.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/roles/lib/tasks/install_wkhtml_pdf.yml b/roles/lib/tasks/install_wkhtml_pdf.yml index 11152dc19..1fe4a87f0 100644 --- a/roles/lib/tasks/install_wkhtml_pdf.yml +++ b/roles/lib/tasks/install_wkhtml_pdf.yml @@ -52,29 +52,4 @@ become: true environment: "{{ proxy_env }}" - -# get google chrome for pdf generation -- name: get last known good versions of chrome to download - uri: - url: https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json - register: chrome_versions - -- name: parse latest stable versions for chrome - set_fact: - stable_chrome_versions: "{{ chrome_versions['json']['channels']['Stable']['downloads']['chrome'] }}" - -- block: - - name: install unzip - package: - name: unzip - state: present - - - name: download google chrome and unpack - unarchive: - src: "{{ stable_chrome_versions | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" - dest: /usr/local/bin - remote_src: yes - - become: true - environment: "{{ proxy_env }}" \ No newline at end of file From 100ae4b8f7522814e7caa63c667fe2a0c8942982 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 20 Dec 2024 12:38:40 +0100 Subject: [PATCH 4/8] chrome for pdf generation --- roles/lib/tasks/install_wkhtml_pdf.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/roles/lib/tasks/install_wkhtml_pdf.yml b/roles/lib/tasks/install_wkhtml_pdf.yml index 1fe4a87f0..b8f1fe99a 100644 --- a/roles/lib/tasks/install_wkhtml_pdf.yml +++ b/roles/lib/tasks/install_wkhtml_pdf.yml @@ -52,4 +52,28 @@ become: true environment: "{{ proxy_env }}" - \ No newline at end of file + +# get google chrome for pdf generation +- name: get last known good versions of chrome to download + uri: + url: https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json + register: chrome_versions + +- name: parse latest stable versions for chrome + set_fact: + stable_chrome_versions: "{{ chrome_versions['json']['channels']['Stable']['downloads']['chrome'] }}" + +- block: + - name: install unzip + package: + name: unzip + state: present + + - name: download google chrome and unpack + unarchive: + src: "{{ stable_chrome_versions | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" + dest: /usr/local/bin + remote_src: yes + + become: true + environment: "{{ proxy_env }}" From 2410de8198e1c8147e74f42466e4dae0a6e1ecf7 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 20 Dec 2024 12:41:20 +0100 Subject: [PATCH 5/8] revert changes --- roles/database/files/sql/idempotent/fworch-obj-import.sql | 5 +---- roles/database/files/sql/idempotent/fworch-usr-import.sql | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/roles/database/files/sql/idempotent/fworch-obj-import.sql b/roles/database/files/sql/idempotent/fworch-obj-import.sql index d951ec8fa..4c06ee1fa 100644 --- a/roles/database/files/sql/idempotent/fworch-obj-import.sql +++ b/roles/database/files/sql/idempotent/fworch-obj-import.sql @@ -141,10 +141,7 @@ BEGIN SELECT INTO i_farbe color_id FROM stm_color WHERE color_name = LOWER(remove_spaces(to_import.obj_color)); RAISE DEBUG 'processing import_nwobj_single 4'; IF NOT FOUND THEN -- TODO: Fehlerbehandlung bzw. automat. Neuanlegen einer Farbe? - SELECT INTO i_farbe color_id FROM stm_color WHERE color_name = 'black'; - IF NOT FOUND THEN - i_farbe := NULL; - END IF; + i_farbe := NULL; -- IF to_import.obj_color IS NOT NULL THEN -- -- PERFORM add_data_issue(i_control_id, to_import.obj_color, NULL, NULL, NULL, NULL, 'nw obj color', 'undefined color in network object: ' || to_import.obj_color, NULL); -- END IF; diff --git a/roles/database/files/sql/idempotent/fworch-usr-import.sql b/roles/database/files/sql/idempotent/fworch-usr-import.sql index 8204bf876..e2c641ca9 100644 --- a/roles/database/files/sql/idempotent/fworch-usr-import.sql +++ b/roles/database/files/sql/idempotent/fworch-usr-import.sql @@ -160,10 +160,7 @@ BEGIN END IF; SELECT INTO i_color_id color_id FROM stm_color WHERE color_name LIKE v_farbe; IF NOT FOUND THEN - SELECT INTO i_farbe color_id FROM stm_color WHERE color_name = 'blackOld'; - IF NOT FOUND THEN - RAISE NOTICE 'user color not found: %', v_user_name || ' color ' || v_farbe; - END IF; + RAISE NOTICE 'user color not found: %', v_user_name || ' color ' || v_farbe; END IF; IF NOT FOUND THEN PERFORM error_handling('ERR_COLOR_MISS', r_to_import.user_color); END IF; SELECT INTO existing_usr * FROM usr WHERE user_name=v_user_name AND mgm_id=i_mgm_id AND active; From 85e2b013ddcb1e6dd9698d09921a4de5cef7a637 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 20 Dec 2024 15:14:52 +0100 Subject: [PATCH 6/8] customize install directory --- roles/lib/tasks/install_wkhtml_pdf.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/lib/tasks/install_wkhtml_pdf.yml b/roles/lib/tasks/install_wkhtml_pdf.yml index b8f1fe99a..f661a90db 100644 --- a/roles/lib/tasks/install_wkhtml_pdf.yml +++ b/roles/lib/tasks/install_wkhtml_pdf.yml @@ -69,10 +69,16 @@ name: unzip state: present + - name: create chrome install path + file: + path: "/usr/local/bin/Chrome/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" + state: directory + mode: '0755' + - name: download google chrome and unpack unarchive: src: "{{ stable_chrome_versions | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" - dest: /usr/local/bin + dest: "/usr/local/bin/Chrome/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" remote_src: yes become: true From 07795e470dd6ad0c7762374ddc60cdfa20172f3a Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 20 Dec 2024 20:25:12 +0100 Subject: [PATCH 7/8] rename chrome directories --- roles/lib/tasks/install_wkhtml_pdf.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/lib/tasks/install_wkhtml_pdf.yml b/roles/lib/tasks/install_wkhtml_pdf.yml index f661a90db..1d82c3b6b 100644 --- a/roles/lib/tasks/install_wkhtml_pdf.yml +++ b/roles/lib/tasks/install_wkhtml_pdf.yml @@ -62,6 +62,7 @@ - name: parse latest stable versions for chrome set_fact: stable_chrome_versions: "{{ chrome_versions['json']['channels']['Stable']['downloads']['chrome'] }}" + chrome_dest: "/usr/local/bin/ChromeHeadlessShell/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" - block: - name: install unzip @@ -71,15 +72,25 @@ - name: create chrome install path file: - path: "/usr/local/bin/Chrome/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" + path: "{{ chrome_dest }}" state: directory mode: '0755' - name: download google chrome and unpack unarchive: src: "{{ stable_chrome_versions | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" - dest: "/usr/local/bin/Chrome/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" + dest: "{{ chrome_dest }}" remote_src: yes + - name: rename chrome directory + synchronize: + src: "{{ chrome_dest }}/chrome-linux64" + dest: "{{ chrome_dest }}/chrome-headless-shell-linux64" + + - name: remove old chrome directory + file: + path: "{{ chrome_dest }}/chrome-linux64" + state: absent + become: true environment: "{{ proxy_env }}" From 42d36c47bf172a7430ef704cdeb6d31b850808c2 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 27 Dec 2024 10:44:40 +0100 Subject: [PATCH 8/8] chrome headless shell --- roles/lib/tasks/install_wkhtml_pdf.yml | 29 ++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/roles/lib/tasks/install_wkhtml_pdf.yml b/roles/lib/tasks/install_wkhtml_pdf.yml index 1d82c3b6b..e38a5f38f 100644 --- a/roles/lib/tasks/install_wkhtml_pdf.yml +++ b/roles/lib/tasks/install_wkhtml_pdf.yml @@ -59,10 +59,11 @@ url: https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json register: chrome_versions -- name: parse latest stable versions for chrome +- name: parse latest stable versions for chrome and headless shell set_fact: - stable_chrome_versions: "{{ chrome_versions['json']['channels']['Stable']['downloads']['chrome'] }}" - chrome_dest: "/usr/local/bin/ChromeHeadlessShell/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" + stable_chrome_versions: "{{ chrome_versions['json']['channels']['Stable']['downloads'] }}" + chrome_dest: "/usr/local/bin/Chrome/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" + headless_shell_dest: "/usr/local/bin/ChromeHeadlessShell/Linux-{{ chrome_versions['json']['channels']['Stable']['version'] }}" - block: - name: install unzip @@ -76,21 +77,23 @@ state: directory mode: '0755' + - name: create chrome headless shell install path + file: + path: "{{ headless_shell_dest }}" + state: directory + mode: '0755' + - name: download google chrome and unpack unarchive: - src: "{{ stable_chrome_versions | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" + src: "{{ stable_chrome_versions['chrome'] | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" dest: "{{ chrome_dest }}" remote_src: yes - - name: rename chrome directory - synchronize: - src: "{{ chrome_dest }}/chrome-linux64" - dest: "{{ chrome_dest }}/chrome-headless-shell-linux64" - - - name: remove old chrome directory - file: - path: "{{ chrome_dest }}/chrome-linux64" - state: absent + - name: download google chrome headless shell and unpack + unarchive: + src: "{{ stable_chrome_versions['chrome-headless-shell'] | selectattr('platform', 'match', 'linux64') | map(attribute='url') | first }}" + dest: "{{ headless_shell_dest }}" + remote_src: yes become: true environment: "{{ proxy_env }}"