<commit_before>{% set nn_host = salt['mine.get']('G@stack_id:' ~ grains.stack_id ~ ' and G@roles:hdp2.hadoop.namenode and not G@roles:hdp2.hadoop.standby', 'grains.items', 'compound').values()[0]['fqdn_ip4'][0] %}

# The scripts for starting services are in different places depending on the hdp version, so set them here
{% if pillar.hdp2.version.split('.')[1] | int >= 2 %}
{% set oozie_home = '/usr/hdp/current/oozie-server' %}
{% set oozie_data_dir = '/var/lib/oozie/data' %}

copy_ssl_conf:
  cmd:
    - run
    - user: root
    - name: cp -r {{ oozie_home }}/tomcat-deployment/conf/ssl /etc/oozie/conf
    - unless: 'test -d /etc/oozie/conf/ssl'
    - require:
      - pkg: oozie
    - require_in:
      - cmd: prepare_server

fix_symlink:
  cmd:
    - run
    - user: root
    - name: 'ln -s `find /usr/hdp -name {{ pillar.hdp2.version }}-*`/oozie `find /usr/hdp -name {{ pillar.hdp2.version }}-*`/oozie-server'
    - unless: 'test -d `find /usr/hdp -name {{ pillar.hdp2.version }}-*`/oozie'
    - require:
      - pkg: oozie
    - require_in:
      - cmd: prepare_server

{% else %}
{% set oozie_home = '/usr/lib/oozie' %}
{% set oozie_data_dir = '/var/lib/oozie' %}
{% endif %}

# 
# Start the Oozie service
#

oozie-svc:
  cmd:
    - run
    - user: oozie
    - name: {{ oozie_home }}/bin/oozied.sh start
    - unless: '. /etc/init.d/functions && pidofproc -p /var/run/oozie/oozie.pid'
    - require:
      - pkg: oozie
      - cmd: extjs
      - cmd: ooziedb
      - cmd: populate-oozie-sharelibs
      - file: /var/log/oozie
      - file: {{ oozie_home }}

prepare_server:
  cmd:
    - run<commit_msg>Unless execution was checking for wrong dir<commit_after>{% set nn_host = salt['mine.get']('G@stack_id:' ~ grains.stack_id ~ ' and G@roles:hdp2.hadoop.namenode and not G@roles:hdp2.hadoop.standby', 'grains.items', 'compound').values()[0]['fqdn_ip4'][0] %}

# The scripts for starting services are in different places depending on the hdp version, so set them here
{% if pillar.hdp2.version.split('.')[1] | int >= 2 %}
{% set oozie_home = '/usr/hdp/current/oozie-server' %}
{% set oozie_data_dir = '/var/lib/oozie/data' %}

copy_ssl_conf:
  cmd:
    - run
    - user: root
    - name: cp -r {{ oozie_home }}/tomcat-deployment/conf/ssl /etc/oozie/conf
    - unless: 'test -d /etc/oozie/conf/ssl'
    - require:
      - pkg: oozie
    - require_in:
      - cmd: prepare_server

fix_symlink:
  cmd:
    - run
    - user: root
    - name: 'ln -s `find /usr/hdp -name {{ pillar.hdp2.version }}-*`/oozie `find /usr/hdp -name {{ pillar.hdp2.version }}-*`/oozie-server'
    - unless: 'test -d `find /usr/hdp -name {{ pillar.hdp2.version }}-*`/oozie-server'
    - require:
      - pkg: oozie
    - require_in:
      - cmd: prepare_server

{% else %}
{% set oozie_home = '/usr/lib/oozie' %}
{% set oozie_data_dir = '/var/lib/oozie' %}
{% endif %}

# 
# Start the Oozie service
#

oozie-svc:
  cmd:
    - run
    - user: oozie
    - name: {{ oozie_home }}/bin/oozied.sh start
    - unless: '. /etc/init.d/functions && pidofproc -p /var/run/oozie/oozie.pid'
    - require:
      - pkg: oozie
      - cmd: extjs
      - cmd: ooziedb
      - cmd: populate-oozie-sharelibs
      - file: /var/log/oozie
      - file: {{ oozie_home }}

prepare_server:
  cmd:
    - run
{'fraction_non_alphanumeric': 0.17376647257125344, 'fraction_numerical': 0.006742261722341404, 'mean_word_length': 2.5172413793103448, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3790191', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1290, 'n_words': 275}