<commit_before>---
- hosts: hypervisors
  vars_files:
    - vars/credentials.yml
  roles:
    - common
    - users
    - ssh
    - security
    - dotfiles
    - mailer
    - monitoring
    - ups
    - ipmi
    - virtualization
    - zfs
    - samba
    - snapraid
    - hdparm
    - pci_passthrough

  tasks:

    - name: Add mediaaccess group
      group: name=mediaaccess state=present
      sudo: true

    - name: Add users to mediaaccess group
      user: name={{item}} groups=mediaaccess append=yes
      sudo: true
      with_items: user_groups.mediaaccess

    - name: Create snapraid user
      user: name=snapraid
      sudo: true

    - name: Add users to snapraid group
      user: name={{item}} groups=snapraid append=yes
      sudo: true
      with_items: user_groups.snapraid

    - name: Add adrien to kvm group
      user: name=adrien groups=kvm append=yes
      sudo: true

    - name: Create mount points
      file: dest={{item.path}} state=directory owner={{item.owner}} group={{item.group}} mode={{item.mode}}
      sudo: true
      with_items:
        - {path: '/mnt/media',       owner: 'tretflix',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_d1', owner: 'adrien',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_d2', owner: 'adrien',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_d3', owner: 'adrien',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_p1', owner: 'snapraid',     group: 'snapraid',    mode: '2750'}
        - {path: '/mnt/vms',         owner: 'libvirt-qemu', group: 'kvm',         mode: '2770'}
        - {path: '/mnt/tank',        owner: 'adrien',       group: 'adrien',      mode: '2770'}

    - name: Mount btrfs partitons
      mount: "name={{item.mountpoint}} src='LABEL={{item.label}}' state=present fstype=btrfs opts='{{item.opts}}'"
      sudo: true
      with_items:
        - {mountpoint: '/mnt/snapraid_d1', label: 'snapraid_d1', opts: 'defaults,noatime,nodiratime'}
        - {mountpoint: '/mnt/snapraid_d2', label: 'snapraid_d2', opts: 'defaults,noatime,nodiratime'}
        - {mountpoint: '/mnt/snapraid_d3', label: 'snapraid_d3', opts: 'defaults,noatime,nodiratime'}
        - {mountpoint: '/mnt/snapraid_p1', label: 'snapraid_p1', opts: 'defaults,noatime,nodiratime'}

    - name: Install mhddfs
      apt: package=mhddfs state=installed
      sudo: true

    - name: Mount mhddfs partition
      sudo: true
      mount: 'name=/mnt/media src=mhddfs#/mnt/snapraid_d1/media,/mnt/snapraid_d2/media,/mnt/snapraid_d3/media fstype=fuse opts=defaults,noatime,allow_other state=present'

    - name: Install gparted
      apt: pkg=gparted state=installed
      sudo: true

  post_tasks:

    - name: Check if reboot is required
      stat: path=/var/run/reboot-required
      register: should_reboot

    - name: Reboot the system
      command: reboot
      sudo: true
      when: should_reboot.stat.exists == True
      register: rebooting

    - name: Wait for ssh to come back up
      local_action: wait_for port=22 delay=20 host=10.0.0.11
      when: rebooting|changed
<commit_msg>Add mlimit<commit_after>---
- hosts: hypervisors
  vars_files:
    - vars/credentials.yml
  roles:
    - common
    - users
    - ssh
    - security
    - dotfiles
    - mailer
    - monitoring
    - ups
    - ipmi
    - virtualization
    - zfs
    - samba
    - snapraid
    - hdparm
    - pci_passthrough

  tasks:

    - name: Add mediaaccess group
      group: name=mediaaccess state=present
      sudo: true

    - name: Add users to mediaaccess group
      user: name={{item}} groups=mediaaccess append=yes
      sudo: true
      with_items: user_groups.mediaaccess

    - name: Create snapraid user
      user: name=snapraid
      sudo: true

    - name: Add users to snapraid group
      user: name={{item}} groups=snapraid append=yes
      sudo: true
      with_items: user_groups.snapraid

    - name: Add adrien to kvm group
      user: name=adrien groups=kvm append=yes
      sudo: true

    - name: Create mount points
      file: dest={{item.path}} state=directory owner={{item.owner}} group={{item.group}} mode={{item.mode}}
      sudo: true
      with_items:
        - {path: '/mnt/media',       owner: 'tretflix',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_d1', owner: 'adrien',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_d2', owner: 'adrien',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_d3', owner: 'adrien',       group: 'mediaaccess', mode: '2770'}
        - {path: '/mnt/snapraid_p1', owner: 'snapraid',     group: 'snapraid',    mode: '2750'}
        - {path: '/mnt/vms',         owner: 'libvirt-qemu', group: 'kvm',         mode: '2770'}
        - {path: '/mnt/tank',        owner: 'adrien',       group: 'adrien',      mode: '2770'}

    - name: Mount btrfs partitons
      mount: "name={{item.mountpoint}} src='LABEL={{item.label}}' state=present fstype=btrfs opts='{{item.opts}}'"
      sudo: true
      with_items:
        - {mountpoint: '/mnt/snapraid_d1', label: 'snapraid_d1', opts: 'defaults,noatime,nodiratime'}
        - {mountpoint: '/mnt/snapraid_d2', label: 'snapraid_d2', opts: 'defaults,noatime,nodiratime'}
        - {mountpoint: '/mnt/snapraid_d3', label: 'snapraid_d3', opts: 'defaults,noatime,nodiratime'}
        - {mountpoint: '/mnt/snapraid_p1', label: 'snapraid_p1', opts: 'defaults,noatime,nodiratime'}

    - name: Install mhddfs
      apt: package=mhddfs state=installed
      sudo: true

    - name: Mount mhddfs partition
      sudo: true
      mount: 'name=/mnt/media src=mhddfs#/mnt/snapraid_d1/media,/mnt/snapraid_d2/media,/mnt/snapraid_d3/media fstype=fuse opts="mlimit=32G,defaults,noatime,allow_other" state=present'

    - name: Install gparted
      apt: pkg=gparted state=installed
      sudo: true

  post_tasks:

    - name: Check if reboot is required
      stat: path=/var/run/reboot-required
      register: should_reboot

    - name: Reboot the system
      command: reboot
      sudo: true
      when: should_reboot.stat.exists == True
      register: rebooting

    - name: Wait for ssh to come back up
      local_action: wait_for port=22 delay=20 host=10.0.0.11
      when: rebooting|changed

{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.017142857142857144, 'mean_word_length': 2.5679501698754246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2589524', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2143, 'n_words': 505}