---
- name: Install the production gcube keys
  get_url: url={{ item.url }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/PARALLEL_PROCESSING owner={{ smartgears_user }} group={{ smartgears_user }} mode=0400
  with_items:
    - '{{ gcube_prod_key_1 }}'
    - '{{ gcube_prod_key_2 }}'
    - '{{ gcube_prod_key_3 }}'
  notify: Restart smartgears
  when: install_gcube_prod_key
  tags: [ 'dataminer', 'gcube_key' ]

- name: Install the devel gcube keys
  get_url: url={{ item.url }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/PARALLEL_PROCESSING owner={{ smartgears_user }} group={{ smartgears_user }} mode=0400
  with_items:
    - '{{ gcube_dev_key_1 }}'
    - '{{ gcube_dev_key_2 }}'
    - '{{ gcube_dev_key_3 }}'
  notify: Restart smartgears
  when: install_gcube_dev_key
  tags: [ 'dataminer', 'gcube_key' ]

- name: Install the preprod gcube keys
  get_url: url={{ item.url }} dest={{ smartgears_instance_path }}/webapps/{{ dataminer_52north_webapp_name }}/ecocfg/PARALLEL_PROCESSING owner={{ smartgears_user }} group={{ smartgears_user }} mode=0400
  with_items:
    - '{{ gcube_pre_key_1 }}'
  notify: Restart smartgears
  when: install_gcube_preprod_key
  tags: [ 'dataminer', 'gcube_key' ]