<commit_before>- include: ../../common/tasks/setfacts.yml
  tags:
    - webapps
    - properties
    - biocache_hub

#
# Apache/Tomcat virtual host configuration
#

- include: ../../apache_vhost/tasks/main.yml context_path='/{{ biocache_hub_context_path }}' hostname='{{ biocache_hub_hostname }}'
  tags:
    - webapps
    - apache_vhost
    - deploy
    - biocache_hub    
  when: not webserver_nginx

- name: add nginx vhost if configured
  include_role:
    name: nginx_vhost
  vars:
    hostname: "{{ biocache_hub_hostname }}"
    context_path: "{{ biocache_hub_context_path }}"
    tomcat_server_port: "{{ biocache_server_port }}"
  tags:
    - nginx_vhost
    - deploy
    - biocache_hub
  when: webserver_nginx

#
# WAR/JAR file deployment
#
- name: add jar and service
  include_role:
    name: exec-jar
  vars:
    service_name: '{{ biocache_hub }}'
    jar_url: '{{ biocache_hub_artifact_url }}'
  tags:
    - deploy
    - service
    - biocache_hub
  when: exec_jar

- include: ../../tomcat_deploy/tasks/main.yml war_url='{{ biocache_hub_artifact_url }}' context_path='{{ biocache_hub_context_path }}' hostname='{{ biocache_hub_hostname }}'
  tags:
    - webapps
    - tomcat_vhost
    - deploy
    - biocache_hub
  when: not exec_jar

#
# Properties and data file configuration
#

- name: ensure target directories exist [data subdirectories etc.]
  file: path={{item}} state=directory owner={{biocache_hub}} group={{biocache_hub}}
  with_items:
    - "{{data_dir}}/{{biocache_hub}}/config"
    - "{{data_dir}}/{{biocache_hub}}/cache"
    - "{{data_dir}}/{{biocache_hub}}/download"
    - "{{data_dir}}/{{biocache_hub}}/geolite_db"
    - "{{data_dir}}/{{biocache_hub}}/logs"
  tags:
    - webapps
    - properties
    - biocache_hub
    - geolite_db
  when: exec_jar

- name: ensure target directories exist [data subdirectories etc.]
  file: path={{item}} state=directory owner={{tomcat_user}} group={{tomcat_user}}
  with_items:
    - "{{data_dir}}/{{biocache_hub}}/config"
    - "{{data_dir}}/{{biocache_hub}}/cache"
    - "{{data_dir}}/{{biocache_hub}}/download"
    - "{{data_dir}}/{{biocache_hub}}/geolite_db"
  tags:
    - webapps
    - properties
    - biocache_hub
    - geolite_db
  when: not exec_jar

- name: copy grouped_facets.json
  template: src=config/{{grouped_facets_json}} dest={{data_dir}}/{{biocache_hub}}/config/{{grouped_facets_json}} force=yes
  when: grouped_facets_json is defined
  tags:
    - webapps
    - properties
    - hub_config
    - biocache_hub

- name: copy all config.properties
  template: src=config/config.properties dest={{data_dir}}/{{biocache_hub}}/config/{{biocache_hub_config}} force=yes
  tags:
    - webapps
    - properties
    - biocache_hub
    - hub_config

- name: copy charts.json
  template: src=config/charts.json dest={{data_dir}}/{{biocache_hub}}/config/charts.json force=yes
  tags:
    - webapps
    - properties
    - hub_config
    - biocache_hub

- name: copy overlays.json
  template: src=config/{{overlays_json}} dest={{data_dir}}/{{biocache_hub}}/config/overlays.json force=yes
  when: overlays_json is defined
  tags:
    - webapps
    - config
    - hub_config
    - biocache_hub

- name: copy system-message.json
  template: src=config/system-message.json dest={{data_dir}}/{{biocache_hub}}/config/system-message.json force=yes
  tags:
    - webapps
    - properties
    - hub_config
    - biocache_hub

- name: copy logback config
  template: src=config/logback.groovy dest={{data_dir}}/{{biocache_hub}}/config/logback.groovy  owner={{biocache_hub}} group={{biocache_hub}}
  tags:
    - properties
    - biocache_hub
    - hub_config

- name: Setup GeoLite2 City database (only used by ALA version of the hub)
  block:
  - set_fact:
      geolite_db_archive: "{{data_dir}}/{{biocache_hub}}/download/GeoLite2-City.tar.gz"
      geolite_db_extracted: "{{data_dir}}/{{biocache_hub}}/geolite_db"
      geolite_db_file: "GeoLite2-City.mmdb"
      geolite_db_file_link: "{{data_dir}}/{{biocache_hub}}/config/GeoLite2-City.mmdb"
    tags:
      - setfacts

  - name: Download GeoLite2 City database (only used by ALA version of the hub)
    get_url: url={{geolite2_city_db_download_url | default('https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz')}} dest={{geolite_db_archive}} force={{ force_geolite2_city_db_download | default(false) }}<commit_msg>Fixing permission error while copying logback.groovy<commit_after>- include: ../../common/tasks/setfacts.yml
  tags:
    - webapps
    - properties
    - biocache_hub

