blob: e677ebbb0067f834f3dfdfbb96946857ca497547 [file] [log] [blame]
#
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
---
# Create the directory for Helix deployment
- name: Create helix deployment directory
file: path="{{ helix_dir }}" state=directory owner={{ user }} group={{ group }} recurse=yes
# Setup Helix
- name: Download and unarchive Helix
unarchive: src="{{ helix_url }}"
dest="{{ helix_dir }}"
copy=no
owner="{{ user }}"
group="{{ group }}"
become: yes
# Create the cluster
- name: Create Helix Cluster
command: "{{ item }} chdir={{ helix_dir }}/helix-core-{{ helix_version }}/"
with_items:
- ./bin/helix-admin.sh --zkSvr {{ zookeeper_connection_url }} --dropCluster {{ helix_cluster_name }}
- ./bin/helix-admin.sh --zkSvr {{ zookeeper_connection_url }} --addCluster {{ helix_cluster_name }}
ignore_errors: yes
- name: Stop daemons if running
command: "{{ item.command }} chdir={{ helix_dir }}/{{ item.dir }}/"
with_items:
- { command: ./bin/controller-daemon.sh stop, dir: "{{ helix_controller_version }}" }
- { command: ./bin/participant-daemon.sh stop, dir: "{{ helix_participant_version }}" }
- { command: ./bin/pre-wm-daemon.sh stop, dir: "{{ helix_pre_wm_version }}" }
- { command: ./bin/post-wm-daemon.sh stop, dir: "{{ helix_post_wm_version }}" }
ignore_errors: yes
- name: Delete lib, conf, bin directories of the distributions
file:
state: absent
path: "{{ helix_dir }}/{{ item }}"
with_items:
- "{{ helix_controller_version }}/lib"
- "{{ helix_controller_version }}/bin"
- "{{ helix_controller_version }}/conf"
- "{{ helix_participant_version }}/lib"
- "{{ helix_participant_version }}/bin"
- "{{ helix_participant_version }}/conf"
- "{{ helix_pre_wm_version }}/lib"
- "{{ helix_pre_wm_version }}/bin"
- "{{ helix_pre_wm_version }}/conf"
- "{{ helix_post_wm_version }}/lib"
- "{{ helix_post_wm_version }}/bin"
- "{{ helix_post_wm_version }}/conf"
ignore_errors: yes
# Copy required distributions to the deployment directory
- name: Copy distributions to airavata-helix deployment directory
unarchive: "src={{ airavata_source_dir }}/modules/distribution/target/{{ item }}
dest={{ helix_dir }}/ copy=no"
with_items:
- "{{ helix_controller_dist_name }}"
- "{{ helix_participant_dist_name }}"
- "{{ helix_pre_wm_dist_name }}"
- "{{ helix_post_wm_dist_name }}"
- "{{ helix_parser_wm_dist_name }}"
# Copy properties files & logback.xml files
- name: Copy Airavata server properties files
template: "src={{ item.name }}/airavata-server.properties.j2
dest={{ helix_dir }}/{{ item.dir }}/conf/airavata-server.properties
owner={{ user }}
group={{ group }}
mode=\"u=rw,g=r,o=r\""
with_items:
- { name: controller, dir: "{{ helix_controller_version }}" }
- { name: participant, dir: "{{ helix_participant_version }}" }
- { name: pre-wm, dir: "{{ helix_pre_wm_version }}" }
- { name: post-wm, dir: "{{ helix_post_wm_version }}" }
- { name: parser-wm, dir: "{{ helix_parser_wm_version }}" }
- name: Copy logback configuration file
template: "src={{ item.name }}/logback.xml.j2
dest={{ helix_dir }}/{{ item.dir }}/conf/logback.xml
owner={{ user }}
group={{ group }}
mode=\"u=rw,g=r,o=r\""
with_items:
- { name: controller, dir: "{{ helix_controller_version }}" }
- { name: participant, dir: "{{ helix_participant_version }}" }
- { name: pre-wm, dir: "{{ helix_pre_wm_version }}" }
- { name: post-wm, dir: "{{ helix_post_wm_version }}" }
- { name: parser-wm, dir: "{{ helix_parser_wm_version }}" }
- name: Create logs directory
file: "path={{ item }} state=directory owner={{ user }} group={{ group }}"
with_items:
- "{{ helix_controller_log_dir }}"
- "{{ helix_participant_log_dir }}"
- "{{ helix_pre_wm_dist_log_dir }}"
- "{{ helix_post_wm_dist_log_dir }}"
- "{{ helix_parser_wm_dist_log_dir }}"
- name: Stop daemons
command: "{{ item.command }} chdir={{ helix_dir }}/{{ item.dir }}/"
with_items:
- { command: ./bin/controller-daemon.sh stop, dir: "{{ helix_controller_version }}" }
- { command: ./bin/participant-daemon.sh stop, dir: "{{ helix_participant_version }}" }
- { command: ./bin/pre-wm-daemon.sh stop, dir: "{{ helix_pre_wm_version }}" }
- { command: ./bin/post-wm-daemon.sh stop, dir: "{{ helix_post_wm_version }}" }
- { command: ./bin/parser-wm-daemon.sh stop, dir: "{{ helix_parser_wm_version }}" }
# Run bash-scripts
- name: Start daemons
command: "{{ item.command }} chdir={{ helix_dir }}/{{ item.dir }}/"
with_items:
- { command: ./bin/controller-daemon.sh start, dir: "{{ helix_controller_version }}" }
- { command: ./bin/participant-daemon.sh start, dir: "{{ helix_participant_version }}" }
- { command: ./bin/pre-wm-daemon.sh start, dir: "{{ helix_pre_wm_version }}" }
- { command: ./bin/post-wm-daemon.sh start, dir: "{{ helix_post_wm_version }}" }
- { command: ./bin/parser-wm-daemon.sh start, dir: "{{ helix_parser_wm_version }}" }
- name: Openning Participant Monitoring Port
firewalld:
zone: public
permanent: yes
state: enabled
immediate: yes
rich_rule: rule family=ipv4 source address="{{ item }}" port port="{{ participant_monitoring_port }}" protocol=tcp accept
with_items:
- "{{ zk_subnets }}"
become: yes
- name: Openning Pre Workflow Manager Monitoring Port
firewalld:
zone: public
permanent: yes
state: enabled
immediate: yes
rich_rule: rule family=ipv4 source address="{{ item }}" port port="{{ pre_workflow_manager_monitoring_port }}" protocol=tcp accept
with_items:
- "{{ zk_subnets }}"
become: yes
- name: Openning Post Workflow Manager Monitoring Port
firewalld:
zone: public
permanent: yes
state: enabled
immediate: yes
rich_rule: rule family=ipv4 source address="{{ item }}" port port="{{ post_workflow_manager_monitoring_port }}" protocol=tcp accept
with_items:
- "{{ zk_subnets }}"
become: yes
- name: Openning Parser Workflow Manager Monitoring Port
firewalld:
zone: public
permanent: yes
state: enabled
immediate: yes
rich_rule: rule family=ipv4 source address="{{ item }}" port port="{{ parser_workflow_manager_monitoring_port }}" protocol=tcp accept
with_items:
- "{{ zk_subnets }}"
become: yes
#- name: systemd install helix setup service scripts
# template: src={{ item.template }}
# dest=/usr/lib/systemd/system/{{ item.service }}
# owner={{ user }}
# group={{ group }}
# mode="u=rw,g=r,o=r"
# notify: start {{ item.name }}
# with_items:
# - { template : controller/helixcontroller.service.j2, service: helixcontroller.service, name: helixcontroller }
# - { template : participant/helixparticipant.service.j2, service: helixparticipant.service, name: helixparticipant }
# - { template : pre-wm/prewm.service.j2, service: prewm.service, name: prewm }
# - { template : post-wm/postwm.service.j2, service: postwm.service, name: postwm }
# become: yes
#- name: Reload systemd daemons
# command: systemctl daemon-reload
# notify: restart {{ item }}
# with_items:
# - helixcontroller
# - helixparticipant
# - prewm
# - postwm
# become: yes
...