---
- name: register api crt content
  sudo: False
  local_action: shell sed -e '1d;$d' files/java-{{ env }}/certs/api.crt | tr -d '\n'
  register: api_crt_content
  changed_when: False

- name: register apis crt content
  sudo: False
  local_action: shell sed -e '1d;$d' files/java-{{ env }}/certs/apis.crt | tr -d '\n'
  register: apis_crt_content
  changed_when: False

- name: copy load sql
  template: src={{ item }}.j2 dest=/tmp/{{ item }}
  with_items:
    - engineblock.sql
    - serviceregistry.sql
    - virtual_organization.sql

- name: run load engineblock sql
  shell: mysql -u {{ item.db_user }} -p{{ item.db_password }} -h {{ mysql_host }} -D {{ item.db_name }} < /tmp/{{ item.sql }}
  with_items:
    - { db_user: "{{ engine_database_user }}", db_password: "{{ engine_database_password }}", db_name: "{{ engine_database_name }}", sql: engineblock.sql }
    - { db_user: "{{ janus_database_user }}", db_password: "{{ janus_database_password }}", db_name: "{{ janus_database_name }}", sql: serviceregistry.sql }

---
- name: register api crt content
  sudo: False
  local_action: shell sed -e '1d;$d' files/java-{{ env }}/certs/api.crt | tr -d '\n'
  register: api_crt_content
  changed_when: False

- name: register apis crt content
  sudo: False
  local_action: shell sed -e '1d;$d' files/java-{{ env }}/certs/apis.crt | tr -d '\n'
  register: apis_crt_content
  changed_when: False

- name: copy load sql
  template: src={{ item }}.j2 dest=/tmp/{{ item }}
  with_items:
    - engineblock.sql
    - serviceregistry.sql
    - virtual_organization.sql

- name: run load engineblock sql
  shell: mysql -u {{ item.db_user }} -p{{ item.db_password }} -h {{ mysql_host }} -D {{ item.db_name }} < /tmp/{{ item.sql }}
  with_items:
    - { db_user: "{{ engine_database_user }}", db_password: "{{ engine_database_password }}", db_name: "{{ engine_database_name }}", sql: engineblock.sql }
    - { db_user: "{{ janus_database_user }}", db_password: "{{ janus_database_password }}", db_name: "{{ janus_database_name }}", sql: serviceregistry.sql }
    - { db_user: "{{ engine_database_user }}", db_password: "{{ engine_database_password }}", db_name: "{{ engine_database_name }}", sql: virtual_organization.sql }

Add a default virtual organization in the eb database to verify EB and VOOT communication. The virtual organization is used in SR for the SP mujina
Add a default virtual organization in the eb database to verify EB and VOOT communication. The virtual organization is used in SR for the SP mujina