#
# Apache/Tomcat virtual host configuration
#

- include: ../../apache_vhost/tasks/main.yml context_path='/{{ biocache_hub_context_path }}' hostname='{{ biocache_hub_hostname }}'
  tags:
    - webapps
    - apache_vhost
    - deploy
    - biocache_hub    
  when: not webserver_nginx

- name: add nginx vhost if configured
  include_role:
    name: nginx_vhost
  vars:
    hostname: "{{ biocache_hub_hostname }}"
    context_path: "{{ biocache_hub_context_path }}"
    tomcat_server_port: "{{ biocache_server_port }}"
  tags:
    - nginx_vhost
    - deploy
    - biocache_hub
  when: webserver_nginx

#
# WAR/JAR file deployment
#
- name: add jar and service
  include_role:
    name: exec-jar
  vars:
    service_name: '{{ biocache_hub }}'
    jar_url: '{{ biocache_hub_artifact_url }}'
  tags:
    - deploy
    - service
    - biocache_hub
  when: exec_jar

- include: ../../tomcat_deploy/tasks/main.yml war_url='{{ biocache_hub_artifact_url }}' context_path='{{ biocache_hub_context_path }}' hostname='{{ biocache_hub_hostname }}'
  tags:
    - webapps
    - tomcat_vhost
    - deploy
    - biocache_hub
  when: not exec_jar

#
# Properties and data file configuration
#

- name: ensure target directories exist [data subdirectories etc.]
  file: path={{item}} state=directory owner={{biocache_hub}} group={{biocache_hub}}
  with_items:
    - "{{data_dir}}/{{biocache_hub}}/config"
    - "{{data_dir}}/{{biocache_hub}}/cache"
    - "{{data_dir}}/{{biocache_hub}}/download"
    - "{{data_dir}}/{{biocache_hub}}/geolite_db"
    - "{{data_dir}}/{{biocache_hub}}/logs"
  tags:
    - webapps
    - properties
    - biocache_hub
    - geolite_db
  when: exec_jar

- name: ensure target directories exist [data subdirectories etc.]
  file: path={{item}} state=directory owner={{tomcat_user}} group={{tomcat_user}}
  with_items:
    - "{{data_dir}}/{{biocache_hub}}/config"
    - "{{data_dir}}/{{biocache_hub}}/cache"
    - "{{data_dir}}/{{biocache_hub}}/download"
    - "{{data_dir}}/{{biocache_hub}}/geolite_db"
  tags:
    - webapps
    - properties
    - biocache_hub
    - geolite_db
  when: not exec_jar

- name: copy grouped_facets.json
  template: src=config/{{grouped_facets_json}} dest={{data_dir}}/{{biocache_hub}}/config/{{grouped_facets_json}} force=yes
  when: grouped_facets_json is defined
  tags:
    - webapps
    - properties
    - hub_config
    - biocache_hub

- name: copy all config.properties
  template: src=config/config.properties dest={{data_dir}}/{{biocache_hub}}/config/{{biocache_hub_config}} force=yes
  tags:
    - webapps
    - properties
    - biocache_hub
    - hub_config

- name: copy charts.json
  template: src=config/charts.json dest={{data_dir}}/{{biocache_hub}}/config/charts.json force=yes
  tags:
    - webapps
    - properties
    - hub_config
    - biocache_hub

- name: copy overlays.json
  template: src=config/{{overlays_json}} dest={{data_dir}}/{{biocache_hub}}/config/overlays.json force=yes
  when: overlays_json is defined
  tags:
    - webapps
    - config
    - hub_config
    - biocache_hub

- name: copy system-message.json
  template: src=config/system-message.json dest={{data_dir}}/{{biocache_hub}}/config/system-message.json force=yes
  tags:
    - webapps
    - properties
    - hub_config
    - biocache_hub

- name: copy logback config
  template: src=config/logback.groovy dest={{data_dir}}/{{biocache_hub}}/config/logback.groovy  owner={{tomcat_user}} group={{tomcat_user}}
  tags:
    - properties
    - biocache_hub
    - hub_config

- name: Setup GeoLite2 City database (only used by ALA version of the hub)
  block:
  - set_fact:
      geolite_db_archive: "{{data_dir}}/{{biocache_hub}}/download/GeoLite2-City.tar.gz"
      geolite_db_extracted: "{{data_dir}}/{{biocache_hub}}/geolite_db"
      geolite_db_file: "GeoLite2-City.mmdb"
      geolite_db_file_link: "{{data_dir}}/{{biocache_hub}}/config/GeoLite2-City.mmdb"
    tags:
      - setfacts

  - name: Download GeoLite2 City database (only used by ALA version of the hub)
    get_url: url={{geolite2_city_db_download_url | default('https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz')}} dest={{geolite_db_archive}} force={{ force_geolite2_city_db_download | default(false) }}
{'fraction_non_alphanumeric': 0.13975048643699212, 'fraction_numerical': 0.00183129220556255, 'mean_word_length': 3.582066072364971, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '119521', 'n_tokens_mistral': 3251, 'n_tokens_neox': 3138, 'n_words': 543}