<commit_before>{% set roles = salt['grains.get']('roles', []) %}

nodejs-dep:
  cmd.run:
    - name: curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
    - unless: test -e /etc/yum.repos.d/nodesource-el.repo

nodejs-install:
  pkg.latest:
    - name: {{ pillar['pkgs']['nodejs'] }}
    - require:
      - cmd: nodejs-dep

forever:
  npm.installed:
    - require:
      - pkg: nodejs-install

forever-service:
  npm.installed:
    - require:
      - pkg: nodejs-install

node_user:
  user.present:
    - name: node
    - home: /home/node

node_home:
  file.directory:
    - name: /home/node
    - user: node
    - group: node
    - mode: 755
    - require:
      - user: node_user

node_group:
  group.present:
    - name: node
    - system: True
    - members:
      - node

/var/log/node:
  file.directory:<commit_msg>Add github ssh files to node user<commit_after>{% set roles = salt['grains.get']('roles', []) %}

nodejs-dep:
  cmd.run:
    - name: curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
    - unless: test -e /etc/yum.repos.d/nodesource-el.repo

nodejs-install:
  pkg.latest:
    - name: {{ pillar['pkgs']['nodejs'] }}
    - require:
      - cmd: nodejs-dep

forever:
  npm.installed:
    - require:
      - pkg: nodejs-install

forever-service:
  npm.installed:
    - require:
      - pkg: nodejs-install

node_user:
  user.present:
    - name: node
    - home: /home/node

node_home:
  file.directory:
    - name: /home/node
    - user: node
    - group: node
    - mode: 755
    - require:
      - user: node_user

/home/node/.ssh:
  file.directory:
    - user: node
    - group: node
    - mode: 600
    - makedirs: True

{% for file in ['config','github_id_rsa','github_id_rsa.pub'] %}

/home/node/.ssh/{{ file }}:
  file.managed:
    - source: salt://ssh/{{ file }}
    - mode: {{ '600' if file == 'github_id_rsa' else '644' }}
    - user: node
    - group: node
    - require:
      - file: /home/node/.ssh

{% endfor %}

node_group:
  group.present:
    - name: node
    - system: True
    - members:
      - node

/var/log/node:
  file.directory:
{'fraction_non_alphanumeric': 0.16280170373876005, 'fraction_numerical': 0.008045433033601515, 'mean_word_length': 2.117994100294985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7409639', 'n_tokens_mistral': 835, 'n_tokens_neox': 791, 'n_words': 164}