blob: fd3422b8dde2bb8198a12fec04eddb13ea7fbcd4 [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.
#
---
- name: Install Metron UI dependencies
yum:
pkg: "{{ item }}"
state: installed
with_items:
- libpcap-devel
- wireshark
- nodejs
- npm
register: result
until: result.rc == 0
retries: 5
delay: 10
- include: copy-source.yml
- name: Configure Metron UI
lineinfile:
dest="{{ metron_ui_directory }}/config.json"
regexp="{{ item.regexp }}"
line="{{ item.line }}"
state=present
with_items:
- { regexp: '"elasticsearch":', line: '"elasticsearch": { "url": "http://{{ groups.search[0] }}:{{ elasticsearch_web_port }}" },' }
- { regexp: '"pcap":', line: ' "pcap": { "url": "http://{{ groups.web[0] }}:{{ pcapservice_port }}/pcapGetter","mock": false }' }
- name: Install Node dependencies
npm:
name: pm2
path: "{{ metron_ui_directory }}"
global: true
- name: Install Metron UI
npm:
path: "{{ metron_ui_directory }}"
production: no
- name: Start Metron UI
shell: "pm2 start {{ metron_ui_directory }}/lib/metron-ui.js --name metron"