From 9e29af0554a968479eefb6e3be7965c722d529c5 Mon Sep 17 00:00:00 2001 From: MattioliLeo Date: Tue, 19 Sep 2023 18:13:00 +0200 Subject: [PATCH 1/3] added functionality --- yml/roles/alfresco/tasks/repo.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/yml/roles/alfresco/tasks/repo.yml b/yml/roles/alfresco/tasks/repo.yml index 0991bdb..3cf6092 100644 --- a/yml/roles/alfresco/tasks/repo.yml +++ b/yml/roles/alfresco/tasks/repo.yml @@ -99,3 +99,53 @@ flat: yes when: checked_privs.failed == false and s3_props.stdout_lines | length == 0 +- name: Get Transformer values from JmxDump + connection: local + shell: unzip -p ../assets/{{ inventory_hostname }}/conf/jmxdump-{{ inventory_hostname }}.zip | awk '{{item}}' + args: + warn: false + register: jmx_params + with_items: + - /^local.transform.service.enabled/ { print $2 } + - /^localTransform.core-aio.url/ { print $2 } + - /^transform.service.enabled/ { print $2 } + - /^transform.service.url/ { print $2 } + +- name: Set Transformer variables from JmxDump + set_fact: + local_transform_enabled: "{{ jmx_params.results[0].stdout_lines[0] }}" + local_core_aio_url: "{{ jmx_params.results[1].stdout_lines[0] }}" + remote_transform_enabled: "{{ jmx_params.results[2].stdout_lines[0] }}" + remote_t_router_url: "{{ jmx_params.results[3].stdout_lines[0] }}" + +- name: Get Local Transformer (Core-AIO) configuration + uri: + url: "{{ local_core_aio_url }}transform/config?configVersion=5555" + dest: "{{ hc_tmp }}/Transformer-Local-{{ inventory_hostname }}.json" + status_code: + - 400 + - 200 + when: local_transform_enabled == true + +- name: Fetch Local Transformer (Core-AIO) configuration + fetch: + src: "{{ hc_tmp }}/Transformer-Local-{{ inventory_hostname }}.json" + dest: ../assets/{{ inventory_hostname }}/ + flat: yes + when: local_transform_enabled == true + +- name: Get T-Router Transformer (Core-AIO) configuration + uri: + url: "{{ remote_t_router_url }}/transform/config?configVersion=5555" + dest: "{{ hc_tmp }}/Transformer-T-Router-config-{{ inventory_hostname }}.json" + status_code: + - 400 + - 200 + when: remote_transform_enabled == true + +- name: Fetch T-Router Transformer (Core-AIO) configuration + fetch: + src: "{{ hc_tmp }}/Transformer-T-Router-config-{{ inventory_hostname }}.json" + dest: ../assets/{{ inventory_hostname }}/ + flat: yes + when: remote_transform_enabled == true From a8f1debf0bb91ee65ae9a1cf6291e53651aed3dd Mon Sep 17 00:00:00 2001 From: MattioliLeo Date: Thu, 21 Sep 2023 11:13:28 +0200 Subject: [PATCH 2/3] removing last / from path --- yml/roles/alfresco/tasks/repo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yml/roles/alfresco/tasks/repo.yml b/yml/roles/alfresco/tasks/repo.yml index 3cf6092..193bc6b 100644 --- a/yml/roles/alfresco/tasks/repo.yml +++ b/yml/roles/alfresco/tasks/repo.yml @@ -101,7 +101,7 @@ - name: Get Transformer values from JmxDump connection: local - shell: unzip -p ../assets/{{ inventory_hostname }}/conf/jmxdump-{{ inventory_hostname }}.zip | awk '{{item}}' + shell: unzip -p ../assets/{{ inventory_hostname }}/conf/jmxdump-{{ inventory_hostname }}.zip | awk '{{item}}' | sed 's/\/*$//g' args: warn: false register: jmx_params @@ -120,7 +120,7 @@ - name: Get Local Transformer (Core-AIO) configuration uri: - url: "{{ local_core_aio_url }}transform/config?configVersion=5555" + url: "{{ local_core_aio_url }}/transform/config?configVersion=5555" dest: "{{ hc_tmp }}/Transformer-Local-{{ inventory_hostname }}.json" status_code: - 400 From ae77d54ebc07124e242b3c4b8efe6b31a6563eff Mon Sep 17 00:00:00 2001 From: MattioliLeo Date: Mon, 25 Sep 2023 10:50:12 +0200 Subject: [PATCH 3/3] removed unneeded port --- yml/roles/alfresco/tasks/repo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yml/roles/alfresco/tasks/repo.yml b/yml/roles/alfresco/tasks/repo.yml index 193bc6b..0139ff7 100644 --- a/yml/roles/alfresco/tasks/repo.yml +++ b/yml/roles/alfresco/tasks/repo.yml @@ -120,7 +120,7 @@ - name: Get Local Transformer (Core-AIO) configuration uri: - url: "{{ local_core_aio_url }}/transform/config?configVersion=5555" + url: "{{ local_core_aio_url }}/transform/config" dest: "{{ hc_tmp }}/Transformer-Local-{{ inventory_hostname }}.json" status_code: - 400 @@ -136,7 +136,7 @@ - name: Get T-Router Transformer (Core-AIO) configuration uri: - url: "{{ remote_t_router_url }}/transform/config?configVersion=5555" + url: "{{ remote_t_router_url }}/transform/config" dest: "{{ hc_tmp }}/Transformer-T-Router-config-{{ inventory_hostname }}.json" status_code: - 400