- name: copy json
  template:
    src: "{{ item }}.j2"
    dest: "/tmp/{{ item }}"
  with_items:
    - saml20_idp.json
    - saml20_sp.json

- name: import metadata manage
  command: mongoimport --db {{ manage.mongo_database }} --username {{ manage.mongo_user }} --password {{ manage.mongo_password }} --collection {{ item.coll }}  --file /tmp/{{ item.coll }}.json
  with_items:
    - { coll:  "saml20_idp"}
    - { coll:  "saml20_sp"}
  run_once: true
  changed_when: false


- name: Include vars of manage-server
  include_vars:
    file: ../../manage-server/vars/main.yml

- name: push metadata eb
  uri:
    url: "http://127.0.0.1:{{ springapp_tcpport }}/internal/push"
    method: GET
    user: "{{ manage.apiUsers[2].name }}"
    password: "{{ manage.apiUsers[2].password }}"
    force_basic_auth: yes
    run_once: true
    status_code: 200
  changed_when: false

- name: copy json
  template:
    src: "{{ item }}.j2"
    dest: "/tmp/{{ item }}"
  with_items:
    - saml20_idp.json
    - saml20_sp.json

- name: import metadata manage
  command: mongoimport --db {{ manage.mongo_database }} --username {{ manage.mongo_user }} --password {{ manage.mongo_password }} --collection {{ item.coll }}  --file /tmp/{{ item.coll }}.json
  with_items:
    - { coll:  "saml20_idp"}
    - { coll:  "saml20_sp"}
  run_once: true
  changed_when: false


- name: Include vars of manage-server
  include_vars:
    file: ../../manage-server/vars/main.yml

- name: push metadata eb
  uri:
    url: "http://manage:{{ springapp_tcpport }}/internal/push"
    method: GET
    user: "{{ manage.apiUsers[2].name }}"
    password: "{{ manage.apiUsers[2].password }}"
    force_basic_auth: yes
    run_once: true
    status_code: 200
  changed_when: false

Use host name in docker
Use host name in docker
