From 9dc4040c6108dff3976fb5bc007022528dc535ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de>
Date: Mon, 11 Sep 2023 13:23:27 +0200
Subject: [PATCH] fix: make sure 'when:' conditions match hostname patterns

---
 .../configure_rosetta_prerequisites.yml       | 22 ++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tasks/rosetta/configure_rosetta_prerequisites.yml b/tasks/rosetta/configure_rosetta_prerequisites.yml
index 5f9c256..cae8242 100644
--- a/tasks/rosetta/configure_rosetta_prerequisites.yml
+++ b/tasks/rosetta/configure_rosetta_prerequisites.yml
@@ -19,13 +19,15 @@
   loop:
     - "exlibris/dps/d4_1/system.dir/conf/global.properties_http"
     - "exlibris/dps/d4_1/system.dir/conf/global.properties_https"
-  when: ansible_hostname in "appprod0"
+#  when: ("appprod0" in ansible_hostname)
+  when: false
 - name: set symlink for correct global.properties PROD
   ansible.builtin.file:
     src: "/exlibris/dps/d4_1/system.dir/conf/global.properties_http"
     dest: "/exlibris/dps/d4_1/system.dir/conf/global.properties"
     state: link
-  when: ansible_hostname in "appprod0"
+#  when: ("appprod0" in ansible_hostname)
+  when: false
 
 - name: template global.properties TEST
   ansible.builtin.template:
@@ -47,13 +49,13 @@
   loop:
     - "exlibris/dps/d4_1/system.dir/conf/global.properties_http"
     - "exlibris/dps/d4_1/system.dir/conf/global.properties_https"
-  when: ansible_hostname in "-test"
+  when: ("-test" in ansible_hostname)
 - name: set symlink for correct global.properties TEST
   ansible.builtin.file:
     src: "/exlibris/dps/d4_1/system.dir/conf/global.properties_https"
     dest: "/exlibris/dps/d4_1/system.dir/conf/global.properties"
     state: link
-  when: ansible_hostname in "-test"
+  when: ("-test" in ansible_hostname)
 
 - name: template global.properties DEV
   ansible.builtin.template:
@@ -75,13 +77,13 @@
   loop:
     - "exlibris/dps/d4_1/system.dir/conf/global.properties_http"
     - "exlibris/dps/d4_1/system.dir/conf/global.properties_https"
-  when: ansible_hostname in "appdev"
+  when: ("appdev" in ansible_hostname)
 - name: set symlink for correct global.properties DEV
   ansible.builtin.file:
     src: "/exlibris/dps/d4_1/system.dir/conf/global.properties_https"
     dest: "/exlibris/dps/d4_1/system.dir/conf/global.properties"
     state: link
-  when: ansible_hostname in "appdev"
+  when: ("appdev" in ansible_hostname)
 
 - name: create directory for Solr config file
   ansible.builtin.file:
@@ -90,8 +92,8 @@
     mode: "0755"
     owner: "{{ vault_rosetta_user }}"
     group: "{{ vault_rosetta_group }}"
-  when: ("-test" in ansible_hostname) or
-        ("-mol" in ansible_hostname)
+#  when: ("-test" in ansible_hostname) or
+#        ("-mol" in ansible_hostname)
 
 - name: >
     Deploy modified security.json file for Testsystem so CI/CD tests can be run
@@ -103,5 +105,5 @@
     mode: "0664"
     owner: "{{ vault_rosetta_user }}"
     group: "{{ vault_rosetta_group }}"
-  when: ("-test" in ansible_hostname) or
-        ("-mol" in ansible_hostname)
+#  when: ("-test" in ansible_hostname) or
+#        ("-mol" in ansible_hostname)
-- 
GitLab