Skip to content

Latest commit

 

History

History
97 lines (70 loc) · 4.25 KB

File metadata and controls

97 lines (70 loc) · 4.25 KB

Ansible Role: edu-sharing-notification

The edu-sharing-notification role is used activate/deactivate notification system for edu-sharing

Implementation

The edu-sharing-notification role is included in the playbook system.yml.

- hosts: edusharing
  roles:
  - role: edu-sharing-notification
    when: edu_version is defined and  (edu_version | regex_replace('-RC[0-9]+', '') ) is version_compare('9.0.0', '<')
    tags: 
      - edu-sharing-notification

Since notification-service run only in edu-sharing version 9.0.0 and above, we add condition to ignore if edu-sharing is less

or we just want to run only the edu-sharing-notification then we run:

ansible-playbook -v -i <host> ansible/system.yml --tags "edu-sharing-notification"

This will skip other roles and run only the edu-sharing-notification role

Role Variables

The edu-sharing-notification role allows you to customize certain variables according to your requirements.

Here are the default variables:

enable_notification_service: false
notification_service_version: 9.0.15
# installation directory
notification_service_install_dir: "{{base_dir}}/notification-service_{{notification_service_version|replace('.','_')}}"

notification_service_environment_variable:
  - key: NOTIFICATION_SERVICE_DATABASE_NAME
    value: '{{notification_service_database_name | default("notification",true)}}'
  - key: NOTIFICATION_SERVICE_DATABASE_USER
    value: '{{notification_service_database_user | default("notification",true)}}'
  - key: NOTIFICATION_SERVICE_DATABASES_PASS
    value: '{{notification_service_database_pass | default("notification",true)}}'
  - key: NOTIFICATION_SERVICE_DATABASES_ROOT_USER
    value: '{{notification_service_database_root_user | default("root",true)}}'
  - key: NOTIFICATION_SERVICE_DATABASES_ROOT_PASS
    value: '{{notification_service_database_root_pass | default("root",true)}}'
  - key: NOTIFICATION_SERVICE_DATABASES_REPLICATION_SET_KEY
    value: '{{notification_service_database_replication_set_key | default("notification",true)}}'
  - key: NOTIFICATION_SERVICES_MAIL_SEND_ADDRESS
    value: "{{ notification_service_mail_sent_address | default(edu_mail_smtp_from | default('[email protected]',true),true) }}"
  - key: REPOSITORY_SERVICE_MAIL_REPORT_RECEIVER
    value: "{{ notification_service_mail_sent_address | default(edu_mail_smtp_from | default('[email protected]',true),true) }}"

notification_service_docker_project_name: "notification_service_docker_version"

notification_service_docker_project_name: "notification_service_docker_version"

notification_mail_templates_base_path: "{{notification_service_install_dir}}/templates/mail"

# a list of custom mail templates that should be copied into notification-service; 
# format of each entry: 
#     [<source-file-path>, <destination>]
# example: 
#     - ['baseLayout.html', '/mail/html/baseLayout.html']
notification_mail_templates:

Tasks

The tasks/ directory contains all the ansible tasks.

  1. main: The main task or entry task for ansible.
  2. cleanup.yml: use to cleanup all the *.amp|*.jar files.
  3. download-and-install-docker-compose.yml: use to download and install docker compose files for notification-service.
  4. download-config-plugin.yml: use to download and install the config plugin files, required for notification-service.
  5. download-docker-plugin.yml: use to download and install the docker plugin files, required for notification-service.
  6. download-plugin-kafka-alfresco-amp.yml: use to download and install the alfresco amps files.
  7. download-plugin-kafka-service-amp.yml: use to download and install the edu-sharing amps files.
  8. wait_for_paths.yml : use to check if the paths in docker volumes are generated by docker, and wait until they are generated.

Templates

The template/ directory contains template files.

  1. .env.j2: a .env template file, which ansible will replace it with correct variables
  2. 3_plugin-kafka-override-common.yml.j2: Use to override some docker services.
  3. deploy.sh.j2: uShell script, used to start,restart,stop notification service

Vars

The vars/ directory contains all the variables, for each version of notification-service, for each version we need some variables, and URL that ansible needs to