Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transformer configs #30

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions yml/roles/alfresco/tasks/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}' | sed 's/\/*$//g'
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"
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"
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