<commit_before>{% set postgresql = salt["pillar.get"]("postgresql", {}) %}
{% set data_partitions = salt["rackspace.data_partitions"]() %}

{% if salt["match.compound"](pillar["roles"]["postgresql-replica"]) %}
{% set postgresql_primary = ((salt["mine.get"](pillar["roles"]["postgresql-primary"], "minealiases.psf_internal", expr_form="compound").items())|sort(attribute='0')|first)[1]|sort()|first %}
{% else %}
{% set postgresql_replicas = salt["mine.get"](pillar["roles"]["postgresql-replica"], "minealiases.psf_internal", expr_form="compound") %}
{% endif %}

{% if data_partitions|length() > 1 %}
This Does Not Support Multi Data Disk Servers!!!!
{% endif %}

include:
  - monitoring.client.collectors.postgresql
{% if salt["match.compound"](pillar["roles"]["postgresql-primary"]) %}
  - .wal-e
{% endif %}

postgresql-data:
{% if data_partitions %}
  blockdev.formatted:
    - name: /dev/{{ data_partitions[0].partition }}
    - fs_type: ext4

  mount.mounted:
    - name: /srv/postgresql
    - device: /dev/{{ data_partitions[0].partition }}
    - fstype: ext4
    - mkmnt: True
    - opts: "data=writeback,noatime,nodiratime"
    - require:<commit_msg>Remove an unused mine.get<commit_after>{% set postgresql = salt["pillar.get"]("postgresql", {}) %}
{% set data_partitions = salt["rackspace.data_partitions"]() %}

{% if salt["match.compound"](pillar["roles"]["postgresql-replica"]) %}
{% set postgresql_primary = ((salt["mine.get"](pillar["roles"]["postgresql-primary"], "minealiases.psf_internal", expr_form="compound").items())|sort(attribute='0')|first)[1]|sort()|first %}
{% endif %}

{% if data_partitions|length() > 1 %}
This Does Not Support Multi Data Disk Servers!!!!
{% endif %}

include:
  - monitoring.client.collectors.postgresql
{% if salt["match.compound"](pillar["roles"]["postgresql-primary"]) %}
  - .wal-e
{% endif %}

postgresql-data:
{% if data_partitions %}
  blockdev.formatted:
    - name: /dev/{{ data_partitions[0].partition }}
    - fs_type: ext4

  mount.mounted:
    - name: /srv/postgresql
    - device: /dev/{{ data_partitions[0].partition }}
    - fstype: ext4
    - mkmnt: True
    - opts: "data=writeback,noatime,nodiratime"
    - require:
{'fraction_non_alphanumeric': 0.20247366010077875, 'fraction_numerical': 0.00641319285387082, 'mean_word_length': 5.049861495844875, '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': '3494529', 'n_tokens_mistral': 834, 'n_tokens_neox': 789, 'n_words': 118}