blob: a1aa2370205de89f288d0c3de60a55806c7060c2 [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: Create Bulk load working Directory
file:
path: "{{ threat_intel_work_dir }}"
state: directory
- name: Copy extractor.json to {{ inventory_hostname }}
copy:
src: ../roles/metron_streaming/files/extractor.json
dest: "{{ threat_intel_work_dir }}"
mode: 0644
- name: Copy Bulk Load CSV File
template:
src: "{{ threat_intel_csv_filepath }}"
dest: "{{ threat_intel_work_dir }}/{{ threat_intel_csv_filename }}"
mode: 0644
- name: Copy Bulk Load CSV File to HDFS
command: "hdfs dfs -put -f {{ threat_intel_work_dir }}/{{ threat_intel_csv_filename }} ."
- name: Run Threat Intel Bulk Load
shell: "{{ threat_intel_bin }} -c t -t {{threatintel_hbase_table}} -e {{ threat_intel_work_dir }}/extractor.json -i /user/root -m MR && touch {{ threat_intel_work_dir }}/loaded"
args:
creates: "{{ threat_intel_work_dir }}/loaded"
- name: Clean up HDFS File
command: "hdfs dfs -rm {{ threat_intel_csv_filename }}"