You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by ly...@apache.org on 2016/05/09 16:55:15 UTC

incubator-metron git commit: METRON-137 Improve output on ignored errors. (dlyle65535) closes apache/incubator-metron#110

Repository: incubator-metron
Updated Branches:
  refs/heads/master ec431b8dd -> bfb215849


METRON-137 Improve output on ignored errors. (dlyle65535) closes apache/incubator-metron#110


Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/bfb21584
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/bfb21584
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/bfb21584

Branch: refs/heads/master
Commit: bfb215849f5aa4123417bbe64938303ed977991d
Parents: ec431b8
Author: dlyle65535 <dl...@gmail.com>
Authored: Mon May 9 12:01:49 2016 -0400
Committer: David Lyle <dl...@gmail.com>
Committed: Mon May 9 12:01:49 2016 -0400

----------------------------------------------------------------------
 metron-deployment/roles/hadoop_setup/tasks/main.yml   | 10 +++++++---
 metron-deployment/roles/metron_ui/tasks/metron-ui.yml |  3 ++-
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bfb21584/metron-deployment/roles/hadoop_setup/tasks/main.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/hadoop_setup/tasks/main.yml b/metron-deployment/roles/hadoop_setup/tasks/main.yml
index de01abf..cc54641 100644
--- a/metron-deployment/roles/hadoop_setup/tasks/main.yml
+++ b/metron-deployment/roles/hadoop_setup/tasks/main.yml
@@ -18,20 +18,24 @@
 #must run on hadoop host
 - name: Create HBase tables
   shell: echo "create '{{ item }}','t'" | hbase shell -n
-  ignore_errors: yes
   with_items:
     - "{{ pcap_hbase_table }}"
     - "{{ tracker_hbase_table }}"
     - "{{ threatintel_hbase_table }}"
     - "{{ enrichment_hbase_table }}"
+  register: hbase_result
+  failed_when: hbase_result.rc != 0 and ("Table already exists" not in hbase_result.stdout)
+  changed_when: ("Table already exists" not in hbase_result.stdout)
 
-#if kafka topic
 - name: Create Kafka topics
   shell: "{{ kafka_home }}/bin/kafka-topics.sh --zookeeper {{ zookeeper_url }} --create --topic {{ item }} --partitions {{ num_partitions }} --replication-factor 1 --config retention.bytes={{ retention_in_gb * 1024 * 1024 * 1024}}"
-  ignore_errors: yes
   with_items:
     - "{{ pycapa_topic }}"
     - "{{ bro_topic }}"
     - "{{ yaf_topic }}"
     - "{{ snort_topic }}"
     - "{{ enrichments_topic }}"
+  register: kafka_result
+  failed_when: kafka_result.rc != 0 and ("already exists" not in kafka_result.stderr)
+  changed_when: ("already exists" not in kafka_result.stderr)
+

http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bfb21584/metron-deployment/roles/metron_ui/tasks/metron-ui.yml
----------------------------------------------------------------------
diff --git a/metron-deployment/roles/metron_ui/tasks/metron-ui.yml b/metron-deployment/roles/metron_ui/tasks/metron-ui.yml
index 548c1b0..a1ac454 100644
--- a/metron-deployment/roles/metron_ui/tasks/metron-ui.yml
+++ b/metron-deployment/roles/metron_ui/tasks/metron-ui.yml
@@ -40,7 +40,8 @@
   shell: pm2 stop all
   args:
     creates: /etc/init.d/pm2-init.sh
-  ignore_errors: True
+  register: pm2_result
+  failed_when: pm2_result.rc != 0 and ("No process found" not in pm2_result.stderr)
 
 - name: Configure Metron UI as a service
   shell: "{{ item }}"