Commit 5cf92fed authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Fix build by moving async variable to block in side cars

parent 6880ad87
......@@ -46,6 +46,9 @@
poll: 0
register: async_results_tmp
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }}"
- name: "{{ image_name }}:: Stop EDD docker container"
block:
- name: Get docker logs
......@@ -70,20 +73,13 @@
- set_fact:
edd_container: '{{ edd_container | dict2items | rejectattr( "key", "equalto", container_name )|list|items2dict }}'
cacheable: true
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }}"
tags:
- never
- stop
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }}"
tags:
- always
- name: Using Dashboard
block:
- name:
......@@ -125,39 +121,28 @@
- name: "{{ image_name }}:: Launch influx sidecar"
block:
- include_role:
name: influx_sidecar
vars:
pipeline_id: "{{ container_name }}"
katcp_host: "{{ inventory_hostname }}"
katcp_port: "{{ bind_port }}"
exclude_sensors: "{% if influx_exclude_sensors is defined and influx_exclude_sensors%} {{ influx_exclude_sensors }} {% endif %}"
tags:
- always
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }}"
tags:
- always
include_role:
name: influx_sidecar
vars:
pipeline_id: "{{ container_name }}"
katcp_host: "{{ inventory_hostname }}"
katcp_port: "{{ bind_port }}"
exclude_sensors: "{% if influx_exclude_sensors is defined and influx_exclude_sensors%} {{ influx_exclude_sensors }} {% endif %}"
when: launch_influx_sidecar
tags:
- always
- name: "{{ image_name }}:: Launch redis sidecar"
block:
- include_role:
name: redis_sidecar
vars:
pipeline_id: "{{ container_name }}"
katcp_host: "{{ inventory_hostname }}"
katcp_port: "{{ bind_port }}"
tags:
- always
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }}"
tags:
- always
include_role:
name: redis_sidecar
vars:
pipeline_id: "{{ container_name }}"
katcp_host: "{{ inventory_hostname }}"
katcp_port: "{{ bind_port }}"
when: launch_redis_sidecar
tags:
- always
- name: "{{ image_name }}:: Wait for async job results"
async_status:
......
......@@ -24,26 +24,34 @@
force_kill: yes
- name: Start new side car
docker_container:
name: "{{ pipeline_id }}_influx_sidecar"
image: "{{ docker_registry }}:{{ docker_registry_port }}/katcp2influx_sidecar"
command: "python katcp_monitor/influxdb_exporter.py --host {{ katcp_host }} --port {{ katcp_port }} --db-host={{ influx_host }} --db-port {{ influxdb_port }} --idb-db=monitor --measurement={{ measurement }} --idb-tags pipeline_id={{ pipeline_id }} {% if exclude_sensors is defined and exclude_sensors %}--exclude_sensors {{ exclude_sensors | join(' ')}}{%endif%}{% if include_sensors is defined and include_sensors %}--include_sensors {{ include_sensors | join(' ')}}{%endif%}"
block:
- docker_container:
name: "{{ pipeline_id }}_influx_sidecar"
image: "{{ docker_registry }}:{{ docker_registry_port }}/katcp2influx_sidecar"
command: "python katcp_monitor/influxdb_exporter.py --host {{ katcp_host }} --port {{ katcp_port }} --db-host={{ influx_host }} --db-port {{ influxdb_port }} --idb-db=monitor --measurement={{ measurement }} --idb-tags pipeline_id={{ pipeline_id }} {% if exclude_sensors is defined and exclude_sensors %}--exclude_sensors {{ exclude_sensors | join(' ')}}{%endif%}{% if include_sensors is defined and include_sensors %}--include_sensors {{ include_sensors | join(' ')}}{%endif%}"
state: started # ensure that is running
pull: yes
auto_remove: yes
force_kill: yes # avoid lag between rm and restart
async: 300
poll: 0
register: async_results_tmp
state: started # ensure that is running
pull: yes
auto_remove: yes
force_kill: yes # avoid lag between rm and restart
async: 300
poll: 0
register: async_results_tmp
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }} "
- name: Stop sidecar
docker_container:
name: "{{ pipeline_id }}_influx_sidecar"
state: absent
async: 300
poll: 0
register: async_results_tmp
block:
- docker_container:
name: "{{ pipeline_id }}_influx_sidecar"
state: absent
async: 300
poll: 0
register: async_results_tmp
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }} "
tags:
- never
- stop
......@@ -23,26 +23,33 @@
force_kill: yes # avoid lag between rm and restart
- name: Start new side car
docker_container:
name: "{{ pipeline_id }}_redis_sidecar"
image: "{{ docker_registry }}:{{ docker_registry_port }}/katcp2redis_sidecar"
command: "python katcp_monitor/redis_exporter.py --host {{ katcp_host }} --port {{ katcp_port }} --db-host={{ redis_storage }} --db-port={{ redis_port }} --db=5 --measurement={{ pipeline_id }} {% if exclude_sensors is defined and exclude_sensors %}--exclude_sensors {{ exclude_sensors | join(' ')}}{%endif%}{% if include_sensors is defined and include_sensors %}--include_sensors {{ include_sensors | join(' ')}}{%endif%}"
state: started # ensure that is running
pull: yes
# auto_remove: yes
force_kill: yes # avoid lag between rm and restart
async: 300
poll: 0
register: async_results_tmp
block:
- docker_container:
name: "{{ pipeline_id }}_redis_sidecar"
image: "{{ docker_registry }}:{{ docker_registry_port }}/katcp2redis_sidecar"
command: "python katcp_monitor/redis_exporter.py --host {{ katcp_host }} --port {{ katcp_port }} --db-host={{ redis_storage }} --db-port={{ redis_port }} --db=5 --measurement={{ pipeline_id }} {% if exclude_sensors is defined and exclude_sensors %}--exclude_sensors {{ exclude_sensors | join(' ')}}{%endif%}{% if include_sensors is defined and include_sensors %}--include_sensors {{ include_sensors | join(' ')}}{%endif%}"
state: started # ensure that is running
pull: yes
# auto_remove: yes
force_kill: yes # avoid lag between rm and restart
async: 300
poll: 0
register: async_results_tmp
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }} "
- name: Stop sidecar
docker_container:
name: "{{ pipeline_id }}_redis_sidecar"
state: absent
async: 300
poll: 0
register: async_results_tmp
block:
- docker_container:
name: "{{ pipeline_id }}_redis_sidecar"
state: absent
async: 300
poll: 0
register: async_results_tmp
- set_fact:
async_list: "{{ async_list + [ async_results_tmp.ansible_job_id ] }} "
tags:
- never
- stop
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment