<commit_before>include:
  - nginx


/etc/apt/keys/aptly-squeeze-main.gpg:
  file.managed:
    - source: salt://aptly/configs/APT-GPG-KEY-APTLY
    - user: root
    - group: root
    - mode: 644

  cmd.wait:
    - name: apt-key add /etc/apt/keys/aptly-squeeze-main.gpg
    - watch:
      - file: /etc/apt/keys/aptly-squeeze-main.gpg

aptly:
  pkgrepo.managed:
    - name: deb http://repo.aptly.info/ squeeze main
    - file: /etc/apt/sources.list.d/aptly.list
    - require:
      - file: /etc/apt/keys/aptly-squeeze-main.gpg
      - cmd: /etc/apt/keys/aptly-squeeze-main.gpg
    - require_in:
      - pkg: aptly

  pkg:
    - installed

  group.present:
    - system: True

  user.present:
    - gid_from_name: True
    - home: /srv/aptly
    - createhome: False
    - system: True
    - require:
      - group: aptly


/srv/aptly:
  file.directory:
    - user: aptly
    - group: aptly
    - mode: 755
    - require:
      - user: aptly


/etc/aptly.conf:
  file.managed:
    - source: salt://aptly/configs/aptly.conf.jinja
    - template: jinja
    - user: root
    - group: aptly
    - mode: 640
    - require:
      - pkg: aptly
      - user: aptly


aptly-psf-repo:
  cmd.run:
    - name: aptly repo create -distribution=trusty psf
    - unless: aptly repo show psf
    - user: aptly
    - require:
      - pkg: aptly
      - file: /etc/aptly.conf
      - file: /srv/aptly


aptly-uploaders:
  group.present:
    - system: True
    - members: {{ salt["pillar.get"]("aptly:uploaders", []) }}  # " # Syntax Highlighter Hack

/srv/aptly/incoming:
  file.directory:
    - user: aptly
    - group: aptly-uploaders
    - mode: 770
    - require:
      - user: aptly
      - group: aptly-uploaders
      - file: /srv/aptly


/srv/aptly/incoming/psf:
  file.directory:<commit_msg>Use addusers / delusers instead of members<commit_after>include:
  - nginx


/etc/apt/keys/aptly-squeeze-main.gpg:
  file.managed:
    - source: salt://aptly/configs/APT-GPG-KEY-APTLY
    - user: root
    - group: root
    - mode: 644

  cmd.wait:
    - name: apt-key add /etc/apt/keys/aptly-squeeze-main.gpg
    - watch:
      - file: /etc/apt/keys/aptly-squeeze-main.gpg

aptly:
  pkgrepo.managed:
    - name: deb http://repo.aptly.info/ squeeze main
    - file: /etc/apt/sources.list.d/aptly.list
    - require:
      - file: /etc/apt/keys/aptly-squeeze-main.gpg
      - cmd: /etc/apt/keys/aptly-squeeze-main.gpg
    - require_in:
      - pkg: aptly

  pkg:
    - installed

  group.present:
    - system: True

  user.present:
    - gid_from_name: True
    - home: /srv/aptly
    - createhome: False
    - system: True
    - require:
      - group: aptly


/srv/aptly:
  file.directory:
    - user: aptly
    - group: aptly
    - mode: 755
    - require:
      - user: aptly


/etc/aptly.conf:
  file.managed:
    - source: salt://aptly/configs/aptly.conf.jinja
    - template: jinja
    - user: root
    - group: aptly
    - mode: 640
    - require:
      - pkg: aptly
      - user: aptly


aptly-psf-repo:
  cmd.run:
    - name: aptly repo create -distribution=trusty psf
    - unless: aptly repo show psf
    - user: aptly
    - require:
      - pkg: aptly
      - file: /etc/aptly.conf
      - file: /srv/aptly


aptly-uploaders:
  group.present:
    - system: True
    - addusers: {{ salt["pillar.get"]("aptly:uploaders", []) }}  # " # Syntax Highlighter Hack
    - delusers: {{ salt["pillar.get"]("aptly:nonuploaders", []) }}  # " # Syntax Highlighter Hack

/srv/aptly/incoming:
  file.directory:
    - user: aptly
    - group: aptly-uploaders
    - mode: 770
    - require:
      - user: aptly
      - group: aptly-uploaders
      - file: /srv/aptly


/srv/aptly/incoming/psf:
  file.directory:
{'fraction_non_alphanumeric': 0.14149918522542096, 'fraction_numerical': 0.006518196632265073, 'mean_word_length': 1.9253375694996029, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2838890', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1439, 'n_words': 269}